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


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

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


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

示例1: PurgeDeletes

void CDownloads::PurgeDeletes()
{
	CStringList pRemove;
	HKEY hKey = NULL;
	
	if ( ERROR_SUCCESS != RegOpenKeyEx( HKEY_CURRENT_USER,
		_T("Software\\Shareaza\\Shareaza\\Delete"), 0, KEY_ALL_ACCESS, &hKey ) ) return;
	
	for ( DWORD nIndex = 0 ; nIndex < 1000 ; nIndex ++ )
	{
		DWORD nPath = MAX_PATH*2;
		TCHAR szPath[MAX_PATH*2];
		
		if ( ERROR_SUCCESS != RegEnumValue( hKey, nIndex, szPath, &nPath, NULL,
			NULL, NULL, NULL ) ) break;
		
		if ( GetFileAttributes( szPath ) == 0xFFFFFFFF || DeleteFile( szPath ) )
		{
			pRemove.AddTail( szPath );
		}
	}
	
	while ( ! pRemove.IsEmpty() )
	{
		RegDeleteValue( hKey, pRemove.RemoveHead() );
	}
	
	RegCloseKey( hKey );
}
开发者ID:ericfillipe1,项目名称:shareaza-code,代码行数:29,代码来源:Downloads.cpp

示例2: GetDynamicResource

/**
 * getDynamicChildNames
 *
 * @param           void
 * @return          void
 * @exception       -
*/
HRESULT
    CDynamicOpcServer::getDynamicChildNames(IN OPCBROWSETYPE browseType, 
			                IN LPCTSTR filterCriteria, IN VARTYPE dataTypeFilter, 
			                IN DWORD accessRightsFilter, OUT CStringList &nameList)
{
    HRESULT hr = S_FALSE;
    CStringList listParsedNames;
    GenericPointer<IEC_Resource>    pRes;
    hr = GetDynamicResource(&pRes, listParsedNames, m_curBrowsePath);
    if (SUCCEEDED(hr))
    {
        // special handling for browsing from root
        if (m_curBrowsePath.IsEmpty())
        {
            BranchList dynList;
            hr = NameSpaceHolder::GetDynResourceList(&dynList);
            if (FAILED(hr)) {
                return S_FALSE;
            }
            while (!dynList.IsEmpty())
            {
                IEC_Resource *pDynRes = (IEC_Resource *) dynList.RemoveHead();
                if (pDynRes == NULL) {
                    continue;
                }
                switch (browseType) {
                case OPC_BRANCH:
                    nameList.AddTail(pDynRes->getName());
                    break;
                case OPC_FLAT:
                    hr = pDynRes->FillChildrenList(nameList, pDynRes->getName(), listParsedNames, browseType, filterCriteria, dataTypeFilter, accessRightsFilter);
                    break;
                case OPC_LEAF:
                default:
                    break;
                }
                pDynRes->release();
            }
            return S_OK;
        }
        if (!pRes) {
            return S_FALSE;
        }
        // have resource, remove resource name and hand over to resource
        listParsedNames.RemoveHead();

        // walk down in control
        // deliver list of requested children
        hr = pRes->FillChildrenList(nameList, m_curBrowsePath, listParsedNames, browseType, filterCriteria, dataTypeFilter, accessRightsFilter);
    }
	return hr;
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:59,代码来源:opcDynServer.cpp

示例3: OnSetActive

BOOL CPackagePage::OnSetActive() 
{
	SetWizardButtons( PSWIZB_BACK | PSWIZB_NEXT );

	if ( ! theApp.m_sCommandLineSourceFile.IsEmpty() )
	{
		CStringList oDirs;
		oDirs.AddTail( theApp.m_sCommandLineSourceFile );
		theApp.m_sCommandLineSourceFile.Empty();

		while ( ! oDirs.IsEmpty() )
		{
			CString strFolder = oDirs.RemoveHead() + _T("\\");
			CFileFind finder;
			BOOL bWorking = finder.FindFile( strFolder + _T("*.*") );
			while ( bWorking )
			{
				bWorking = finder.FindNextFile();
				if ( ! finder.IsDots() && ! finder.IsHidden() )
				{
					CString sFilename = strFolder + finder.GetFileName();
					if ( finder.IsDirectory() )
						oDirs.AddTail( sFilename );
					else
						AddFile( sFilename );
				}
			}
		}

		if ( m_wndList.GetItemCount() > 0 )
			Next();
	}

	m_wndRemove.EnableWindow( m_wndList.GetSelectedCount() > 0 );

	UpdateData( FALSE );

	return CWizardPage::OnSetActive();
}
开发者ID:ivan386,项目名称:Shareaza,代码行数:39,代码来源:PagePackage.cpp

示例4: MXP_OpenAtomicTag


//.........这里部分代码省略.........
                  strSupports += " ";

                  // 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 being implemented
                }  // end of looping through all atomic elements
              } // end of wanting complete list
            else
              {
              for (POSITION pos = ArgumentList.GetHeadPosition (); pos; )
                {
                CArgument * pArgument = ArgumentList.GetNext (pos); 
                CStringList questionlist;
                StringToList (pArgument->strValue, ".", questionlist);   // break into components

                // should be one or two words, eg. send.prompt or color
                if (questionlist.GetCount () > 2)
                  {
                  MXP_error (DBG_ERROR, errMXP_InvalidSupportArgument,
                            TFormat ("Invalid <support> argument: %s" ,
                                      (LPCTSTR) pArgument->strValue));
                  return;
                  }
                
                CString strTag =  questionlist.RemoveHead ();
                strTag.MakeLower ();

                // check valid name requested
                if (!IsValidName (strTag))
                  {
                  MXP_error (DBG_ERROR, errMXP_InvalidSupportArgument,
                            TFormat ("Invalid <support> argument: %s" ,
                                      (LPCTSTR) strTag));
                  return;
                  }

                // look up main element name

                if (!App.m_ElementMap.Lookup (strTag, pElement) ||
                   (pElement->iFlags & TAG_NOT_IMP) != 0)
                  {     // not supported
                  strSupports += "-";
                  strSupports += strTag;
                  strSupports += " ";
                  continue;   // all done for this argument
                  }

                // only one word - they aren't looking for a suboption
                if (questionlist.IsEmpty ())
                  {     // supported
                  strSupports += "+";
                  strSupports += strTag;
                  strSupports += " ";
                  continue;   // all done for this argument
                  }
                  
                CString strSubtag =  questionlist.RemoveHead ();
开发者ID:WillFa,项目名称:mushclient,代码行数:67,代码来源:mxpOpenAtomic.cpp

示例5: Get_XML_date

bool Get_XML_date (CXMLelement & node,
                        const char * sName,
                        CTime & tValue,
                        const bool bUseDefault)

  {
CString strValue;

  if (!Get_XML_string (node, sName, strValue, true, true))
    if (bUseDefault)
      return false;
    else
      {
      tValue = 0;     // default is no time
      return false;
      }

  if (strValue.IsEmpty ())
      ThrowErrorException ("No time supplied for attribute named '%s'" ,
                          sName);

  // break up date into date portion / time portion
  CStringList strDateTime;
  StringToList (strValue, " ", strDateTime);

  if (strDateTime.GetCount () < 1 || strDateTime.GetCount () > 2)
    ThrowErrorException ("Date/time must consist of YYYY-MM-DD [ HH:MM:SS ]");

  CString strDate = strDateTime.RemoveHead ();
  CString strTime;
  if (!strDateTime.IsEmpty ())
     strTime = strDateTime.RemoveHead ();

  CString strYear, strMonth, strDay;

  CStringList strDateList;
  StringToList (strDate, "-", strDateList);

  if (strDateList.GetCount () != 3)
     ThrowErrorException ("Date must consist of YYYY-MM-DD");
   
  strYear = strDateList.RemoveHead ();
  strMonth = strDateList.RemoveHead ();
  strDay = strDateList.RemoveHead ();

  if (!IsNumber (strYear))
     ThrowErrorException ("Year is not numeric");
  if (!IsNumber (strMonth))
     ThrowErrorException ("Month is not numeric");
  if (!IsNumber (strDay))
     ThrowErrorException ("Day is not numeric");

  int iYear, iMonth, iDay;

  iYear = atoi (strYear);
  iMonth = atoi (strMonth);
  iDay = atoi (strDay);

  if (iYear <  1900 || iYear > 2100)
     ThrowErrorException ("Year must be in range 1900 to 2100");
  
  if (iMonth < 1 || iMonth > 12)
     ThrowErrorException ("Month must be in range 1 to 12");
  
  if (iDay < 1 || iDay > 31)
     ThrowErrorException ("Month must be in range 1 to 31");

  int iHour = 0, iMinute = 0, iSecond = 0;

  if (!strTime.IsEmpty ())
    {

    CString strHour, strMinute, strSecond;

    CStringList strTimeList;
    StringToList (strTime, ":", strTimeList);

    if (strTimeList.GetCount () > 3)
       ThrowErrorException ("Time must consist of HH, HH:MM, or HH:MM:SS");
   
    strHour = strTimeList.RemoveHead ();
    strMinute = "0";
    strSecond = "0";

    if (!strTimeList.IsEmpty ())
      {
      strMinute = strTimeList.RemoveHead ();
      if (!strTimeList.IsEmpty ())
        strSecond = strTimeList.RemoveHead ();
      }

    if (!IsNumber (strHour))
       ThrowErrorException ("Hour is not numeric");
    if (!IsNumber (strMinute))
       ThrowErrorException ("Minute is not numeric");
    if (!IsNumber (strSecond))
       ThrowErrorException ("Second is not numeric");

    iHour = atoi (strHour);
    iMinute = atoi (strMinute);
//.........这里部分代码省略.........
开发者ID:WillFa,项目名称:mushclient,代码行数:101,代码来源:xmlparse.cpp


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