本文整理汇总了C++中CStringList::Find方法的典型用法代码示例。如果您正苦于以下问题:C++ CStringList::Find方法的具体用法?C++ CStringList::Find怎么用?C++ CStringList::Find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStringList
的用法示例。
在下文中一共展示了CStringList::Find方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckHostName
void CuDlgMain::CheckHostName (int nConfig, CaCda* pObj, CaCompareParam* pCompareInfo)
{
CStringList* pList = (nConfig == 1)? &m_strList1Host: &m_strList2Host;
CString strSnapshotHost = (nConfig == 1)? pCompareInfo->GetHost1(): pCompareInfo->GetHost2();
CString strLeft = pObj->GetLeft();
strLeft.MakeLower();
if (strLeft.Find(_T("ii.*.")) != 0)
{
//
// Parse host name:
CString str = pObj->GetLeft();
CString strHost = _T("");
int nFound = str.Find(_T('.'));
if (nFound != -1)
{
str = str.Mid(nFound +1);
nFound = str.Find(_T('.'));
if (nFound != -1)
strHost = str.Left(nFound);
}
if (!strHost.IsEmpty() && strHost.CompareNoCase(strSnapshotHost) != 0 && pList->Find(strHost) == NULL)
pList->AddTail(strHost);
}
}
示例2: IsPick
BOOL IsPick(CString itemName){
if(dlxiaoDllDlg->IsDlgButtonChecked(IDC_CHECK_QJ)){
return TRUE;
}
if ( pickItemNameList.IsEmpty()){
return false;
}else if(pickItemNameList.Find(itemName)){
return true;
}
return false;
}
示例3: OnInitDialog
BOOL CGroupSet::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CString Buff;
CStringList SelC;
//m_Name=m_pE->GetName();
POSITION pos = m_pE->m_agr.GetHeadPosition();
while (pos!=NULL)
{
Buff=((CExponent*) m_pE->m_agr.GetNext(pos))->GetName();
m_CurList.InsertString(-1, Buff);
SelC.AddHead(Buff);
}
pos = m_pAllE->GetHeadPosition();
while (pos!=NULL)
{
Buff=((CExponent*) m_pAllE->GetNext(pos))->GetName();
if ((SelC.Find(Buff)==NULL)&&(Buff!=m_pE->GetName()))
m_AllList.InsertString(-1,Buff);
}
int n=m_F.Count;
int* IDs= new int[n];
CComboBox* pCB=(CComboBox*)GetDlgItem(IDC_COMBO_METHOD);
pCB->ResetContent();
m_F.GetAllID(IDs);
for (int i=0; i<n; i++)
{
if (m_F.GetTypeLex(IDs[i],Buff))
AfxMessageBox("ќшибка в определении методов");
else pCB->AddString(Buff);
}
delete [] IDs;
if (m_pE->m_Method==NULL) n=0;
else
{
m_F.GetTypeLex(m_pE->m_Method->GetType(),Buff);
n=pCB->FindString(-1,Buff);
}
if (pCB->SetCurSel(n)==CB_ERR) AfxMessageBox("ќшибка в определении методов");
EnableButtomCur();
EnableButtomAll();
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例4: ResetFields
/**
* Metodo para zerar o valor dos campos da tabela
*/
void CTableBase::ResetFields(CStringList &sIgnoreList)
{
CField *pField;
POSITION p;
CString sLabel;
CString sTmp;
p = m_mapFields.GetStartPosition();
while(p)
{
m_mapFields.GetNextAssoc(p, sLabel, pField);
if(sIgnoreList.Find(sLabel) == NULL)
{
pField->SetValue(L"");
}
}
}
示例5: MXP_OpenAtomicTag
//.........这里部分代码省略.........
continue; // all done for this argument
}
CString strSubtag = questionlist.RemoveHead ();
strSubtag.MakeLower ();
if (strSubtag == "*")
{ // they want list of options for this tag
// now list the sub-items it supports
StringToList (pElement->strArgs, ",", list); // break into components
for (POSITION argpos = list.GetHeadPosition (); argpos; )
{
CString strItem = list.GetNext (argpos); // get argument item
strSupports += "+";
strSupports += pElement->strName;
strSupports += ".";
strSupports += strItem;
strSupports += " ";
} // end of doing each sub-item
} // end of wildcard
else
{ // not wildcard - must be name
// check valid name requested
if (!IsValidName (strSubtag))
{
MXP_error (DBG_ERROR, errMXP_InvalidSupportArgument,
TFormat ("Invalid <support> argument: %s" ,
(LPCTSTR) strSubtag));
return;
}
// so, see if that word is in our arguments list
StringToList (pElement->strArgs, ",", list); // break into components
if (list.Find (strSubtag))
{
strSupports += "+";
strSupports += pArgument->strValue;
strSupports += " ";
}
else
{
strSupports += "-";
strSupports += pArgument->strValue;
strSupports += " ";
}
} // end of not looking for wildcard
} // end of doing each argument
} // find individual items
CString strMessage = CFormat ("\x1B[1z<SUPPORTS %s>%s",
(LPCTSTR) strSupports,
ENDLINE);
SendPacket (strMessage, strMessage.GetLength ()); // send version info back
MXP_error (DBG_INFO, infoMXP_SupportsSent,
TFormat ("Sent supports response: %s" ,
(LPCTSTR) strMessage.Mid (4)));
}
bIgnoreUnusedArgs = true;
break; // end of MXP_ACTION_SUPPORT
case MXP_ACTION_OPTION:
{
示例6: add_menu_items
// Static functions used by make_var_menu_tree (below)
static void add_menu_items(CMenu *pmenu, int &item_no, const CXmlTree::CElt ¤t_elt, CString name)
{
CString ss = current_elt.GetName(); // type of this node
// Add element name unless parent is FOR (or we are IF/SWITCH/JUMP which use child name)
if (ss != "if" && ss != "switch" && ss != "jump" && name.Right(1) != "]")
name += current_elt.GetAttr("name");
if (ss == "data")
{
pmenu->AppendMenu(MF_ENABLED, item_no++, name);
}
else if (ss == "for")
{
// Add array access operator [] and add item(s) for sub-element
ASSERT(current_elt.GetNumChildren() <= 1); // May be zero for new elt
if (current_elt.GetNumChildren() > 0)
add_menu_items(pmenu, item_no, current_elt.GetFirstChild(), name+"[ ]");
}
else if (ss == "struct")
{
// Add items for all sub-elements of the struct
for (CXmlTree::CElt ee = current_elt.GetFirstChild(); !ee.IsEmpty(); ++ee)
{
add_menu_items(pmenu, item_no, ee, name+".");
}
}
else if (ss == "use_struct")
{
CString ss = current_elt.GetAttr("type_name"); // Find struct name to use
CXmlTree::CElt ee = current_elt.GetOwner()->GetRoot().GetFirstChild();
for ( ; !ee.IsEmpty() && ee.GetName() == "define_struct"; ++ee)
if (ss == ee.GetAttr("type_name"))
{
// Check if recursive call to same defined struct
for (std::vector<CString>::const_iterator ps = prev_defined.begin(); ps != prev_defined.end(); ++ps)
{
if (*ps == ss)
return; // avoid recursion into same define_struct
}
prev_defined.push_back(ss);
// Add items for all sub-elements of the struct
for (CXmlTree::CElt ee2 = ee.GetFirstChild(); !ee2.IsEmpty(); ++ee2)
{
add_menu_items(pmenu, item_no, ee2, name+".");
}
break; // Found the (hopefully) only one with the correct name
}
}
else if (ss == "if")
{
if (current_elt.GetNumChildren() > 0)
add_menu_items(pmenu, item_no, current_elt.GetFirstChild(), name);
if (current_elt.GetNumChildren() > 1)
{
// Add a separate item for the else part
ASSERT(current_elt.GetNumChildren() == 3 && current_elt.GetChild(1).GetName() == "else");
add_menu_items(pmenu, item_no, current_elt.GetChild(2), name);
}
}
else if (ss == "switch")
{
// Add names of all case sub-elements
CStringList found; // just used to eliminate duplicate data elts
for (CXmlTree::CElt ee = current_elt.GetFirstChild(); !ee.IsEmpty(); ++ee)
{
ASSERT(ee.GetName() == "case");
if (ee.GetFirstChild().GetName() == "data")
{
CString ss = ee.GetFirstChild().GetAttr("name");
if (!ss.IsEmpty())
{
if (found.Find(ss) != NULL)
continue; // ignore data elements with the same name
else
found.AddTail(ss); // store this one for later checks
}
}
add_menu_items(pmenu, item_no, ee.GetFirstChild(), name);
}
}
else if (ss == "jump")
{
if (current_elt.GetNumChildren() > 0)
add_menu_items(pmenu, item_no, current_elt.GetFirstChild(), name);
}
else if (ss == "define_struct" || ss == "eval")
{
// Do nothing here
}
else
ASSERT(0);
}
示例7: Reload
void CSharedDirsTreeCtrl::Reload(bool bForce){
bool bChanged = false;
if (!bForce){
// check for changes in shared dirs
if (thePrefs.shareddir_list.GetCount() == m_strliSharedDirs.GetCount()){
POSITION pos = m_strliSharedDirs.GetHeadPosition();
POSITION pos2 = thePrefs.shareddir_list.GetHeadPosition();
while (pos != NULL && pos2 != NULL){
CString str1 = m_strliSharedDirs.GetNext(pos);
CString str2 = thePrefs.shareddir_list.GetNext(pos2);
if (str1.Right(1) == "\\"){
str1 = str1.Left(str1.GetLength()-1);
}
if (str2.Right(1) == "\\"){
str2 = str2.Left(str2.GetLength()-1);
}
if (str1.CompareNoCase(str2) != 0){
bChanged = true;
break;
}
}
}
else
bChanged = true;
// check for changes in categories incoming dirs
CString strMainIncDir = thePrefs.GetIncomingDir();
if (strMainIncDir.Right(1) == _T("\\"))
strMainIncDir = strMainIncDir.Left(strMainIncDir.GetLength()-1);
CStringList strliFound;
for (int i = 0; i < thePrefs.GetCatCount(); i++){
Category_Struct* pCatStruct = thePrefs.GetCategory(i);
if (pCatStruct != NULL){
CString strCatIncomingPath = pCatStruct->incomingpath;
if (strCatIncomingPath.Right(1) == _T("\\"))
strCatIncomingPath = strCatIncomingPath.Left(strCatIncomingPath.GetLength()-1);
if (!strCatIncomingPath.IsEmpty() && strCatIncomingPath.CompareNoCase(strMainIncDir) != 0
&& strliFound.Find(strCatIncomingPath) == NULL)
{
POSITION pos = m_strliCatIncomingDirs.Find(strCatIncomingPath);
if (pos != NULL){
strliFound.AddTail(strCatIncomingPath);
}
else{
bChanged = true;
break;
}
}
}
}
if (strliFound.GetCount() != m_strliCatIncomingDirs.GetCount())
bChanged = true;
}
if (bChanged || bForce){
FetchSharedDirsList();
FilterTreeReloadTree();
Expand(m_pRootUnsharedDirectries->m_htItem, TVE_COLLAPSE); // collapsing is enough to sync for the filtetree, as all items are recreated on every expanding
}
}
示例8: OnInitDialog
BOOL CFileSharingPage::OnInitDialog()
{
CFilePropertiesPage::OnInitDialog();
m_wndTags.AddString( _T("") );
if ( UploadQueues.m_pSection.Lock() )
{
CStringList pAdded;
for ( POSITION pos = UploadQueues.GetIterator() ; pos ; )
{
CUploadQueue* pQueue = UploadQueues.GetNext( pos );
if ( pQueue->m_sShareTag.GetLength() )
{
if ( pAdded.Find( pQueue->m_sShareTag ) == NULL )
{
pAdded.AddTail( pQueue->m_sShareTag );
m_wndTags.AddString( pQueue->m_sShareTag );
}
}
}
UploadQueues.m_pSection.Unlock();
if ( pAdded.IsEmpty() )
{
m_wndTags.AddString( _T("Release") );
m_wndTags.AddString( _T("Popular") );
}
}
{
CQuickLock oLock( Library.m_pSection );
if ( CLibraryFile* pFile = GetFile() )
{
m_bOverride = pFile->m_bShared != TS_UNKNOWN;
m_bShare = pFile->IsShared();
m_sTags = pFile->m_sShareTags;
}
else if ( CLibraryList* pList = GetList() )
{
for ( POSITION pos = pList->GetIterator() ; pos ; )
{
if ( CLibraryFile* pFile = pList->GetNextFile( pos ) )
{
m_bOverride = pFile->m_bShared != TS_UNKNOWN;
m_bShare = pFile->IsShared();
m_sTags = pFile->m_sShareTags;
}
}
}
}
UpdateData( FALSE );
m_wndShare.EnableWindow( m_bOverride );
return TRUE;
}
示例9: strncmp
DLL_DECL void
DesertFinit_Apply(const char *applyConstraints)
{
CManager::theInstance->AnalyseConstraints();
CManager::theInstance->GenerateNextHierarchy();
if (CManager::theInstance->HasConstraints())
{
if (applyConstraints)
{
CStringList cNames;
bool applyAll = strncmp(applyConstraints, "applyAll", 8) == 0;
if (!applyAll)
{
char *cons = strdup(applyConstraints);
char *cName = strtok( cons, ":" );
while(cName)
{
cNames.AddTail( cName );
cName = strtok( NULL, ":" );
}
if(cNames.IsEmpty()) return;
}
CDynConstraintSet *set = new CDynConstraintSet(0);
set->RemoveAll();
CDynConstraintSetList & setlist = CManager::theInstance->GetConstraintSets();
POSITION sl_pos = setlist.GetHeadPosition();
while (sl_pos)
{
CDynConstraintSet * setlist_i = setlist.GetNext(sl_pos);
CDynConstraintList& list = setlist_i->GetConstraints();
POSITION pos1 = list.GetHeadPosition();
while(pos1)
{
CDynConstraint *cur = list.GetNext(pos1);
const CString& nm = cur->GetName();
if (applyAll || cNames.Find(nm))
{
Info("DesertFinit", "Applying Constraint: %s", nm);
cur->SetApplied();
set->InsertConstraint(cur);
}
}
}
// prune & generate next hierarchy
double dspSize;
long repSize;
long clockTime;
try{
CManager::theInstance->GetSizeInfo(dspSize, repSize, clockTime, set);
}catch(CDesertException *e)
{
CManager::theInstance->GenerateNextHierarchy();
set->RemoveAll();
delete set;
throw e;
}
// Info("DesertFinit", "Design Space Size Info: %f %d %d", dspSize, repSize, clockTime);
CManager::theInstance->GenerateNextHierarchy();
set->RemoveAll();
delete set;
}
}
}
示例10: CDesertException
DLL_DECL void *
DesertFinitNoGui(bool noError,bool noGui,const char *applyConstraints)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
ASSERT_EX( CManager::theInstance, "CoreInit", "CManager::theInstance IS null");
CCSetErrDialog cse_dialog;
if(!CManager::theInstance->VerifyConstraints(&cse_dialog))
{
delete CManager::theInstance;
CManager::theInstance = NULL;
throw new CDesertException(cse_dialog.m_strErrCts);
}
CManager::theInstance->AnalyseConstraints();
CManager::theInstance->GenerateNextHierarchy();
void * retval = NULL;
if (noError)
{
if (CManager::theInstance->HasConstraints())
{
if (applyConstraints)
{
CStringList cNames;
bool applyAll = strncmp(applyConstraints, "applyAll", 8) == 0;
if (!applyAll)
{
char *cons = strdup(applyConstraints);
char *cName = strtok( cons, ":" );
while(cName)
{
cNames.AddTail( cName );
cName = strtok( NULL, ":" );
}
}
CDynConstraintSet *set = new CDynConstraintSet(0);
set->RemoveAll();
CDynConstraintSetList & setlist = CManager::theInstance->GetConstraintSets();
POSITION sl_pos = setlist.GetHeadPosition();
while (sl_pos)
{
CDynConstraintSet * setlist_i = setlist.GetNext(sl_pos);
CDynConstraintList& list = setlist_i->GetConstraints();
POSITION pos1 = list.GetHeadPosition();
while(pos1)
{
CDynConstraint *cur = list.GetNext(pos1);
const CString& nm = cur->GetName();
if (applyAll || cNames.Find(nm))
{
Info("DesertFinit", "Applying Constraint: %s", nm);
cur->SetApplied();
set->InsertConstraint(cur);
}
}
}
// prune & generate next hierarchy
double dspSize;
long repSize;
long clockTime;
try{
CManager::theInstance->GetSizeInfo(dspSize, repSize, clockTime, set);
}catch(CDesertException *e)
{
CManager::theInstance->GenerateNextHierarchy();
set->RemoveAll();
delete set;
delete CManager::theInstance;
CManager::theInstance = NULL;
StopLogging();
throw e;
}
CManager::theInstance->GenerateNextHierarchy();
Info("DesertFinit", "Design Space Size Info: %f %d %d", dspSize, repSize, clockTime);
set->RemoveAll();
delete set;
}
}
// CManager::theInstance->
//#ifdef DO_STORE_CONFIGURATIONS
// dump the configurations
CString fname = projectName + ".cfg";
std::string errmsg;
try{
retval = CManager::theInstance->StoreConfigurations(fname, errmsg);
}
catch(CDesertException *e)
{
delete CManager::theInstance;
CManager::theInstance = NULL;
StopLogging();
throw e;
}
//#endif
}
//.........这里部分代码省略.........
示例11: GroupRunWithinMultirun
int GroupRunWithinMultirun(const char* groupName, const char* constraintsToApply)
{
CStringList cNames;
bool applyAll = strncmp(constraintsToApply, "applyAll", 8) == 0;
if (!applyAll)
{
char *cons = strdup(constraintsToApply);
char *cName = strtok( cons, ":" );
while(cName)
{
cNames.AddTail( cName );
cName = strtok( NULL, ":" );
}
}
CDynConstraintSet *set = new CDynConstraintSet(0);
set->RemoveAll();
CDynConstraintSetList & setlist = CManager::theInstance->GetConstraintSets();
POSITION sl_pos = setlist.GetHeadPosition();
while (sl_pos)
{
CDynConstraintSet * setlist_i = setlist.GetNext(sl_pos);
CDynConstraintList& list = setlist_i->GetConstraints();
POSITION pos1 = list.GetHeadPosition();
while(pos1)
{
CDynConstraint *cur = list.GetNext(pos1);
const CString& nm = cur->GetName();
if (applyAll || cNames.Find(nm))
{
Info("DesertFinit", "Applying Constraint: %s", nm);
cur->SetApplied();
set->InsertConstraint(cur);
}
}
}
// prune & generate next hierarchy
double dspSize;
long repSize;
long clockTime;
try
{
CManager::theInstance->GetSizeInfo(dspSize, repSize, clockTime, set);
CManager::theInstance->GenerateNextHierarchy();
}
catch(CDesertException *e)
{
set->RemoveAll();
delete set;
delete CManager::theInstance;
CManager::theInstance = NULL;
StopLogging();
throw e;
}
Info("DesertFinit", "Design Space Size Info: %f %d %d", dspSize, repSize, clockTime);
set->RemoveAll();
delete set;
int numCfgs = 0;
try
{
numCfgs = CManager::theInstance->CalcRealNoOfConfigurations();
Info("DesertFinitMultirun", "For constraint group: %s with constraints:\r\n\t%s\r\n\tDesign Space Size Info: %f %d %d", groupName, constraintsToApply, dspSize, repSize, clockTime);
Info("DesertFinitMultirun", "No. of configurations with last set of constraints is %d", numCfgs);
}
catch(CDesertException *e)
{
delete CManager::theInstance;
CManager::theInstance = NULL;
StopLogging();
throw e;
}
return numCfgs;
}
示例12: GetNextTags
//tag should be lowercase
BOOL CSimpleSAH::GetNextTags(CStringList& astrTagNames)
{
int i, j, k;
BOOL found = FALSE;
CString tagp;
long len = strHTML.GetLength();
try{
while(!found)
{
if(!strCurTagBuf.IsEmpty())
{
if(m_bUpdate)
file.WriteString(strCurTagBuf);
}
i = strHTML.Find('<', nStartPoint);
if(i<0)
{
//end of file
if(m_bUpdate)
{ file.Write(strHTML.GetBuffer(8) + nStartPoint, len - nStartPoint);
strHTML.ReleaseBuffer();
}
return FALSE;
}
else
{
if(m_bUpdate)
{
file.Write(strHTML.GetBuffer(8) + nStartPoint, i - nStartPoint);
strHTML.ReleaseBuffer();
}
}
if(strHTML.Mid(i+1, 2) == "!-") //is comment
{
j = strHTML.Find("-->", i);
if(j<0)
{
//not a real comment, just some text
if(m_bUpdate)
{
file.Write(strHTML.GetBuffer(8) + i, 3);
strHTML.ReleaseBuffer();
}
nStartPoint = i + 3;
}
else
{
//is comment, output it
if(m_bUpdate)
{
file.Write(strHTML.GetBuffer(8) + i, j - i+3);
strHTML.ReleaseBuffer();
}
nStartPoint = j + 3;
}
strCurTagBuf.Empty();
}
else
{
j = strHTML.Find('>', i);
k = strHTML.Find('<', i);
if(j<0)
{
//end of file
if(m_bUpdate)
{ file.Write(strHTML.GetBuffer(8) + i, len - i);
strHTML.ReleaseBuffer();
}
return FALSE;
}
if(j>k)
{
//output
if(m_bUpdate)
{
file.Write(strHTML.GetBuffer(8) + i, k-i);
strHTML.ReleaseBuffer();
}
i = k;
}
strCurTagBuf = strHTML.Mid(i, j-i+1);
nStartPoint = j+1;
//if is the needed tag
k=strCurTagBuf.FindOneOf(" >\r\n");
if(k>0)
tagp = strCurTagBuf.Mid(1, k-1);
else
tagp = strCurTagBuf.Mid(1, strCurTagBuf.GetLength()-2);
tagp.MakeLower();
if(astrTagNames.Find(tagp))
//.........这里部分代码省略.........