这篇教程C++ FindString函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中FindString函数的典型用法代码示例。如果您正苦于以下问题:C++ FindString函数的具体用法?C++ FindString怎么用?C++ FindString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了FindString函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Determine_QM_Levelvoid Determine_QM_Level(char szQMLevel[]){ char ErrorMsg[256]; if(FindString(szQMLevel, "HF") >= 0) { QM_Level = QM_LEVEL_HF; } else if(FindString(szQMLevel, "MP2") >= 0) { QM_Level = QM_LEVEL_MP2; } else { sprintf(ErrorMsg, "Fail to determine the QM level./n%s/nQuit/n", szQMLevel); Quit_With_Error_Msg(ErrorMsg); } return;}
开发者ID:mj-harvey,项目名称:gaamp-local,代码行数:16,
示例2: OPT_GETvoid OptionPage::OptionChoice(wxFlexGridSizer *flex, const wxString &name, const wxArrayString &choices, const char *opt_name) { parent->AddChangeableOption(opt_name); const auto opt = OPT_GET(opt_name); auto cb = new wxComboBox(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, choices, wxCB_READONLY | wxCB_DROPDOWN); Add(flex, name, cb); switch (opt->GetType()) { case agi::OptionType::Int: { int val = opt->GetInt(); cb->Select(val < (int)choices.size() ? val : 0); cb->Bind(wxEVT_COMBOBOX, IntCBUpdater(opt_name, parent)); break; } case agi::OptionType::String: { wxString val(to_wx(opt->GetString())); if (cb->FindString(val) != wxNOT_FOUND) cb->SetStringSelection(val); else if (!choices.empty()) cb->SetSelection(0); cb->Bind(wxEVT_COMBOBOX, StringUpdater(opt_name, parent)); break; } default: throw agi::InternalError("Unsupported type"); }}
开发者ID:Aegisub,项目名称:Aegisub,代码行数:28,
示例3: FindString/*** Vers. 1.1** NEW: CopyList()*/void CACListWnd::CopyList(){ m_DisplayList.Copy(m_SearchList); m_lCount = (long)m_DisplayList.GetSize(); if(m_lCount) FindString(0,_T(""),true);}
开发者ID:spritetong,项目名称:tortoisegit-utf8,代码行数:11,
示例4: To_Find_Tagint To_Find_Tag(FILE *fIn, char szFileName[], char szTag[], char szLine[]){ char *ReadLine, ErrorMsg[256]; while(1) { if(feof(fIn)) { sprintf(ErrorMsg, "Fail to find the tag: %s in file %s/nQuit/n", szTag, szFileName); fclose(fIn); Quit_With_Error_Msg(ErrorMsg); } ReadLine = fgets(szLine, 256, fIn); if(ReadLine == NULL) { sprintf(ErrorMsg, "Fail to find the tag: %s in file %s/nQuit/n", szTag, szFileName); fclose(fIn); Quit_With_Error_Msg(ErrorMsg); } else { if(FindString(szLine, szTag) >= 0) { return 1; } } } return 0;}
开发者ID:mj-harvey,项目名称:gaamp-local,代码行数:26,
示例5: FindStringbool wxBitmapComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], long style, const wxValidator& validator, const wxString& name){ if ( !wxComboBox::Create(parent, id, value, pos, size, n, choices, style, validator, name) ) return false; // Select 'value' in entry-less mode if ( !GetEntry() ) { int i = FindString(value); if (i != wxNOT_FOUND) SetSelection(i); } return true;}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:25,
示例6: SetStringValue virtual void SetStringValue(const wxString& s) { if (s.Length() > 0) { // Search item index int index = FindString(s); // Removes item if already in combos box if ( index != wxNOT_FOUND ) { Delete(index); } // Removes last item if max nb item is reached if ( GetCount() >= m_MaxHistoryLen) { // Removes last one Delete(GetCount()-1); } // Adds it to combos Insert(s, 0); Select(0); } }
开发者ID:WinterMute,项目名称:codeblocks_sf,代码行数:25,
示例7: FindStringvoid FStringTable::SetString (const char *name, const char *newString){ StringEntry **pentry, *oentry; FindString (name, pentry, oentry); size_t newlen = strlen (newString); size_t namelen = strlen (name); // Create a new string entry StringEntry *entry = (StringEntry *)M_Malloc (sizeof(*entry) + newlen + namelen + 2); strcpy (entry->String, newString); strcpy (entry->Name = entry->String + newlen + 1, name); entry->PassNum = 0; // If this is a new string, insert it. Otherwise, replace the old one. if (oentry == NULL) { entry->Next = *pentry; *pentry = entry; } else { *pentry = entry; entry->Next = oentry->Next; M_Free (oentry); }}
开发者ID:Accusedbold,项目名称:zdoom,代码行数:27,
示例8: GetCurSelLONG CSizeComboBox::GetHeight(int sel){ if (sel == -1) sel = GetCurSel(); if (sel == -1) { TCHAR szText[20]; GetWindowText(szText, 20); sel = FindString( -1, szText); if (sel == CB_ERR) { CY cyTmp; cyTmp.Lo = 0; cyTmp.Hi = 0; _AfxCyFromString(cyTmp, szText); int PointSize = (int)((cyTmp.Lo + 5000) / 10000); if (PointSize != 0) return MulDiv(-afxData.cyPixelsPerInch, PointSize, 72); else sel = 0; } } return (LONG) GetItemData(sel);}
开发者ID:Rupan,项目名称:winscp,代码行数:26,
示例9: AddFontint CFontComboBox::AddFont(LOGFONT *pLF, DWORD FontType){ int nEntry; FONTITEM_PPG* pFontItem = NULL; // Font already in the combobox if (FindString(-1, (LPCTSTR) pLF->lfFaceName) != CB_ERR) return CB_ERR; // allocate some memory for the FONTITEM_PPG structure TRY { pFontItem = new FONTITEM_PPG; } CATCH( CMemoryException, e ) { return CB_ERR; } END_CATCH ASSERT( pFontItem ); pFontItem->lf = *pLF; pFontItem->dwFontType = FontType; nEntry = AddString( (LPCTSTR) pFontItem->lf.lfFaceName ); if (nEntry == CB_ERR) delete pFontItem; else SetItemData( nEntry, (DWORD) pFontItem ); return nEntry;}
开发者ID:anyue100,项目名称:winscp,代码行数:33,
示例10: const char* PSettings::GetString(const char *name){ const char *old; status_t s=FindString(name,&old); return old;}
开发者ID:threedeyes,项目名称:DjVuViewer,代码行数:7,
示例11: FindStringvoid wxListBoxBase::SetFirstItem(const wxString& s){ int n = FindString(s); wxCHECK_RET( n != wxNOT_FOUND, wxT("invalid string in wxListBox::SetFirstItem") ); DoSetFirstItem(n);}
开发者ID:Asmodean-,项目名称:Ishiiruka,代码行数:8,
示例12: LockboolPreferences::ReadString(BString &string, const char* name){ Lock(); bool loaded = FindString(name, &string) == B_OK; Unlock(); return loaded;}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:8,
示例13: FindStringExactvoid CLocalComboBox::SetTheText(LPCTSTR lpszText,BOOL bMatchExact){ int idx = (bMatchExact) ? FindStringExact(-1,lpszText) : FindString(-1, lpszText); SetCurSel( (idx==CB_ERR) ? -1 : idx); if (idx == CB_ERR) SetWindowText(lpszText);}
开发者ID:BackupTheBerlios,项目名称:sfsipua-svn,代码行数:8,
示例14: FindStringint ctlComboBox::GetGuessedSelection() const{ int sel=GetCurrentSelection(); if (sel < 0) sel = FindString(GetValue()); return sel;}
开发者ID:xiul,项目名称:Database-Designer-for-pgAdmin,代码行数:8,
示例15: GetHeaderDWORD CItemList::FindString(LPCTSTR pCol, LPCTSTR pStr){ // Get column index DWORD i = GetHeader().FindCol( pCol ); if ( i == MAXDWORD ) return i; return FindString( i, pStr );}
开发者ID:sanyaade-webdev,项目名称:wpub,代码行数:8,
示例16: FindStringC4String *C4StringTable::RegString(StdStrBuf String){ C4String * s = FindString(String.getData()); if (s) return s; else return new C4String(String);}
开发者ID:772,项目名称:openclonk,代码行数:8,
示例17: /*! /brief Returns the name of the set /return The name of the set*/const char *CursorSet::GetName(void){ const char *name; if (FindString("name", &name) == B_OK) return name; return NULL;}
开发者ID:mariuz,项目名称:haiku,代码行数:13,
示例18: SetCurSelint color_combo_box::SetCurSelNEW(int model_index){ if((model_index < 0) || (model_index >= Num_ship_types)){ return SetCurSel(model_index); } // lookup the ship name return FindString(0, Ship_info[model_index].name);}
开发者ID:lubomyr,项目名称:freespace2,代码行数:9,
示例19: AddStringvoidPSettings::SetString(const char *name,const char *text){ const char *old; status_t s=FindString(name,&old); if(s==B_OK)ReplaceString(name,text); else AddString(name,text); }
开发者ID:threedeyes,项目名称:DjVuViewer,代码行数:9,
示例20: FindString/*========================idLangDict::GetString========================*/const char* idLangDict::GetString( const char* str ) const{ const char* localized = FindString( str ); if( localized == NULL ) { return str; } return localized;}
开发者ID:BielBdeLuna,项目名称:RBDoom3BFG-mirrored,代码行数:14,
示例21: BStringAttributeMessage::GetAttribute(const char* name, const BString& defaultValue) const{ BString value; if (FindString(name, &value) != B_OK) return defaultValue; return value;}
开发者ID:stippi,项目名称:Clockwerk,代码行数:9,
示例22: myinline const char* ArpMessage::GetString(const char *name, const char* def, int32 index) const{ if( this ) { const char* res; if( FindString(name, index, &res) != B_NO_ERROR ) return def; return res; } return def;}
开发者ID:tgkokk,项目名称:Sequitur,代码行数:9,
示例23: const char *Config::GetString(const char *name, const char *Default){const char *str; if (FindString(name, &str) == B_OK) return str; else return Default;}
开发者ID:HaikuArchives,项目名称:Sisong,代码行数:9,
示例24: FindStringbool wxItemContainerImmutable::SetStringSelection(const wxString& s){ const int sel = FindString(s); if ( sel == wxNOT_FOUND ) return false; SetSelection(sel); return true;}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:10,
示例25: FindStringbool wxListBoxBase::SetStringSelection(const wxString& s, bool select){ int sel = FindString(s); wxCHECK_MSG( sel != wxNOT_FOUND, false, wxT("invalid string in SetStringSelection") ); SetSelection(sel, select); return true;}
开发者ID:Duion,项目名称:Torsion,代码行数:10,
示例26: GetBoundaryEnd const char * GetBoundaryEnd(const char *startSearch, const char *endSearch, string boundary) { if (endSearch <= startSearch || endSearch == 0 || startSearch == 0 || boundary.length() == 0) { assert(0); return 0; } const char* possibleEnding = FindString(startSearch, boundary.c_str(), endSearch); int counter = 1000; while (possibleEnding != 0 && counter > 0) { counter--; // return if the string after the boundary is either a newline, or a --. // this is to prevent the problem that we return incorrect boundaries // if the boundary string is a part of another boundary string. int sizeRemainingAfterBoundaryString = endSearch - possibleEnding; if (sizeRemainingAfterBoundaryString <= 2) { // malformed message. the end of the character string is the boundary line with no trailing crlf or --. assert(0); return 0; } if ((possibleEnding[boundary.size()] == '-' && possibleEnding[boundary.size()+1] == '-') || (possibleEnding[boundary.size()] == '/r' && possibleEnding[boundary.size()+1] == '/n')) { return possibleEnding; } // false. try again. possibleEnding = FindString(possibleEnding+1, boundary.c_str(), endSearch); } assert(0); return 0; }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:43,
示例27: wxCHECK_MSGbool wxRadioBox::SetStringSelection( const wxString &s ){ wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") ); int res = FindString( s ); if (res == wxNOT_FOUND) return false; SetSelection( res ); return true;}
开发者ID:HackLinux,项目名称:chandler-1,代码行数:10,
示例28: FindStringint ReplaceSubList::DeleteString(wchar_t *old){ int i = FindString(old); if (i < 0) return 0; free(strings[i].old); for (int j=i+1; j<numStrings; j++) strings[j-1] = strings[j]; numStrings--; return 1;}
开发者ID:Lightnet,项目名称:Translation-Aggregator,代码行数:10,
示例29: GetColint NFCRecord::FindString(const std::string& strColTag, const std::string& value, NFDataList& varResult){ if (strColTag.empty()) { return -1; } int nCol = GetCol(strColTag); return FindString(nCol, value, varResult);}
开发者ID:tcomy,项目名称:NoahGameFrame,代码行数:10,
注:本文中的FindString函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ FindTask函数代码示例 C++ FindSocketObj函数代码示例 |