这篇教程C++ wxStrlen函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wxStrlen函数的典型用法代码示例。如果您正苦于以下问题:C++ wxStrlen函数的具体用法?C++ wxStrlen怎么用?C++ wxStrlen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wxStrlen函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wxFileDialogvoid CDistinta::SalvaDistinta(bool saveas){ wxFile ff; wxString nome_file; int uu; RigaDist* rd; ListaRighe::Node* nrd; if (saveas) { fd = new wxFileDialog(NULL, "Save As...",dist_path,nome_dist,"*.dat", wxFD_SAVE); if (fd->ShowModal() == wxID_CANCEL) { delete fd; return; // the user changed idea... } nome_dist = fd->GetFilename(); nome_file = dist_path+nome_dist; } else nome_file = ".//DISTINTA.DAT"; ff.Open(nome_file,wxFile::write); //se salvataggio distinta attuale //come prima cosa salvo il nome della distinta... if(saveas==false) { uu=wxStrlen(nome_dist); ff.Write(&uu,sizeof(int)); if (uu>0) ff.Write(nome_dist,wxMBConvUTF8()); } //... e poi tutte le righe... nrd=lista->GetFirst(); while (nrd) { rd = nrd->GetData(); for(int ii=0; ii<num_var; ii++) { ff.Write(&rd->dati.d[ii],sizeof(double)); ff.Write(&rd->dati.i[ii],sizeof(int)); } for(int ii=0; ii<num_var; ii++) { uu=wxStrlen(rd->dati.s[ii]); ff.Write(&uu,sizeof(int)); if (uu>0) ff.Write(rd->dati.s[ii],wxMBConvUTF8()); } //TODO vedere se passare all'ascii 8 bit nrd = nrd->GetNext(); } ff.Close(); statusbar->SetStatusText(nome_dist,0);}
开发者ID:andreafz,项目名称:wxHMI,代码行数:60,
示例2: wxPutsvoid InteractiveInputTestCase::TestRegExInteractive(){#ifdef TEST_REGEX wxPuts(wxT("*** Testing RE interactively ***")); for ( ;; ) { wxChar pattern[128]; wxPrintf(wxT("Enter a pattern (press ENTER or type 'quit' to escape): ")); if ( !wxFgets(pattern, WXSIZEOF(pattern), stdin) ) break; // kill the last '/n' pattern[wxStrlen(pattern) - 1] = 0; if (pattern[0] == '/0' || wxStrcmp(pattern, "quit") == 0) break; wxRegEx re; if ( !re.Compile(pattern) ) { continue; } wxChar text[128]; for ( ;; ) { wxPrintf(wxT("Enter text to match: ")); if ( !wxFgets(text, WXSIZEOF(text), stdin) ) break; // kill the last '/n' text[wxStrlen(text) - 1] = 0; if ( !re.Matches(text) ) { wxPrintf(wxT("No match./n")); } else { wxPrintf(wxT("Pattern matches at '%s'/n"), re.GetMatch(text).c_str()); size_t start, len; for ( size_t n = 1; ; n++ ) { if ( !re.GetMatch(&start, &len, n) ) { break; } wxPrintf(wxT("Subexpr %u matched '%s'/n"), n, wxString(text + start, len).c_str()); } } } wxPuts("/n"); }#endif // TEST_REGEX}
开发者ID:ruifig,项目名称:nutcracker,代码行数:60,
示例3: buffervoid VarArgTestCase::RepeatedPrintf(){ wxCharBuffer buffer(2); char *p = buffer.data(); *p = 'h'; p++; *p = 'i'; wxString s; s = wxString::Format("buffer %s, len %d", buffer, (int)wxStrlen(buffer)); CPPUNIT_ASSERT_EQUAL("buffer hi, len 2", s); s = wxString::Format("buffer %s, len %d", buffer, (int)wxStrlen(buffer)); CPPUNIT_ASSERT_EQUAL("buffer hi, len 2", s);}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:15,
示例4: wxStrlenwxString::size_type wxFilterClassFactoryBase::FindExtension( const wxChar *location) const{ size_t len = wxStrlen(location); for (const wxChar *const *p = GetProtocols(wxSTREAM_FILEEXT); *p; p++) { size_t l = wxStrlen(*p); if (l <= len && wxStrcmp(*p, location + len - l) == 0) return len - l; } return wxString::npos;}
开发者ID:hgwells,项目名称:tive,代码行数:15,
示例5: GetActiveProjectbool EffectDtmf::Init(){ // dialog will be passed values from effect // Effect retrieves values from saved config // Dialog will take care of using them to initialize controls // If there is a selection, use that duration, otherwise use // value from saved config: this is useful is user wants to // replace selection with dtmf sequence if (mT1 > mT0) { // there is a selection: let's fit in there... // MJS: note that this is just for the TTC and is independent of the track rate // but we do need to make sure we have the right number of samples at the project rate AudacityProject *p = GetActiveProject(); double projRate = p->GetRate(); double quantMT0 = QUANTIZED_TIME(mT0, projRate); double quantMT1 = QUANTIZED_TIME(mT1, projRate); mDuration = quantMT1 - quantMT0; mIsSelection = true; } else { // retrieve last used values gPrefs->Read(wxT("/Effects/DtmfGen/SequenceDuration"), &mDuration, 1L); mIsSelection = false; } gPrefs->Read(wxT("/Effects/DtmfGen/String"), &dtmfString, wxT("audacity")); gPrefs->Read(wxT("/Effects/DtmfGen/DutyCycle"), &dtmfDutyCycle, 550L); gPrefs->Read(wxT("/Effects/DtmfGen/Amplitude"), &dtmfAmplitude, 0.8f); dtmfNTones = wxStrlen(dtmfString); return true;}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:32,
示例6: wxStrlenint AutoCompData::FindString( const wxChar* word, const wxChar* words, const wxArrayInt& indicies ){ // Do a simple binary search using the index array // to find the strings in the word list. It's all // sorted, so it should be super quick. size_t i, lo = 0, hi = indicies.GetCount(); int res; const wxChar* other; size_t wordLen = wxStrlen( word ); while ( lo < hi ) { i = (lo + hi) / 2; other = words + indicies[i]; res = wxStrnicmp(word, other, wordLen); if ( res < 0 ) hi = i; else if ( res > 0 ) lo = i + 1; else return i; } return -1;}
开发者ID:Duion,项目名称:Torsion,代码行数:29,
示例7: wxTbool EffectDtmf::Init(){ // dialog will be passed values from effect // Effect retrieves values from saved config // Dialog will take care of using them to initialize controls // If there is a selection, use that duration, otherwise use // value from saved config: this is useful is user wants to // replace selection with dtmf sequence if (mT1 > mT0) { // there is a selection: let's fit in there... mDuration = mT1 - mT0; mIsSelection = true; } else { // retrieve last used values gPrefs->Read(wxT("/CsPresets/DtmfGen_SequenceDuration"), &mDuration, 1L); mIsSelection = false; } /// /todo this code shouldn't be using /CsPresets - need to review its use gPrefs->Read(wxT("/CsPresets/DtmfGen_String"), &dtmfString, wxT("audacity")); gPrefs->Read(wxT("/CsPresets/DtmfGen_DutyCycle"), &dtmfDutyCycle, 550L); gPrefs->Read(wxT("/CsPresets/DtmfGen_Amplitude"), &dtmfAmplitude, 0.8f); dtmfNTones = wxStrlen(dtmfString); return true;}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:27,
示例8: GTK_ENTRYwxString wxComboBox::DoGetValue() const{ GtkEntry *entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry ); wxString tmp( wxGTK_CONV_BACK( gtk_entry_get_text( entry ) ) );#if 0#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */# pragma ivdep# pragma swp# pragma unroll# pragma prefetch# if 0# pragma simd noassert# endif#endif /* VDM auto patch */ for (int i = 0; i < wxStrlen(tmp.c_str()) +1; i++) { wxChar c = tmp[i]; printf( "%d ", (int) (c) ); } printf( "/n" );#endif return tmp;}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:25,
示例9: WXUNUSEDvoid wxMetafileDC::GetTextExtent(const wxString& string, long *x, long *y, long *descent, long *externalLeading, wxFont *theFont, bool WXUNUSED(use16bit)) const{ wxFont *fontToUse = theFont; if (!fontToUse) fontToUse = (wxFont*) &m_font; HDC dc = GetDC(NULL); SIZE sizeRect; TEXTMETRIC tm; ::GetTextExtentPoint32(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect); GetTextMetrics(dc, &tm); ReleaseDC(NULL, dc); if ( x ) *x = sizeRect.cx; if ( y ) *y = sizeRect.cy; if ( descent ) *descent = tm.tmDescent; if ( externalLeading ) *externalLeading = tm.tmExternalLeading;}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:25,
示例10: IsNumberedAccelKey// return prefixCode+number if the string is of the form "<prefix><number>" and// 0 if it isn't//// first and last parameter specify the valid domain for "number" partstatic int IsNumberedAccelKey(const wxString& str, const wxChar *prefix, wxKeyCode prefixCode, unsigned first, unsigned last){ const size_t lenPrefix = wxStrlen(prefix); if ( !CompareAccelString(str.Left(lenPrefix), prefix) ) return 0; unsigned long num; if ( !str.Mid(lenPrefix).ToULong(&num) ) return 0; if ( num < first || num > last ) { // this must be a mistake, chances that this is a valid name of another // key are vanishingly small wxLogDebug(_T("Invalid key string /"%s/""), str.c_str()); return 0; } return prefixCode + num - first;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:29,
示例11: mainint main(int argc, char **argv){ wxApp::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, "program"); wxInitializer initializer; if ( !initializer ) { fprintf(stderr, "Failed to initialize the wxWidgets library, aborting."); return -1; } wxCmdLineParser parser(cmdLineDesc, argc, argv); switch ( parser.Parse() ) { case -1: // help was given, terminating break; case 0: // everything is ok; proceed if (parser.Found("d")) { wxPrintf("Dummy switch was given.../n"); while (1) { wxChar input[128]; wxPrintf("Try to guess the magic number (type 'quit' to escape): "); if ( !wxFgets(input, WXSIZEOF(input), stdin) ) break; // kill the last '/n' input[wxStrlen(input) - 1] = 0; if (wxStrcmp(input, "quit") == 0) break; long val; if (!wxString(input).ToLong(&val)) { wxPrintf("Invalid number.../n"); continue; } if (val == 42) wxPrintf("You guessed!/n"); else wxPrintf("Bad luck!/n"); } } break; default: break; } // do something useful here return 0;}
开发者ID:euler0,项目名称:Helium,代码行数:60,
示例12: wxT// assigns C stringwxStringImpl& wxStringImpl::operator=(const wxStringCharType *psz){ if ( !AssignCopy(wxStrlen(psz), psz) ) { wxFAIL_MSG( wxT("out of memory in wxStringImpl::operator=(const wxStringCharType *)") ); } return *this;}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:8,
示例13: fdvoid ChatLog::FillLastLineArray(){ int fd ( open(GetCurrentLogfilePath().mb_str(), O_RDONLY) ); if ( fd < 0 ) { wxLogError(_T("%s: failed to open log file."), __PRETTY_FUNCTION__); return; } size_t num_lines ( sett().GetAutoloadedChatlogLinesCount() ); m_last_lines.Clear(); m_last_lines.Alloc(num_lines); const wxChar* wc_EOL ( wxTextBuffer::GetEOL() ); size_t eol_num_chars ( wxStrlen(wc_EOL) );#ifndef WIN32 char* eol ( static_cast<char*>( alloca(eol_num_chars) ) );#else char* eol ( new char[eol_num_chars] );#endif wxConvUTF8.WC2MB(eol, wc_EOL, eol_num_chars); size_t lines_added ( find_tail_sequences(fd, eol, eol_num_chars, num_lines, m_last_lines) ); wxLogMessage(_T("ChatLog::FillLastLineArray: Loaded %lu lines from %s."), lines_added, GetCurrentLogfilePath().c_str()); close(fd);#ifdef WIN32 delete[] eol;#endif}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:30,
示例14: InstallDebugAssertOutputHandlerbool wxApp::Initialize(int& argc, wxChar **argv){ // Mac-specific#if wxDEBUG_LEVEL && wxOSX_USE_COCOA_OR_CARBON InstallDebugAssertOutputHandler( NewDebugAssertOutputHandlerUPP( wxMacAssertOutputHandler ) );#endif /* Cocoa supports -Key value options which set the user defaults key "Key" to the value "value" Some of them are very handy for debugging like -NSShowAllViews YES. Cocoa picks these up from the real argv so our removal of them from the wx copy of it does not affect Cocoa's ability to see them. We basically just assume that any "-NS" option and its following argument needs to be removed from argv. We hope that user code does not expect to see -NS options and indeed it's probably a safe bet since most user code accepting options is probably using the double-dash GNU-style syntax. */ for(int i=1; i < argc; ++i) { static const wxChar *ARG_NS = wxT("-NS"); if( wxStrncmp(argv[i], ARG_NS, wxStrlen(ARG_NS)) == 0 ) { // Only eat this option if it has an argument if( (i + 1) < argc ) { memmove(argv + i, argv + i + 2, (argc-i-1)*sizeof(wxChar*)); argc -= 2; // drop back one position so the next run through the loop // reprocesses the argument at our current index. --i; } } } if ( !wxAppBase::Initialize(argc, argv) ) return false;#if wxUSE_INTL wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding());#endif // these might be the startup dirs, set them to the 'usual' dir containing the app bundle wxString startupCwd = wxGetCwd() ; if ( startupCwd == wxT("/") || startupCwd.Right(15) == wxT("/Contents/MacOS") ) { CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle() ) ; CFURLRef urlParent = CFURLCreateCopyDeletingLastPathComponent( kCFAllocatorDefault , url ) ; CFRelease( url ) ; CFStringRef path = CFURLCopyFileSystemPath ( urlParent , kCFURLPOSIXPathStyle ) ; CFRelease( urlParent ) ; wxString cwd = wxCFStringRef(path).AsString(wxLocale::GetSystemEncoding()); wxSetWorkingDirectory( cwd ) ; } return true;}
开发者ID:zhchbin,项目名称:wxWidgets,代码行数:60,
示例15: selFontvoid wxMetafileDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent, wxCoord *externalLeading, const wxFont *theFont) const{ const wxFont *fontToUse = theFont; if (!fontToUse) fontToUse = &m_font; ScreenHDC dc; SelectInHDC selFont(dc, GetHfontOf(*fontToUse)); SIZE sizeRect; TEXTMETRIC tm; ::GetTextExtentPoint32(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect); ::GetTextMetrics(dc, &tm); if ( x ) *x = sizeRect.cx; if ( y ) *y = sizeRect.cy; if ( descent ) *descent = tm.tmDescent; if ( externalLeading ) *externalLeading = tm.tmExternalLeading;}
开发者ID:beanhome,项目名称:dev,代码行数:26,
示例16: DoGetSearchFlagsvoid QuickFindBar::DoSearch(size_t searchFlags, int posToSearchFrom){ if(!m_sci || m_sci->GetLength() == 0 || m_findWhat->GetValue().IsEmpty()) return; // Clear all search markers if desired if (EditorConfigST::Get()->GetOptions()->GetClearHighlitWordsOnFind()) { m_sci->SetIndicatorCurrent(MARKER_WORD_HIGHLIGHT); m_sci->IndicatorClearRange(0, m_sci->GetLength()); } m_flags = DoGetSearchFlags(); wxString find = m_findWhat->GetValue(); wchar_t* pinput = DoGetSearchStringPtr(); if(!pinput) return; int start = -1, stop = -1; m_sci->GetSelection(&start, &stop); bool fwd = searchFlags & kSearchForward; bool addSelection = searchFlags & kSearchMultiSelect; bool incr = searchFlags & kSearchIncremental; int offset; if(posToSearchFrom != wxNOT_FOUND) { offset = posToSearchFrom; } else { offset = (!fwd || incr) ? start : stop; } int flags = m_flags | (fwd ? 0 : wxSD_SEARCH_BACKWARD); int pos = 0, len = 0; if(!StringFindReplacer::Search(pinput, offset, find.wc_str(), flags, pos, len)) { offset = fwd ? 0 : wxStrlen(pinput) - 1; if(!StringFindReplacer::Search(pinput, offset, find.wc_str(), flags, pos, len)) { m_findWhat->SetBackgroundColour(wxT("PINK")); m_findWhat->Refresh(); return; } } m_findWhat->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); m_findWhat->Refresh(); if(addSelection && m_sci->GetSelections()) { m_sci->AddSelection(pos, pos + len); } else { m_sci->ClearSelections(); m_sci->SetSelection(pos, pos + len); } // Ensure that the found string is visible (i.e. its line isn't folded away) // and that the user can see it without having to scroll int line = m_sci->LineFromPosition(pos); if(line >= 0) { m_sci->EnsureVisible(line); m_sci->EnsureCaretVisible(); }}
开发者ID:gahr,项目名称:codelite,代码行数:59,
示例17: srandbool MyApp::OnInit(){ poem_buffer = new wxChar[BUFFER_SIZE]; // Seed the random number generator#ifdef __WXWINCE__ srand((unsigned) CeGetRandomSeed());#else time_t current_time; (void)time(¤t_time); srand((unsigned int)current_time);#endif// randomize(); pages[0] = 0; TheMainWindow = new MainWindow(NULL, wxID_ANY, wxT("wxPoem"), wxPoint(XPos, YPos), wxDefaultSize, wxCAPTION|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCLOSE_BOX|wxFULL_REPAINT_ON_RESIZE ); TheMainWindow->canvas = new MyCanvas(TheMainWindow); if (argc > 1) { index_filename = wxStrcpy(new wxChar[wxStrlen(argv[1]) + 1], argv[1]); data_filename = wxStrcpy(new wxChar[wxStrlen(argv[1]) + 1], argv[1]); } else { index_filename = wxT(DEFAULT_POETRY_IND); data_filename = wxT(DEFAULT_POETRY_DAT); } TryLoadIndex(); TheMainWindow->GetIndexLoadPoem(); TheMainWindow->Resize(); TheMainWindow->Show(true); return true;}
开发者ID:beanhome,项目名称:dev,代码行数:45,
示例18: WXUNUSEDwxChar* SCCConnection::OnRequest(const wxString& WXUNUSED(topic), const wxString& item, int* size, wxIPCFormat WXUNUSED(format)) { if (item == scc_ipc_messages::reload_menu_msg) { assert(app != NULL); app->ReloadMenu(); *size = wxStrlen(scc_ipc_messages::ok_resp) * sizeof(wxChar) + sizeof(wxChar); return (wxChar*) scc_ipc_messages::ok_resp; } else { *size = wxStrlen(scc_ipc_messages::unknown_command_resp) * sizeof(wxChar) + sizeof(wxChar); return (wxChar*) scc_ipc_messages::unknown_command_resp; }}
开发者ID:cyclefusion,项目名称:szarp,代码行数:18,
示例19: wxGpiStrcmpint wxGpiStrcmp( wxChar* s0, wxChar* s1){ int l0; int l1; int l; int d; int d1; int i; int rc; rc = 0; if(s0 == NULL) { if(s1 == NULL) return 0; else return 32; } else if(s1 == NULL) return 32; l0 = wxStrlen(s0); l1 = wxStrlen(s1); l = l0; if(l0 != l1) { rc++; if(l1 < l0) l = l1; } for(i=0;i<l;i++) { d = s0[i]-s1[i]; if(!d) continue; d1 = wxToupper(s0[i]) - wxToupper(s1[i]); if(!d1) continue; rc += abs(d); } return rc;}
开发者ID:chromylei,项目名称:third_party,代码行数:44,
示例20: findIPwxString Config::validateConfig(){ wxRegEx findIP( wxT("^(([0-9]{1}|[0-9]{2}|[0-1][0-9]{2}|2[0-4][0-9]|25[0-5])//.){3}([0-9]{1}|[0-9]{2}|[0-1][0-9]{2}|2[0-4][0-9]|25[0-5])$")); wxRegEx b64Validate( wxT("^[A-Za-z0-9+/]+={0,3}$")); wxRegEx portStringValidate( wxT("(tcp|udp)/+[0-9]")); if (this->NICK_NAME.CmpNoCase(wxEmptyString) == 0 ) { return wxT("You must choose a Nickname."); } else if (this->SERVER_IP.Find(_(".")) == wxNOT_FOUND) { //check for valid ip or hostname -- Relex this check greatly and throw the error when trying to send. return wxT("You must supply a valid server address."); } else if((wxAtoi(this->SERVER_PORT) < 1 || wxAtoi(this->SERVER_PORT) > 65535) && this->SERVER_PORT.CmpNoCase(wxT("Random")) != 0){ return wxT("Invalid Server Port"); //check server port is valid port or random } else if (this->LEGACY == true && this->HMAC.CmpNoCase(wxEmptyString) != 0) {//check no hmac with legacy return wxT("You cannot use an HMAC in legacy mode."); } else if (this->KEY_BASE64 && wxStrlen(this->KEY) % 4 != 0) { //check base64 must have a multiple of 4 length return wxT("Invalid Base64 Key Length."); } else if (this->KEY_BASE64 && !b64Validate.Matches(this->KEY)) { // looks for disallowed b64 characters return wxT("Invalid Base64 Key."); } else if (this->HMAC_BASE64 && wxStrlen(this->HMAC) % 4 != 0) { //check base64 must have a multiple of 4 length return wxT("Invalid Base64 HMAC Length."); } else if (this->HMAC_BASE64 && !b64Validate.Matches(this->HMAC)) { // looks for disallowed b64 characters return wxT("Invalid Base64 HMAC."); } else if (!(this->MESS_TYPE.CmpNoCase(wxT("Server Command")) == 0 || portStringValidate.Matches(this->PORTS))) { //If not a server command, make sure the port string is valid return wxT("Invalid Port string. Must look like tcp/22."); } else if (!(this->ACCESS_IP.CmpNoCase(wxT("Resolve IP")) == 0 || this->ACCESS_IP.CmpNoCase(wxT("Source IP")) == 0 || this->ACCESS_IP.CmpNoCase(wxT("Prompt IP")) == 0 || findIP.Matches(this->ACCESS_IP) )) { //if specifying ip, make sure is valid return wxT("Invalid IP to allow."); // Have to have a valid ip to allow, if using allow ip } else if (this->MESS_TYPE.CmpNoCase(wxT("Nat Access")) == 0 && !(0 < wxAtoi(NAT_PORT) && wxAtoi(NAT_PORT) < 65536)) { //NAT_IP must be a valid ip, and NAT_PORT must be a valid port return wxT("Invalid NAT port."); } else if (!(this->DIGEST_TYPE.CmpNoCase(wxT("MD5")) == 0 || this->DIGEST_TYPE.CmpNoCase(wxT("SHA1")) == 0 || this->DIGEST_TYPE.CmpNoCase(wxT("SHA256")) == 0 || this->DIGEST_TYPE.CmpNoCase(wxT("SHA384")) == 0 || this->DIGEST_TYPE.CmpNoCase(wxT("SHA512")) == 0)) { return wxT("Invalid SPA digest type."); } else if (!(this->HMAC_TYPE.CmpNoCase(wxT("MD5")) == 0 || this->HMAC_TYPE.CmpNoCase(wxT("SHA1")) == 0 || this->HMAC_TYPE.CmpNoCase(wxT("SHA256")) == 0 || this->HMAC_TYPE.CmpNoCase(wxT("SHA384")) == 0 || this->HMAC_TYPE.CmpNoCase(wxT("SHA512")) == 0)) { return wxT("Invalid HMAC digest type."); } else { //Could check for valid looking gpg keys if enabled return wxT("valid"); }}
开发者ID:jp-bennett,项目名称:fwknop-gui,代码行数:44,
示例21: wxStrlenvoid ecUtils::UnicodeToCStr(const wxChar* str,char *&psz){ int nLength=1 + wxStrlen(str); psz=new char[nLength];#ifdef _UNICODE WideCharToMultiByte(CP_ACP, 0, str, -1, psz, nLength, NULL, NULL);#else strcpy(psz,str);#endif}
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:10,
示例22: AdvanceIfMatches// checks whether the given string starts with this substring and advances it// past it if it doesstatic inline bool AdvanceIfMatches(const wxChar **p, const wxChar *substr){ const size_t len = wxStrlen(substr); if ( wxStrncmp(*p, substr, len) != 0 ) return false; *p += len; return true;}
开发者ID:vadz,项目名称:mahogany,代码行数:12,
示例23: wxPrintfvoid SpellCheckCmdLineInterface::GetFeedback(){ wxChar strReplacement[256]; wxPrintf(_T("/nReplacement? : /n")); if ( !wxFgets(strReplacement, WXSIZEOF(strReplacement), stdin) ) m_nLastAction = ACTION_IGNORE; /* ignore the current misspelling */ else { strReplacement[wxStrlen(strReplacement) - 1] = '/0'; if (wxStrlen(strReplacement) == 0) { m_nLastAction = ACTION_IGNORE; /* ignore the current misspelling */ } else { m_nLastAction = ACTION_REPLACE; m_strReplaceWithText = strReplacement; } }}
开发者ID:BackupTheBerlios,项目名称:spellchecker-svn,代码行数:20,
示例24: copystringwxChar *copystring (const wxChar *s){ if (s == NULL) s = wxEmptyString; size_t len = wxStrlen (s) + 1; wxChar *news = new wxChar[len]; memcpy (news, s, len * sizeof(wxChar)); // Should be the fastest return news;}
开发者ID:252525fb,项目名称:rpcs3,代码行数:11,
示例25: wxStrlenwxString::size_type wxFilterClassFactoryBase::FindExtension( const wxString& location) const{ for (const wxChar *const *p = GetProtocols(wxSTREAM_FILEEXT); *p; p++) { if ( location.EndsWith(*p) ) return location.length() - wxStrlen(*p); } return wxString::npos;}
开发者ID:Anonymous2,项目名称:project64,代码行数:11,
示例26: wxStrlenvoid DtmfDialog::Recalculate(void) { // remember that dDutyCycle is in range (0-1000) double slot; dString = mDtmfStringT->GetValue(); dDuration = mDtmfDurationT->GetTimeValue(); dNTones = wxStrlen(dString); dDutyCycle = TrapLong(mDtmfDutyS->GetValue(), DUTY_MIN, DUTY_MAX); if (dNTones==0) { // no tones, all zero: don't do anything // this should take care of the case where user got an empty // dtmf sequence into the generator: track won't be generated dTone = 0; dDuration = 0; dSilence = dDuration; } else if (dNTones==1) { // single tone, as long as the sequence dSilence = 0; dTone = dDuration; } else { // Don't be fooled by the fact that you divide the sequence into dNTones: // the last slot will only contain a tone, not ending with silence. // Given this, the right thing to do is to divide the sequence duration // by dNTones tones and (dNTones-1) silences each sized according to the duty // cycle: original division was: // slot=dDuration / (dNTones*(dDutyCycle/DUTY_MAX)+(dNTones-1)*(1.0-dDutyCycle/DUTY_MAX)) // which can be simplified in the one below. // Then just take the part that belongs to tone or silence. // slot=dDuration/((double)dNTones+(dDutyCycle/DUTY_MAX)-1); dTone = slot * (dDutyCycle/DUTY_MAX); // seconds dSilence = slot * (1.0 - (dDutyCycle/DUTY_MAX)); // seconds // Note that in the extremes we have: // - dutyCycle=100%, this means no silence, so each tone will measure dDuration/dNTones // - dutyCycle=0%, this means no tones, so each silence slot will measure dDuration/(NTones-1) // But we always count: // - dNTones tones // - dNTones-1 silences } mDtmfDutyT->SetLabel(wxString::Format(wxT("%.1f %%"), (float)dDutyCycle/DUTY_SCALE)); mDtmfDutyT->SetName(mDtmfDutyT->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) mDtmfSilenceT->SetLabel(wxString::Format(wxString(wxT("%d ")) + _("ms"), (int) (dTone * 1000))); mDtmfSilenceT->SetName(mDtmfSilenceT->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) mDtmfToneT->SetLabel(wxString::Format(wxString(wxT("%d ")) + _("ms"), (int) (dSilence * 1000))); mDtmfToneT->SetName(mDtmfToneT->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:53,
示例27: wxStrlen/*static*/void wxMemoryFSHandlerBase::AddFileWithMimeType(const wxString& filename, const wxString& textdata, const wxString& mimetype){ AddFileWithMimeType ( filename, static_cast<const char *>(textdata.To8BitData()), wxStrlen(static_cast<const char *>(textdata.To8BitData())), mimetype );}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:13,
示例28: dlogbool EffectDtmf::PromptUser(){ DtmfDialog dlog(mParent, _("DTMF Tone Generator")); // dialog will be passed values from effect // Effect retrieves values from saved config // Dialog will take care of using them to initialize controls // If there is a selection, use that duration, otherwise use // value from saved config: this is useful is user wants to // replace selection with dtmf sequence if (mT1 > mT0) { // there is a selection: let's fit in there... dtmfDuration = mT1 - mT0; dlog.dIsSelection = true; } else { // retrieve last used values gPrefs->Read(wxT("/CsPresets/DtmfGen_SequenceDuration"), &dtmfDuration, 1L); dlog.dIsSelection = false; } /// /todo this code shouldn't be using /CsPresets - need to review its use gPrefs->Read(wxT("/CsPresets/DtmfGen_String"), &dtmfString, wxT("audacity")); gPrefs->Read(wxT("/CsPresets/DtmfGen_DutyCycle"), &dtmfDutyCycle, 550L); gPrefs->Read(wxT("/CsPresets/DtmfGen_Amplitude"), &dtmfAmplitude, 0.8f); dtmfNTones = wxStrlen(dtmfString); // Initialize dialog locals dlog.dString = dtmfString; dlog.dDutyCycle = dtmfDutyCycle; dlog.dDuration = dtmfDuration; dlog.dAmplitude = dtmfAmplitude; // start dialog dlog.Init(); dlog.ShowModal(); if (dlog.GetReturnCode() == wxID_CANCEL) return false; // if there was an OK, retrieve values dtmfString = dlog.dString; dtmfDutyCycle = dlog.dDutyCycle; dtmfDuration = dlog.dDuration; dtmfAmplitude = dlog.dAmplitude; dtmfNTones = dlog.dNTones; dtmfTone = dlog.dTone; dtmfSilence = dlog.dSilence; return true;}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:53,
示例29: wxStrlenbool wxPropertyValidator::StringToLong (wxChar *s, long *number) { bool ok = true; wxChar *value_ptr; *number = wxStrtol (s, &value_ptr, 10); if (value_ptr) { int len = wxStrlen (value_ptr); for (int i = 0; i < len; i++) { ok = (wxIsspace (value_ptr[i]) != 0); if (!ok) return false; } } return ok;}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:13,
示例30: Init// takes nLength elements of psz starting at nPosvoid wxStringImpl::InitWith(const wxStringCharType *psz, size_t nPos, size_t nLength){ Init(); // if the length is not given, assume the string to be NUL terminated if ( nLength == npos ) { wxASSERT_MSG( nPos <= wxStrlen(psz), wxT("index out of bounds") ); nLength = wxStrlen(psz + nPos); } STATISTICS_ADD(InitialLength, nLength); if ( nLength > 0 ) { // trailing '/0' is written in AllocBuffer() if ( !AllocBuffer(nLength) ) { wxFAIL_MSG( wxT("out of memory in wxStringImpl::InitWith") ); return; } wxStringMemcpy(m_pchData, psz + nPos, nLength); }}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:24,
注:本文中的wxStrlen函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ wxT函数代码示例 C++ wxStrlcpy函数代码示例 |