当前位置: 首页>>代码示例>>C++>>正文


C++ CStringList::GetNext方法代码示例

本文整理汇总了C++中CStringList::GetNext方法的典型用法代码示例。如果您正苦于以下问题:C++ CStringList::GetNext方法的具体用法?C++ CStringList::GetNext怎么用?C++ CStringList::GetNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CStringList的用法示例。


在下文中一共展示了CStringList::GetNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: execute

BOOL CCmdColor::execute(CString& params)
{
	//Decode parameters
	CStringList paramStrList;
	CScriptParser::StringSplit(paramStrList, params, CString(' '));

	//Need at least 3 params for r, g, b
	const int kNumParams = 3;
	if(paramStrList.GetCount() < kNumParams)
	{
		return FALSE;
	}

	float channels[kNumParams];
	POSITION pos = paramStrList.GetHeadPosition();
	for(int i = 0; i < kNumParams; ++i)
	{
		CString paramStr = paramStrList.GetNext(pos);
		channels[i] = (float)wcstod(paramStr, NULL);
	}

	CStateManager::GetInstance()->SetColor(CColor(channels[0], channels[1], channels[2]));

	return TRUE;
}
开发者ID:Khillasaurus,项目名称:School,代码行数:25,代码来源:CmdColor.cpp

示例2: GetStr_From_ReplacRule

int CTyBase::GetStr_From_ReplacRule(CString srcStr,CString& dstStr, CStringList& ruleList)
{
	int ret = -1;
	dstStr = srcStr;
	char vsrcStr[33],vdstStr[33];
	char * token;
	char seps[] =  ",";
	int len;

	BOOL bFind = false;

	POSITION pos = ruleList.GetHeadPosition();

	CString str;
	char buf[256];
	memset(buf,0,sizeof(char)*256);

	while (pos != NULL)
	{
		str = ruleList.GetNext(pos);
		if (strlen(str) <= 0) 
			continue;

		strcpy(buf,str);
		switch (str[0])
		{
		case '0':
			{
				memset(vsrcStr,0,sizeof(char)*33);
				memset(vdstStr,0,sizeof(char)*33);

				token = strtok( buf, seps );
				token = strtok( NULL, seps );
				ASSERT(strlen(token) < 32);
				len = min(32,strlen(token));
				strncpy(vsrcStr,token,len);

				token = strtok( NULL, seps );
				ASSERT(strlen(token) < 32);
				len = min(32,strlen(token));
				strncpy(vdstStr,token,len);
				
				if (dstStr.Find(vsrcStr) >= 0)
				{
					dstStr.Replace(vsrcStr,vdstStr);
					bFind = true;
					ret = 1;
				}
			}
			break;
		default:
			break;
		}

		if (bFind)
			break;
	}

	return ret;
}
开发者ID:github188,项目名称:MonitorSystem,代码行数:60,代码来源:TyBase.cpp

示例3: CString

BOOL CCmdVertex2::execute(CString &params)
{
	// Decode parameters
	CStringList paramStrList;
	CScriptParser::StringSplit(paramStrList, params, CString( ' ' ));

	// Need at least 2 params for x, y
	const int numParams = 2;
	if(paramStrList.GetCount() < numParams)
	{
		return FALSE;
	}

	int coords[numParams];
	POSITION pos = paramStrList.GetHeadPosition();
	for(int i = 0; i < numParams; i++)
	{
		CString paramStr = paramStrList.GetNext(pos);
		coords[i] = (int)(wcstod(paramStr, NULL) + 0.5f);
	}

	//TODO: Change this the following to store a vertex2
	//CRasterizer::Instance()->DrawPoint(coords[0], coords[1]);

	return TRUE;
}
开发者ID:Khillasaurus,项目名称:School,代码行数:26,代码来源:CmdVertex2.cpp

示例4: OnDblclkListFields

void CBibitemView::OnDblclkListFields(NMHDR* pNMHDR, LRESULT* pResult) 
{
	if (m_SelField != -1) {
		// Open URL
		CField *fi = (CField*)m_ListFields.GetItemData(m_SelField);
		if (fi) {
			if (!fi->GetValue().IsEmpty() && 
				(fi->GetName().CompareNoCase(STR_LOCALURL) == 0 || 
				fi->GetName().CompareNoCase(STR_URL) == 0)) {
				CString val = fi->GetValue();
				CStringList lst;
				SplitSepString(val, &lst);
				POSITION p = lst.GetHeadPosition();
				while (p) {
					if (ShellExec(lst.GetNext(p))) {
						if (p)
							// Wait some time if there are other files to show
							Sleep(500);
					} else
						MessageBeep(MB_ICONEXCLAMATION);
				}
			} else
				// Or show edit dialog
				OnFieldlistPopupEdit();
		}
	}
	
	*pResult = 0;
}
开发者ID:stievie,项目名称:bibedt,代码行数:29,代码来源:BibitemView.cpp

示例5: SaveData

int CSetProgsAdvDlg::SaveData()
{
	if (m_ToolsValid)
	{
		// Remove all registry values which are no longer in the list
		CStringList values;
		if (m_regToolKey.getValues(values))
		{
			for (POSITION pos = values.GetHeadPosition(); pos; )
			{
				CString ext = values.GetNext(pos);
				if (m_Tools.find(ext) == m_Tools.end())
				{
					CRegString to_remove(m_regToolKey.m_path + L'\\' + ext);
					to_remove.removeValue();
				}
			}
		}

		// Add or update new or changed values
		for (auto it = m_Tools.cbegin(); it != m_Tools.cend() ; ++it)
		{
			CString ext = it->first;
			CString new_value = it->second;
			CRegString reg_value(m_regToolKey.m_path + L'\\' + ext);
			if (reg_value != new_value)
				reg_value = new_value;
		}
	}
	return 0;
}
开发者ID:YueLinHo,项目名称:TortoiseGit,代码行数:31,代码来源:SetProgsAdvDlg.cpp

示例6: WebGetOptionsList

void WebGetOptionsList(CString strInput, CStringList& strList)
{
	POSITION pos;
	int iPos;
	CString strName, strItem;

	iPos = strInput.Find(' ');
	strItem = strInput.Mid(iPos + 6);
	iPos = strItem.Find(' ');
	if (iPos != -1)
	{
		strName = strItem.Left(iPos);
	}
	else
	{
		strName = strItem;
	}
#ifndef __GNUC__
	for (pos = strList.GetHeadPosition(); pos != NULL;)
#else
  for (pos = strList.begin(); pos != strList.end(); ++pos)
#endif
	{
		strItem = strList.GetNext(pos);
		if (!strItem.Compare(strName))
		{
			return;
		}
	}
	strList.AddTail(strName);
}
开发者ID:AlexVangelov,项目名称:ar168l,代码行数:31,代码来源:web.cpp

示例7: OnInitDialog

BOOL CWindowPage::OnInitDialog()
{
    CPropertyPage::OnInitDialog();

    TRANSLATE(*this, IDD);

    m_wndSpinTextLen.SetRange32(1, TT_STRLEN);

    //convert font to LOGFONT
    ConvertFont(m_Font, m_lf);

    ShowFont();

    CStringList strings;
    GetLanguageFiles(strings);
    strings.AddHead(_T(""));

    for(POSITION pos=strings.GetHeadPosition();pos!=NULL;)
        m_wndLanguages.AddString(strings.GetNext(pos));

    if(!m_szLanguage.IsEmpty())
        m_wndLanguages.SelectString(-1, m_szLanguage);

    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:alex-crystal,项目名称:TeamTalk5,代码行数:26,代码来源:WindowPage.cpp

示例8: OnCommand

BOOL CWizDlg::OnCommand(WPARAM wParam, LPARAM lParam) 
{ 
	if ( wParam>=100 &&  wParam<=100+25 )     // file history
    {
        if ( wParam-100 == popup.GetMenuItemCount()-1 ) // Click on 1st item
        {                       
            CString s1("");            
            POSITION pos = Recents.GetHeadPosition();
            while (pos)
            {         
                s1+=Recents.GetNext(pos)->GetPath();		
                s1+="\x0D\x0A";                            
            }            
            export_text(s1,&wnd);           
            return 1;            
        }        
        del_pos = Recents.GetHeadPosition();		
        for ( int x=1; x<wParam-99; x++)
            Recents.GetNext(del_pos);						

        if ( ctrl ) // delete it
        {               
            if ( wnd.isOpened() &&  wParam-100 == 0 )   { del_pos=NULL; return 1; }
            Recents.RemoveAt(del_pos);            
            Load_menu();
            del_pos=NULL;          
        } else
             wnd.RedFile((char*)(LPCTSTR)(Recents.GetAt(del_pos))->GetPath(),0);                
            load_menu_ch();		
    }
	if ( wParam>=150 && wParam<=150+50+5 )    // Bookm menu
	{
        if ( wParam-150 == bookm.GetMenuItemCount()-1 ) // Click on 1st item
        {            
            CStringList lst;
            CString s1("");
            
            Recents.GetHead()->load_menu_bm(lst);
            POSITION p=lst.GetHeadPosition();
            while (p)
            { s1+=lst.GetNext(p); s1+="\x0D\x0A";}
             Recents.GetHead()->add_memo(s1);            
            return 1;            
        }        
        if ( ctrl ) // delete it
        {   
            Recents.GetHead()->del_at(wParam-150);            
            load_menub();
            check_bookm();

        } else
        {
            Recents.GetHead()->jmp_to(wParam-150); //>first_bookm();		
            wnd.Seek_to((Recents.GetHead())->cur_pos);		
        }
    }	
	return CDialog::OnCommand(wParam, lParam);
}
开发者ID:RussianPenguin,项目名称:samples,代码行数:58,代码来源:wizDlg.cpp

示例9: WebUpdateOption

CString WebUpdateOption(CString strInput)
{
	CString strOutput, strItem, strTemp;
	CStringList strList;
	POSITION pos1, pos2;

	WebGetStringList(strInput, 7, strList);

	strOutput = _T("<OPTION");
#ifndef __GNUC__
	for (pos1 = strList.GetHeadPosition(); pos1 != NULL;)
#else
  for (pos1 = strList.begin(); pos1 != strList.end(); ++pos1)
#endif
	{
		pos2 = pos1;
		strItem = strList.GetNext(pos1);
		strTemp = strItem.Left(6);
		if (!strTemp.CompareNoCase(_T("value=")))
		{
			strItem = strItem.Right(strItem.GetLength()-6);
			strItem = RemoveQuote(strItem);
			strOutput += _T(" value=");
			strOutput += strItem;
			strList.RemoveAt(pos2);
		}
		else if (!strItem.CompareNoCase(_T("selected")))
		{
			strList.RemoveAt(pos2);
		}
	}
#ifndef __GNUC__
	for (pos1 = strList.GetHeadPosition(); pos1 != NULL;)
#else
  for (pos1 = strList.begin(); pos1 != strList.end(); ++pos1)
#endif
	{
		strOutput += _T(' ');
		strItem = strList.GetNext(pos1);
		strOutput += strItem;
	}
	strOutput += _T('>');
	return strOutput;
}
开发者ID:AlexVangelov,项目名称:ar168l,代码行数:44,代码来源:web.cpp

示例10: OnLoad

LONG CuDlgReplicationServerPageAssignment::OnLoad (WPARAM wParam, LPARAM lParam)
{
	LPCTSTR pClass = (LPCTSTR)wParam;
	ASSERT (lstrcmp (pClass, _T("CaReplicationServerDataPageAssignment")) == 0);
	CTypedPtrList<CObList, CStringList*>* pListTuple;
	CaReplicationServerDataPageAssignment* pData = (CaReplicationServerDataPageAssignment*)lParam;
	ASSERT (pData);
	if (!pData)
		return 0L;
	pListTuple = &(pData->m_listTuple);
	CStringList* pObj = NULL;
	POSITION p, pos = pListTuple->GetHeadPosition();
	try
	{
		// For each column:
		const int LAYOUT_NUMBER = 5;
		for (int i=0; i<LAYOUT_NUMBER; i++)
			m_cListCtrl.SetColumnWidth(i, pData->m_cxHeader.GetAt(i));

		int nCount;
		while (pos != NULL)
		{
			pObj = pListTuple->GetNext (pos);
			ASSERT (pObj);
			ASSERT (pObj->GetCount() == 5);
			nCount = m_cListCtrl.GetItemCount();
			p = pObj->GetHeadPosition();
			m_cListCtrl.InsertItem  (nCount,    (LPCTSTR)pObj->GetNext(p));
			m_cListCtrl.SetItemText (nCount, 1, (LPCTSTR)pObj->GetNext(p));
			m_cListCtrl.SetItemText (nCount, 2, (LPCTSTR)pObj->GetNext(p));
			m_cListCtrl.SetItemText (nCount, 3, (LPCTSTR)pObj->GetNext(p));
			m_cListCtrl.SetItemText (nCount, 4, (LPCTSTR)pObj->GetNext(p));
		}
		m_cListCtrl.SetScrollPos (SB_HORZ, pData->m_scrollPos.cx);
		m_cListCtrl.SetScrollPos (SB_VERT, pData->m_scrollPos.cy);
	}
	catch (CMemoryException* e)
	{
		theApp.OutOfMemoryMessage();
		e->Delete();
	}
	return 0L;
}
开发者ID:,项目名称:,代码行数:43,代码来源:

示例11: WriteFile

BOOL RegistryKey::WriteFile()
{
	if (mFileName == "") return FALSE;

    POSITION pos;
    CString key;
    CString val;
	CString data;
	AutoBuf buf(1000);	
	CStringList slist;
    for( pos = mKeyValPairs->GetStartPosition(); pos != NULL; ) {
        mKeyValPairs->GetNextAssoc(pos, key, val);
		String::insertSort(slist, key);
	}

    for (pos = slist.GetHeadPosition(); pos != NULL; ) {
        CString key = slist.GetAt(pos);
		if (mKeyValPairs->Lookup(key, val)) {
			if (key.GetLength() && val.GetLength()) {
				sprintf(buf.p, "%s: %s\r\n", key, val);
				data += buf.p;
			}
		}
		slist.GetNext(pos);
	}


//    for( pos = mKeyValPairs->GetStartPosition(); pos != NULL; ) {
//        mKeyValPairs->GetNextAssoc(pos, key, val);
//        if (key.GetLength() && val.GetLength()) {
//            sprintf(buf.p, "%s: %s\r\n", key, val);
//			data += buf.p;
//        }
//    }
	if (data == "") return FALSE;

	CFile cfile;
	CFileException e;
	if (cfile.Open(mFileName, 
		CFile::modeCreate
		//        |CFile::modeNoTruncate
		|CFile::modeWrite
		//        |CFile::typeText
		|CFile::shareDenyNone,
		&e) == FALSE) {
		return FALSE;
	}

	cfile.Write(data, data.GetLength());
	cfile.Flush();
	cfile.Close();
	return TRUE;


}
开发者ID:mikemakuch,项目名称:muzikbrowzer,代码行数:55,代码来源:Registry.cpp

示例12: SetKeywords

void CPage::SetKeywords(CStringList &stringList)
{
   AFX_MANAGE_STATE(AfxGetStaticModuleState());

   m_slKeywords.RemoveAll();

   POSITION position = stringList.GetHeadPosition();
   while (position)
   {
      CString string = stringList.GetNext(position);
      m_slKeywords.AddTail(string);
   }
}
开发者ID:identity0815,项目名称:os45,代码行数:13,代码来源:PageStream.cpp

示例13: ProcessPhrase

void CLibraryDictionary::ProcessPhrase(CLibraryFile& oFile, const CString& strPhrase, bool bAdd,
	bool bCanUpload)
{
	if ( strPhrase.IsEmpty() )
		return;

	CStringList oKeywords;
	CQueryHashTable::MakeKeywords( strPhrase, oKeywords );
	for ( POSITION pos = oKeywords.GetHeadPosition(); pos; )
	{
		ProcessWord( oFile, oKeywords.GetNext( pos ), bAdd, bCanUpload );
	}
}
开发者ID:GetEnvy,项目名称:Envy,代码行数:13,代码来源:LibraryDictionary.cpp

示例14: GetNthItem

static CString GetNthItem (CStringList& listStr, int nItem)
{
	CString strItem;
	int nStart = 0;
	POSITION pos = listStr.GetHeadPosition();
	while (pos != NULL)
	{
		strItem = listStr.GetNext (pos);
		nStart++;
		if (nStart == nItem)
			break;
	}
	return strItem;
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例15: RegisterTGitSounds

void CSoundUtils::RegisterTGitSounds()
{
	// create the event labels
	CRegString eventlabelerr = CRegString(_T("AppEvents\\EventLabels\\TGit_Error\\"));
	eventlabelerr = CString(MAKEINTRESOURCE(IDS_ERR_ERROR));
	CRegString eventlabelwarn = CRegString(_T("AppEvents\\EventLabels\\TGit_Warning\\"));
	eventlabelwarn = CString(MAKEINTRESOURCE(IDS_WARN_WARNING));
	CRegString eventlabelnote = CRegString(_T("AppEvents\\EventLabels\\TGit_Notification\\"));
	eventlabelnote = CString(MAKEINTRESOURCE(IDS_WARN_NOTE));

	CRegString appscheme = CRegString(_T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\"));
	appscheme = _T("TortoiseGit");

	CString apppath = CPathUtils::GetAppDirectory();

	CRegistryKey schemenamekey = CRegistryKey(_T("AppEvents\\Schemes\\Names"));
	CStringList schemenames;
	schemenamekey.getSubKeys(schemenames);
	// if the sound scheme has been modified but not save under a different name,
	// the name of the sound scheme is ".current" and not under the names list.
	// so add the .current scheme to the list too
	schemenames.AddHead(_T(".current"));
	POSITION pos;
	for (pos = schemenames.GetHeadPosition(); pos != NULL;)
	{
		CString name = schemenames.GetNext(pos);
		if ((name.CompareNoCase(_T(".none"))!=0)&&(name.CompareNoCase(_T(".nosound"))!=0))
		{
			CString errorkey = _T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\TGit_Error\\") + name + _T("\\");
			CRegString errorkeyval = CRegString(errorkey);
			if (((CString)(errorkeyval)).IsEmpty())
			{
				errorkeyval = apppath + _T("TortoiseGit_Error.wav");
			}
			CString warnkey = _T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\TGit_Warning\\") + name + _T("\\");
			CRegString warnkeyval = CRegString(warnkey);
			if (((CString)(warnkeyval)).IsEmpty())
			{
				warnkeyval = apppath + _T("TortoiseGit_Warning.wav");
			}
			CString notificationkey = _T("AppEvents\\Schemes\\Apps\\TortoiseGitProc\\TGit_Notification\\") + name + _T("\\");
			CRegString notificationkeyval = CRegString(notificationkey);
			if (((CString)(notificationkeyval)).IsEmpty())
			{
				notificationkeyval = apppath + _T("TortoiseGit_Notification.wav");
			}
		}
	}
}
开发者ID:mirror,项目名称:TortoiseGit,代码行数:49,代码来源:SoundUtils.cpp


注:本文中的CStringList::GetNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。