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


C++ TStringVector::push_back方法代码示例

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


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

示例1: Start

bool
CPing::Start( const CORE::CString& remoteHost           ,
              const Int32 maxPings /* = 0 */            ,
              const UInt32 bytesToSend /* = 32 */       ,
              const UInt32 timeout /* = 1000 */         ,
              const UInt32 minimalPingDelta /* = 500 */ )
{GUCEF_TRACE;

    TStringVector hostList;
    hostList.push_back( remoteHost );
    return Start( hostList         ,
                  maxPings         ,
                  bytesToSend      ,
                  timeout          ,
                  minimalPingDelta );
}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:16,代码来源:CPing.cpp

示例2:

bool
CComboboxImp::GetListItems( TStringVector& items ) const
{GUCE_TRACE;

    if ( NULL != m_combobox )
    {
        CEGUI::ListboxItem* item = NULL;
        size_t itemCount = m_combobox->getItemCount();
        for ( size_t i=0; i<itemCount; ++i )
        {
            item = m_combobox->getListboxItemFromIndex( i );
            items.push_back( item->getText().c_str() );
        }
        return true;
    }
    return false;
}
开发者ID:LiberatorUSA,项目名称:GUCE,代码行数:17,代码来源:guceCEGUIOgre_CComboboxImp.cpp

示例3: TruncateLastReported

void CAppWindow::TruncateLastReported()
{
	ASSERT(m_lpView != NULL);

	const TWaveMap & vReported = m_lpReportedView->GetWaves();
	const TWaveMap & vCurrent = m_lpView->GetWaves()->GetWaves();
	TStringVector vRemove;

	for (TWaveMapConstIter iter = vReported.begin(); iter != vReported.end(); iter++)
	{
		if (vCurrent.find(iter->first) == vCurrent.end())
		{
			vRemove.push_back(iter->first);
		}
	}

	m_lpReportedView->RemoveWaves(vRemove);
}
开发者ID:pvginkel,项目名称:wave-notify,代码行数:18,代码来源:CAppWindow.cpp

示例4: ListAvailableClient

void CommManager::ListAvailableClient( TStringVector& clientidList, DWORD dwDiffS /*= 60 * 5*/ )
{
	__time64_t now;
	_time64(&now);

	m_mapSection.Enter();
	{
		HeartbeatMap::iterator iter = m_heartbeatMap.begin();
		for (; iter != m_heartbeatMap.end(); iter++)
		{
			__time64_t lastHeartbeat = iter->second.time;
			if (now >= lastHeartbeat && now - lastHeartbeat < dwDiffS)
			{
				clientidList.push_back(iter->first);
			}
		}
	}
	m_mapSection.Leave();
}
开发者ID:redblack168,项目名称:trochilus,代码行数:19,代码来源:CommManager.cpp

示例5: FindChildrenOfType

CDataNode::TStringVector
CDataNode::GetChildrenValuesByName( const CString& name ) const
{
    TStringVector results;
    
    TConstDataNodeSet childNodes = FindChildrenOfType( name, false );
    TConstDataNodeSet::iterator i = childNodes.begin();
    while ( i != childNodes.end() )
    {
        const CString& childValue = (*i)->GetValue();
        if ( !childValue.IsNULLOrEmpty() )
        {
            results.push_back( childValue );
        }
        ++i;
    }

    return results;
}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:19,代码来源:CDataNode.cpp

示例6: splitByChar

void splitByChar(LPCTSTR str, TStringVector& parts, TCHAR sepChar)
{
	if (NULL == str) return;

	tstring temp = str;
	temp += sepChar;

	tstring::size_type begin = 0;
	tstring::size_type pos = temp.find(sepChar);

	while (pos != tstring::npos)
	{
		tstring part;
		if (pos > begin)
		{
			part = temp.substr(begin, pos - begin);
		}

		parts.push_back(part);

		begin = pos + 1;
		pos = temp.find(sepChar, begin);
	}
}
开发者ID:5loyd,项目名称:Oh-My-Lovely-Toy,代码行数:24,代码来源:tstring.cpp

示例7: GetFileNames

HRESULT CTsTeleportShellExt::GetFileNames(
    IDataObject *pDataObj,
    TStringVector& vFileNames)
{
    HRESULT hr;

    //
    // init for cleanup
    //

    STGMEDIUM mdm;
    mdm.pUnkForRelease = NULL;
    mdm.hGlobal = NULL;

    HDROP hdrop = NULL;

    STRRET strret;
    strret.pOleStr = NULL;

    LPTSTR szFileName = NULL;

    try
    {
        FORMATETC fmt = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };

        hr = pDataObj->GetData(&fmt, &mdm);
        LEAVE_IF_FAILED("pDataObj->GetData failed");

        hdrop = (HDROP) GlobalLock(mdm.hGlobal);

        if (!hdrop)
        {
            hr = HRESULT_FROM_WIN32(GetLastError());
        }
        LEAVE_IF_FAILED("GetFileNames failed");

        UINT nFiles = DragQueryFile(hdrop, (UINT)-1, NULL, 0);

        for(UINT nNames = 0; nNames < nFiles; nNames++)
        {
            UINT   cchFileName = DragQueryFile(hdrop, 
                nNames, 
                NULL,
                0);

            ASSERT(cchFileName);

            szFileName = new TCHAR[cchFileName+1]; 

            ASSERT(szFileName); // using C++ throwing new 

            UINT tmp = DragQueryFile(hdrop, 
                nNames, 
                szFileName,
                cchFileName+1);

            DBG_UNREFERENCED_LOCAL_VARIABLE(tmp); // for fre builds

            ASSERT(tmp == cchFileName);
            ASSERT(szFileName[cchFileName] == '\0');

            TString strFileName(szFileName);

            vFileNames.push_back(strFileName);
            
            delete [] szFileName;
            szFileName = NULL;
        }
    }
    catch (std::bad_alloc&)
    {
        hr = E_OUTOFMEMORY;
    }
    catch (std::exception&)
    {
        hr = E_UNEXPECTED;
    }

_Function_Exit:

    //
    // Cleanup
    // 

    if (hdrop)
    {
        GlobalUnlock(hdrop);
    }

    if (mdm.hGlobal)
    {
        ReleaseStgMedium(&mdm);
    }

    if (strret.pOleStr)
    {
        CoTaskMemFree(strret.pOleStr);
    }

    if (szFileName)
//.........这里部分代码省略.........
开发者ID:awakecoding,项目名称:TsTeleport,代码行数:101,代码来源:TsTeleportShellExt.cpp

示例8: DecodeCSVString

void DecodeCSVString( TStringVector &strings, const TString& astring, char adelimiter )
{
  TString str;
  str.SetLength( astring.Length() );

  strings.clear();

  if( astring.Length()==0 )
    return;

  enum { normal, parenthesis } state;
  state = normal;

  const char *beg = astring.c_str();
  const char *c = beg;
  char *destbeg = str.c_str();
  char *dest = destbeg;

  while( *c )
  {
    switch( state )
    {
      case normal:
        switch( *c )
        {
          case '"':
            state = parenthesis;
            c++;
            break;
          default:
            if( *c == adelimiter )
            {
              strings.push_back( TString( destbeg, dest-destbeg ) );
              dest = destbeg;
            }
            else {
              *dest = *c;
              dest++;
            }
            c++;
        }
        break;
      case parenthesis:
        if( *c == '"' )
        {
          c++;
          state = normal;
        }
        else {
          *dest = *c;
          c++;
          dest++;
        }
        break;
      default:
        strings.clear();
/* TODO : Nen� upln� jasn�, zda v p��pad� failu smazat to, co se dosud ud�lalo... */
        throw TException( "Unknown error in DecodeCSVString." );
    }
  }
  strings.push_back( TString( destbeg, dest-destbeg ) );

  unsigned int nstrings = strings.size();
  unsigned int ui;
  for( ui=0; ui<nstrings; ui++ )
    ReplaceHexFormWithOrdinals( strings[ui] );
}
开发者ID:Sustak,项目名称:final.utils,代码行数:67,代码来源:csv.cpp

示例9: SynchronisePopups

void CAppWindow::SynchronisePopups(CUnreadWaveCollection * lpUnreads, BOOL fManual)
{
	ASSERT(lpUnreads != NULL);

	BOOL fQueuedNewWaves = FALSE;
	TPopupVector vMustCancel;
	TStringVector vSeen;

	if (CPopupWindow::Instance() != NULL)
	{
		TPopupVector vPopups;
		
		CPopupWindow::Instance()->GetPopups(vPopups);

		for (TPopupVectorIter iter = vPopups.begin(); iter != vPopups.end(); iter++)
		{
			if (((CPopupBase *)(*iter))->GetType() == PT_WAVE)
			{
				CUnreadWavePopup * lpPopup = (CUnreadWavePopup *)*iter;
				wstring szPopupWaveId = lpPopup->GetUnread()->GetID();
				CUnreadWave * lpNewUnreadWave = lpUnreads->GetChange(szPopupWaveId);

				if (lpNewUnreadWave == NULL)
				{
					// Cancel the popup if it isn't changed anymore.

					vMustCancel.push_back(lpPopup);
				}
				else
				{
					// Else, update with the current changed status.

					lpPopup->UpdateUnread(lpNewUnreadWave);

					vSeen.push_back(szPopupWaveId);
				}
			}
		}
	}

	// Cancel all popups.

	for (TPopupVectorIter iter = vMustCancel.begin(); iter != vMustCancel.end(); iter++)
	{
		CPopup * lpPopup = *iter;

		if (!lpPopup->IsDisplaying())
		{
			lpPopup->Cancel();
		}
	}

	// Add all new popups.

	TUnreadWaveVector vUnreads = lpUnreads->GetChanges();

	// Waves can only be reported if has been reported within the
	// timeout period.

	CDateTime dtRereportLimit(CDateTime::Now() - CTimeSpan::FromMilliseconds((DOUBLE)TIMER_REREPORT_TIMEOUT));

	for (TUnreadWaveVectorIter iter1 = vUnreads.begin(); iter1 != vUnreads.end(); iter1++)
	{
		// If we haven't seen this before ...

		wstring szId((*iter1)->GetID());

		if (find(vSeen.begin(), vSeen.end(), szId) == vSeen.end())
		{
			// ... create a new popup

			TStringDateTimeMapIter pos = m_vReportedTimes.find(szId);

			// Verify whether this popup hasn't been reported for
			// the required time.

			if (pos == m_vReportedTimes.end() || pos->second < dtRereportLimit)
			{
				CUnreadWavePopup * lpPopup = new CUnreadWavePopup(*iter1);

				lpPopup->Show();

				if (pos != m_vReportedTimes.end())
				{
					m_vReportedTimes.erase(pos);
				}

				// We've queued a new popup, so make a noise.

				fQueuedNewWaves = TRUE;
			}
			else
			{
				// Silence the wave by reporting it as reported.

				HaveReportedWave(szId);

				// Delete the unread wave because we're going
				// to detach everything lateron.

//.........这里部分代码省略.........
开发者ID:pvginkel,项目名称:wave-notify,代码行数:101,代码来源:CAppWindow.cpp


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