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


C++ CString::SpanExcluding方法代码示例

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


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

示例1: OnBnClickedIrcConnect

void CIrcWnd::OnBnClickedIrcConnect()
{
	if (!m_bConnected)
	{
		CString sInput = thePrefs.GetIRCNick();
		sInput.Trim();
		sInput = sInput.SpanExcluding(_T(" [email protected]#$%^&*():;<>,.?{}~`+=-"));
		sInput = sInput.Left(25);
		while (sInput.IsEmpty()
			   || sInput.CompareNoCase(_T("emule")) == 0
			   || stristr(sInput, _T("emuleirc")) != NULL)
		{
			InputBox inputBox;
			inputBox.SetLabels(GetResString(IDS_IRC_NEWNICK), GetResString(IDS_IRC_NEWNICKDESC), sInput);
			if (inputBox.DoModal() == IDOK)
			{
				sInput = inputBox.GetInput();
				sInput.Trim();
				sInput = sInput.SpanExcluding(_T(" [email protected]#$%^&*():;<>,.?{}~`+=-"));
				sInput = sInput.Left(25);
			}
			else
				return;
		}
		thePrefs.SetIRCNick(sInput);
		//if not connected, connect..
		m_pIrcMain->Connect();
	}
	else
	{
		//If connected, disconnect..
		m_pIrcMain->Disconnect();
		m_wndChanList.ResetServerChannelList();
	}
}
开发者ID:brolee,项目名称:EMule-GIFC,代码行数:35,代码来源:IrcWnd.cpp

示例2: UndertakeRequest

BOOL CVersionChecker::UndertakeRequest(CString& strPost)
{
	m_pRequest.SetURL( _T("http://update.trillinux.org/version/beta.php?") + strPost );
	//Remember to set the update server for final releases.
	
	if ( ! m_pRequest.Execute( FALSE ) ) return FALSE;
	
	int nStatusCode = m_pRequest.GetStatusCode();
	if ( nStatusCode < 200 || nStatusCode > 299 ) return FALSE;
	
	CString strResponse = m_pRequest.GetResponseString();
	CString strHack = theApp.GetProfileString( _T("VersionCheck"), _T("TestResponse"), _T("") );
	if ( strHack.GetLength() ) strResponse = strHack;
	
	for ( strResponse += '&' ; strResponse.GetLength() ; )
	{
		CString strItem	= strResponse.SpanExcluding( _T("&") );
		strResponse		= strResponse.Mid( strItem.GetLength() + 1 );
		
		CString strKey = strItem.SpanExcluding( _T("=") );
		if ( strKey.GetLength() == strItem.GetLength() ) continue;
		strItem = CTransfer::URLDecode( strItem.Mid( strKey.GetLength() + 1 ) );

		strItem.TrimLeft();
		strItem.TrimRight();
		
		m_pResponse.SetAt( strKey, strItem );
	}
	
	return TRUE;
}
开发者ID:ericfillipe1,项目名称:shareaza-code,代码行数:31,代码来源:VersionChecker.cpp

示例3: LoadList

bool CLightWizard::LoadList()
{
	try
	{
		//Load LightWiz.ini
		CString csFile;
		csFile.Format("%sLightWiz.ini",Main->m_csRootDirectory);
		CStdioFile pFile;
		if ( !pFile.Open(csFile, CFile::modeRead | CFile::shareDenyNone) )
		{
			Main->m_log.Add(1,"ERROR: Unable to open file %s", csFile);
			return false;
		}

		BOOL bStatus = TRUE;
		while ( bStatus )
		{
			CString csLine;
			bStatus = pFile.ReadString(csLine);

			if ( !bStatus )
				break;

			csLine = csLine.SpanExcluding("//");
			csLine.Trim(); 
			if ( csLine != "" )
			{
				CLightObj * pLight = new (CLightObj);
				pLight->m_csName = csLine.SpanExcluding(":");
				csLine = csLine.Mid(csLine.Find(":") + 1);
				pLight->m_Light.Add(csLine.SpanExcluding(","));
				while (csLine.Find(",") != -1)
				{
					csLine = csLine.Mid(csLine.Find(",") + 1);
					pLight->m_Light.Add(csLine.SpanExcluding(","));
				}

				m_aLights.Add(pLight);
			}
		}
	}
	catch (CFileException *e)
	{
		Main->m_log.Add(1,"ERROR: Caught an exception while reading the file %s.  Cause code = %ld", e->m_strFileName, e->m_cause);
		e->Delete();
	}
	return true;
}
开发者ID:Ben1028,项目名称:Axis2,代码行数:48,代码来源:LightWizard.cpp

示例4: OnDelete

void CSubmountsDlg::OnDelete()
{
	HOURGLASS hourglass;

	int nIndex = m_SubmtList.GetCurSel();
	ASSERT(nIndex >= 0);

	CString strSubmt;
	CString strShareName;
	m_SubmtList.GetText(nIndex, strSubmt);

	ASSERT(!strSubmt.IsEmpty());

	strShareName = strSubmt.SpanExcluding(_T("="));

	if (ShowMessageBox(IDS_REALLY_DELETE_SUBMT, MB_YESNO | MB_ICONQUESTION, IDS_REALLY_DELETE_SUBMT, strShareName) != IDYES)
		return;

	m_SubmtList.DeleteString(nIndex);

	if (m_SubmtList.GetCount() == 0) {
		m_Delete.EnableWindow(FALSE);
		m_Change.EnableWindow(FALSE);
	}

	CSubmountInfo *pInfo = new CSubmountInfo();
	pInfo->SetShareName(strShareName);
	pInfo->SetStatus(SIS_DELETED);
	AddWork(pInfo);
}
开发者ID:bagdxk,项目名称:openafs,代码行数:30,代码来源:submounts_dlg.cpp

示例5: OnLocalText

BOOL CChatWnd::OnLocalText(const CString& sText)
{
    // Save history
    m_pHistory.Add( sText );
    if ( m_pHistory.GetSize() > EDIT_HISTORY ) m_pHistory.RemoveAt( 0 );
    m_nHistory = static_cast< int >( m_pHistory.GetSize() );

    if ( sText.GetAt( 0 ) == _T('/') )
    {
        CString strCommand = sText.SpanExcluding( _T(" \t") ).Trim();
        if ( strCommand.CompareNoCase( _T("/me") ) == 0 )
        {
            // Action text
            return OnLocalMessage( true, sText.Mid( 4 ) );
        }
        else if ( OnLocalCommand( strCommand, sText.Mid( strCommand.GetLength() + 1 ).Trim() ) )
        {
            // Handled command
            return TRUE;
        }
    }
    else if ( sText.GetAt( 0 ) == _T('*') &&
              ( sText.GetAt( 1 ) == _T(' ') || sText.GetAt( 1 ) == _T('\t') ) )
    {
        // Action text
        return OnLocalMessage( true, sText.Mid( 2 ) );
    }

    // Regular text
    return OnLocalMessage( false, sText );
}
开发者ID:nlstone,项目名称:Shareaza,代码行数:31,代码来源:WndChat.cpp

示例6: Read

bool CPatch::Read(CStdioFile& fp)
{
	CString	s;
	int	Version;
	if (!fp.ReadString(s) || _stscanf(s, FILE_ID, &Version) != 1)
		return(FALSE);
	SetDefaults();	// in case some lines are missing
	while (fp.ReadString(s)) {
		s.TrimLeft();
		CString	Name = s.SpanExcluding(_T(" \t"));
		CString	Arg = s.Mid(Name.GetLength());
		int	i;
		for (i = 0; i < ROWS; i++) {
			if (Name == m_RowData[i].Name) {
				ROW	*r = &m_Row[i];
				_stscanf(Arg, _T("%lf %d %lf %lf %lf"),
					&r->Val, &r->Wave, &r->Amp, &r->Freq, &r->PW);
				break;
			}
		}
		if (i >= ROWS) {	// not a parm row, assume it's a state member
			for (i = 0; m_LineInfo[i].Name != NULL; i++) {
				if (Name == m_LineInfo[i].Name) {
					CFormatIO::StrToVal(m_LineInfo[i].Type, Arg,
						((char *)this) + m_LineInfo[i].Offset);
					break;
				}
			}
		}
	}
	return(TRUE);
}
开发者ID:Dewb,项目名称:UltraWhorld,代码行数:32,代码来源:Patch.cpp

示例7: OnToolHitTest

INT_PTR CRemoteWnd::OnToolHitTest(CPoint point, TOOLINFO* pTI) const
{
	if ( CmdButton* pButton = HitTestButtons( point ) )
	{
		CString strTip;

		if ( LoadString( strTip, pButton->m_nID ) )
		{
			if ( LPCTSTR pszBreak = _tcschr( strTip, '\n' ) )
			{
				pTI->lpszText = _tcsdup( pszBreak + 1 );
			}
			else
			{
				strTip = strTip.SpanExcluding( L"." );
				pTI->lpszText = _tcsdup( strTip );
			}
		}

		pTI->hwnd		= GetSafeHwnd();
		pTI->uId		= pButton->m_nID;
		pTI->uFlags		= pTI->uFlags & ~TTF_IDISHWND;
		pTI->rect		= pButton->m_rc;

		return pTI->uId;
	}

	return CWnd::OnToolHitTest( point, pTI );
}
开发者ID:GetEnvy,项目名称:Envy,代码行数:29,代码来源:WndMonitor.cpp

示例8: OnBnClickedBnIrcconnect

void CIrcWnd::OnBnClickedBnIrcconnect()
{
	if(!m_bConnected)
	{
		if( thePrefs.GetIRCNick().MakeLower() == _T("emule") || thePrefs.GetIRCNick().MakeLower().Find(_T("emuleirc")) != -1 )
		{
			InputBox inputbox;
			inputbox.SetLabels(GetResString(IDS_IRC_NEWNICK), GetResString(IDS_IRC_NEWNICKDESC), _T("eMule"));
			if (inputbox.DoModal() == IDOK)
			{
				CString input = inputbox.GetInput();
				input.Trim();
				input = input.SpanExcluding(_T(" [email protected]#$%^&*():;<>,.?{}~`+=-"));
				if( input != "" )
					thePrefs.SetIRCNick(input.GetBuffer());
			}
		}
		//if not connected, connect..
		m_pIrcMain->Connect();
	}
	else
	{
		//If connected, disconnect..
		m_pIrcMain->Disconnect();
	}
}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:26,代码来源:IrcWnd.cpp

示例9: Separate

void CXMLDlg::Separate(const CString& szItemType, CString& szTitle, CString& szValue)
{
	szTitle = szItemType.SpanExcluding(_T("="));
	szTitle.TrimLeft();
	szTitle.TrimRight();
	szValue = szItemType.Mid(szItemType.Find('=')+1);
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:7,代码来源:XMLDlg.cpp

示例10: GetFrequency

unsigned int CBeep::GetFrequency()
{
    CString FrequencyString;
    m_Frequency.GetWindowText(FrequencyString);
    CString Frequency = FrequencyString.SpanExcluding(" hz");
    return atoi(Frequency);
}
开发者ID:dogshoes,项目名称:map-n-zap,代码行数:7,代码来源:Beep.cpp

示例11: GetControlValue

bool CHtmlDialog::GetControlValue(const CString& strControlName, CString& szValue)
{
	if (!m_varReturn.bstrVal)
		return false;

	CString szReturnString(m_varReturn.bstrVal);

	do
	{
		if (szReturnString == _T("\0") || !szReturnString.GetLength())
			break;

		CString szControlValuePair = szReturnString.SpanExcluding(_T(";"));
		CString szControlName = szControlValuePair.SpanExcluding(_T("="));

		if (!szControlName.CompareNoCase(strControlName))
		{
			szValue = szControlValuePair.Right(szControlValuePair.GetLength() - (szControlName.GetLength() + 1));
			return true;
		}
		
		CString szTemp = szReturnString.Right(szReturnString.GetLength() - (szControlValuePair.GetLength() + 1));
		szReturnString = szTemp;

	} while (true);

	return false;
}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:28,代码来源:HTMLDialog.cpp

示例12: CheckUsage

BOOL CXphoneApp::CheckUsage(CString& xUserId, CString& xPassword)
{
	CString xCmdLine = m_lpCmdLine;
	xCmdLine.MakeLower();
	
	if ( m_lpCmdLine && xCmdLine.Find( "-u:") >= 0 )
	{
		xUserId = xCmdLine.Mid( xCmdLine.Find( "-u:" ) + 3 );
		xUserId	= xUserId.SpanExcluding( _T("|;, ") );
	}
	if ( m_lpCmdLine && xCmdLine.Find( "-p:") >= 0 )
	{
		xPassword = xCmdLine.Mid( xCmdLine.Find( "-p:" ) + 3 );
		xPassword = xPassword.SpanExcluding( _T("|;, ") );
	}
	
	return ! (xUserId.IsEmpty() | xPassword.IsEmpty());
}
开发者ID:pics860,项目名称:callcenter,代码行数:18,代码来源:xphone.cpp

示例13: GetAppPath

CString CTripLightApp::GetAppPath()
{
	CString	s = GetCommandLine();
	s.TrimLeft();	// trim leading whitespace just in case
	if (s[0] == '"')	// if first char is a quote
		s = s.Mid(1).SpanExcluding(_T("\""));	// span to next quote
	else
		s = s.SpanExcluding(_T(" \t"));	// span to next whitespace
	return(s);
}
开发者ID:victimofleisure,项目名称:TripLight,代码行数:10,代码来源:TripLight.cpp

示例14:

BOOL CXuser32App::CheckUsage(CString& xUserId, CString& xPassword, BOOL& bTestor)
{
	CString xCmdLine = m_lpCmdLine;
	xCmdLine.MakeLower();
	
	if ( m_lpCmdLine && xCmdLine.Find( "-t") >= 0 )
	{
		bTestor = TRUE;
	}
	
	if ( m_lpCmdLine && xCmdLine.Find( "-u:") >= 0 )
	{
		xUserId = xCmdLine.Mid( xCmdLine.Find( "-u:" ) + 3 );
		xUserId	= xUserId.SpanExcluding( _T("|;, ") );
	}
	if ( m_lpCmdLine && xCmdLine.Find( "-p:") >= 0 )
	{
		xPassword = xCmdLine.Mid( xCmdLine.Find( "-p:" ) + 3 );
		xPassword = xPassword.SpanExcluding( _T("|;, ") );
	}
	
	return ! (xUserId.IsEmpty() ^ xPassword.IsEmpty());
}
开发者ID:pics860,项目名称:callcenter,代码行数:23,代码来源:Xuser32.cpp

示例15: SetStringName

BOOL CArrayMatrix::SetStringName(CString &DataString,CString & sName)
{
	int pos;
	pos=DataString.Find(_T("="));
	if(pos==-1||pos==0) return FALSE;
	CString tpName=sName;
	sName=DataString.SpanExcluding("=");//取等号作边的字符串为变量的名字
	sName.TrimLeft();
	sName.TrimRight();
	if(sName.GetLength()==0||sName.Find(_T(" "))!=-1) //当m_name为空格或则里面存在空格时返回假
	{
		sName=tpName;
		return FALSE;
	}	
	DataString=DataString.Right(lstrlen(DataString)-pos-1);//把DataString改成等号右边的字符串
	return TRUE;
}
开发者ID:eecrazy,项目名称:acmcode,代码行数:17,代码来源:ArrayMatrix.cpp


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