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


C++ CAtlList::RemoveAll方法代码示例

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


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

示例1: ParseTypes

	void File::ParseTypes(InputStream& s, CAtlList<CStringW>& types)
	{
		types.RemoveAll();

		CStringW str;

		for(int c = s.SkipWhiteSpace(); iswcsym(c) || c == '.' || c == '@'; c = s.PeekChar())
		{
			c = s.GetChar();

			if(c == '.') 
			{
				if(str.IsEmpty()) s.ThrowError(_T("'type' cannot be an empty string"));
				if(!iswcsym(s.PeekChar())) s.ThrowError(_T("unexpected dot after type '%s'"), CString(str));

				types.AddTail(str);
				str.Empty();
			}
			else
			{
				if(str.IsEmpty() && iswdigit(c)) s.ThrowError(_T("'type' cannot start with a number"));
				if((!str.IsEmpty() || !types.IsEmpty()) && c == '@') s.ThrowError(_T("unexpected @ in 'type'"));

				str += (WCHAR)c;
			}
		}

		if(!str.IsEmpty())
		{
			types.AddTail(str);
		}
	}
开发者ID:Cyberbeing,项目名称:xy-VSFilter,代码行数:32,代码来源:File.cpp

示例2: GetAssociatedExtensionsFromRegistry

bool CFileAssoc::GetAssociatedExtensionsFromRegistry(CAtlList<CString>& exts) const
{
    exts.RemoveAll();

    CRegKey rkHKCR(HKEY_CLASSES_ROOT);
    LONG ret;
    DWORD i = 0;
    CString keyName, ext;
    DWORD len = MAX_PATH;

    while ((ret = rkHKCR.EnumKey(i, keyName.GetBuffer(len), &len)) != ERROR_NO_MORE_ITEMS) {
        if (ret == ERROR_SUCCESS) {
            keyName.ReleaseBuffer(len);

            if (keyName.Find(PROGID) == 0) {
                ext = keyName.Mid(_countof(PROGID) - 1);

                if (IsRegistered(ext)) {
                    exts.AddTail(ext);
                }
            }

            i++;
            len = MAX_PATH;
        }
    }

    return !exts.IsEmpty();
}
开发者ID:EchoLiao,项目名称:mpc-hc,代码行数:29,代码来源:FileAssoc.cpp

示例3: SearchFiles

static bool SearchFiles(CString mask, CAtlList<CString>& sl)
{
    if (mask.Find(_T("://")) >= 0) {
        return false;
    }

    mask.Trim();
    sl.RemoveAll();

    CMediaFormats& mf = AfxGetAppSettings().m_Formats;

    WIN32_FILE_ATTRIBUTE_DATA fad;
    bool fFilterKnownExts = (GetFileAttributesEx(mask, GetFileExInfoStandard, &fad)
                             && (fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY));
    if (fFilterKnownExts) {
        mask = CString(mask).TrimRight(_T("\\/")) + _T("\\*.*");
    }

    {
        CString dir = mask.Left(max(mask.ReverseFind('\\'), mask.ReverseFind('/')) + 1);

        WIN32_FIND_DATA fd;
        HANDLE h = FindFirstFile(mask, &fd);
        if (h != INVALID_HANDLE_VALUE) {
            do {
                if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
                    continue;
                }

                CString fn = fd.cFileName;
                //CString ext = fn.Mid(fn.ReverseFind('.')+1).MakeLower();
                CString ext = fn.Mid(fn.ReverseFind('.')).MakeLower();
                CString path = dir + fd.cFileName;

                if (!fFilterKnownExts || mf.FindExt(ext)) {
                    for (size_t i = 0; i < mf.GetCount(); i++) {
                        CMediaFormatCategory& mfc = mf.GetAt(i);
                        /* playlist files are skipped when playing the contents of an entire directory */
                        if ((mfc.FindExt(ext)) && (mf[i].GetLabel().CompareNoCase(_T("pls")) != 0)) {
                            sl.AddTail(path);
                            break;
                        }
                    }
                }

            } while (FindNextFile(h, &fd));

            FindClose(h);

            if (sl.GetCount() == 0 && mask.Find(_T(":\\")) == 1) {
                GetCDROMType(mask[0], sl);
            }
        }
    }

    return (sl.GetCount() > 1
            || sl.GetCount() == 1 && sl.GetHead().CompareNoCase(mask)
            || sl.GetCount() == 0 && mask.FindOneOf(_T("?*")) >= 0);
}
开发者ID:Azpidatziak,项目名称:mpc-hc,代码行数:59,代码来源:PlayerPlaylistBar.cpp

示例4: FindMainMovie

HRESULT CHdmvClipInfo::FindMainMovie(LPCTSTR strFolder, CString& strPlaylistFile, CAtlList<PlaylistItem>& MainPlaylist)
{
	HRESULT				hr		= E_FAIL;

	CString				strPath (strFolder);
	CString				strFilter;

	CAtlList<PlaylistItem>	Playlist;
	WIN32_FIND_DATA		fd = {0};

	strPath.Replace(_T("\\PLAYLIST\\"), _T("\\"));
	//strPath.Replace(_T("\\BDMV\\"),		_T("\\"));
	strPath.Replace(_T("\\STREAM\\"),		_T("\\"));
	strPath  += _T("\\BDMV\\");
	strFilter.Format (_T("%sPLAYLIST\\*.mpls"), strPath);

	HANDLE hFind = FindFirstFile(strFilter, &fd);
	if(hFind != INVALID_HANDLE_VALUE) {
		REFERENCE_TIME		rtMax	= 0;
		REFERENCE_TIME		rtCurrent;
		CString				strCurrentPlaylist;
		do {
			strCurrentPlaylist.Format(_T("%sPLAYLIST\\%s"), strPath, fd.cFileName);
			Playlist.RemoveAll();

			// Main movie shouldn't have duplicate M2TS filename...
			if (ReadPlaylist(strCurrentPlaylist, rtCurrent, Playlist) == S_OK && rtCurrent > rtMax) {
				rtMax			= rtCurrent;

				strPlaylistFile = strCurrentPlaylist;
				MainPlaylist.RemoveAll();
				POSITION pos = Playlist.GetHeadPosition();
				while(pos) {
					MainPlaylist.AddTail(Playlist.GetNext(pos));
				}

				hr				= S_OK;
			}
		} while(FindNextFile(hFind, &fd));

		FindClose(hFind);
	}

	return hr;
}
开发者ID:wangarong,项目名称:mpc-loop,代码行数:45,代码来源:HdmvClipInfo.cpp

示例5:

	void SubtitleFile::SegmentList::Lookup(float at, CAtlList<SegmentItem>& sis)
	{
		sis.RemoveAll();

		size_t k;
		if(Lookup(at, k)) 
		{
			sis.AddTailList(GetSegment(k));
		}
	}
开发者ID:Fluffiest,项目名称:mpc-hc,代码行数:10,代码来源:SubtitleFile.cpp

示例6: GetNewDefs

	void NodeFactory::GetNewDefs(CAtlList<Definition*>& defs)
	{
		defs.RemoveAll();

		POSITION pos = m_newnodes.GetHeadPosition();
		while(pos)
		{
			if(Definition* pDef = GetDefByName(m_newnodes.GetNext(pos)))
			{
				defs.AddTail(pDef);
			}
		}
	}
开发者ID:Fluffiest,项目名称:mpc-hc,代码行数:13,代码来源:NodeFactory.cpp

示例7: GetExtraHeaders

void CPhPhoneLineProgressInfo::GetExtraHeaders(CAtlList<CHeaderDataPtr>& listHeaderInfo) const
{
	struct phCustomHeaderInfo *custom_header;

	listHeaderInfo.RemoveAll();

	for (custom_header = m_pRegStateInfo->custom_headers; custom_header != NULL; custom_header = custom_header->next)
	{
		if ((custom_header->name) && (custom_header->value))
		{
			CHeaderDataPtr pHeaderInfo = new CHeaderData(custom_header->name, custom_header->value);
			listHeaderInfo.AddTail(pHeaderInfo);
		}
	}
}
开发者ID:gabrieldelsaint,项目名称:UIM,代码行数:15,代码来源:PhPhoneLineProgressInfo.cpp

示例8: SplitString

size_t Misc::SplitString(const CString & str, LPCTSTR tokens, CAtlList<CString> & list)
{
  list.RemoveAll();
  CAtlString token;
  int curPos = 0;

  token = str.Tokenize(tokens, curPos);
  while (-1 != curPos)
  {
    if (!token.IsEmpty())
    {
      list.AddTail(token);
    }
    token = str.Tokenize(tokens, curPos);
  }
  return list.GetCount();
}
开发者ID:salsita,项目名称:Magpie,代码行数:17,代码来源:Misc.cpp

示例9: GetAssociatedExtensions

bool CFileAssoc::GetAssociatedExtensions(const CMediaFormats& mf, CAtlList<CString>& exts)
{
    exts.RemoveAll();

    CAtlList<CString> mfcExts;
    for (size_t i = 0, cnt = mf.GetCount(); i < cnt; i++) {
        ExplodeMin(mf[i].GetExtsWithPeriod(), mfcExts, _T(' '));

        POSITION pos = mfcExts.GetHeadPosition();
        while (pos) {
            const CString ext = mfcExts.GetNext(pos);
            if (CFileAssoc::IsRegistered(ext)) {
                exts.AddTail(ext);
            }
        }
    }

    return !exts.IsEmpty();
}
开发者ID:Azpidatziak,项目名称:mpc-hc,代码行数:19,代码来源:FileAssoc.cpp

示例10: GetUnReportList

HRESULT CReportFileDB::GetUnReportList( CAtlList<CReportFile>& rfArray )
{
    HRESULT hr = S_OK;
    CComPtr<Skylark::ISQLiteComResultSet3>  piRtm;
    CReportFile rfile;

    if ( NULL == m_piSlDB )
    {
        hr = E_NOINTERFACE;
        goto Exit0;
    }

    hr = m_piSlDB->ExecuteQuery( REPORT_FILE_LOAD_REPORTLIST, &piRtm );
    if ( FAILED( hr ) )
    {
        goto Exit0;
    }

    rfArray.RemoveAll();

    while( !piRtm->IsEof() )
    {
        rfile.m_strFilePath = piRtm->GetAsString( 0 );
        rfile.m_nFileSize = piRtm->GetInt( 1 );
        rfile.m_nReportState = piRtm->GetInt( 2 );
        rfile.m_nTrack = piRtm->GetInt( 3 );
        rfile.SetCreateTime( piRtm->GetInt64( 4 ) );
        rfile.SetCommitTime( piRtm->GetInt64( 5 ) );
        rfile.SetReportTime( piRtm->GetInt64( 6 ) );
        rfile.m_nRescanState = piRtm->GetInt( 7 );

        rfArray.AddTail( rfile );

        piRtm->NextRow();
    }
Exit0:
    return hr;
}
开发者ID:dreamsxin,项目名称:PcManager,代码行数:38,代码来源:reportfiledb.cpp

示例11: FindMainMovie

HRESULT CHdmvClipInfo::FindMainMovie(LPCTSTR strFolder, CString& strPlaylistFile, CAtlList<PlaylistItem>& MainPlaylist, CAtlList<PlaylistItem>& MPLSPlaylists)
{
    HRESULT hr = E_FAIL;

    CString strPath(strFolder);
    CString strFilter;

    MPLSPlaylists.RemoveAll();

    CAtlList<PlaylistItem> Playlist;
    WIN32_FIND_DATA fd = {0};

    strPath.Replace(_T("\\PLAYLIST\\"), _T("\\"));
    strPath.Replace(_T("\\STREAM\\"), _T("\\"));
    strPath += _T("\\BDMV\\");
    strFilter.Format(_T("%sPLAYLIST\\*.mpls"), strPath);

    HANDLE hFind = FindFirstFile(strFilter, &fd);
    if (hFind != INVALID_HANDLE_VALUE) {
        REFERENCE_TIME rtMax = 0;
        REFERENCE_TIME rtCurrent;
        CString strCurrentPlaylist;
        do {
            strCurrentPlaylist.Format(_T("%sPLAYLIST\\%s"), strPath, fd.cFileName);
            Playlist.RemoveAll();

            // Main movie shouldn't have duplicate M2TS filename...
            if (ReadPlaylist(strCurrentPlaylist, rtCurrent, Playlist) == S_OK) {
                if (rtCurrent > rtMax) {
                    rtMax = rtCurrent;
                    strPlaylistFile = strCurrentPlaylist;
                    MainPlaylist.RemoveAll();
                    POSITION pos = Playlist.GetHeadPosition();
                    while (pos) {
                        MainPlaylist.AddTail(Playlist.GetNext(pos));
                    }
                    hr = S_OK;
                }
                if (rtCurrent >= (REFERENCE_TIME)MIN_LIMIT * 600000000) {
                    PlaylistItem Item;
                    Item.m_strFileName = strCurrentPlaylist;
                    Item.m_rtIn = 0;
                    Item.m_rtOut = rtCurrent;
                    MPLSPlaylists.AddTail(Item);
                }

            }
        } while (FindNextFile(hFind, &fd));

        FindClose(hFind);
    }

    if (MPLSPlaylists.GetCount() > 1) {
        // bubble sort
        for (size_t j = 0; j < MPLSPlaylists.GetCount(); j++) {
            for (size_t i = 0; i < MPLSPlaylists.GetCount() - 1; i++) {
                if (MPLSPlaylists.GetAt(MPLSPlaylists.FindIndex(i)).Duration() < MPLSPlaylists.GetAt(MPLSPlaylists.FindIndex(i + 1)).Duration()) {
                    MPLSPlaylists.SwapElements(MPLSPlaylists.FindIndex(i), MPLSPlaylists.FindIndex(i + 1));
                }
            }
        }
    }

    return hr;
}
开发者ID:Azzuro,项目名称:MediaPortal-1,代码行数:65,代码来源:HdmvClipInfo.cpp

示例12: Dump

void CMediaTypeEx::Dump(CAtlList<CString>& sl)
{
	CString str;

	sl.RemoveAll();

	int fmtsize = 0;

	CString major = CStringFromGUID(majortype);
	CString sub = CStringFromGUID(subtype);
	CString format = CStringFromGUID(formattype);

	sl.AddTail(ToString() + _T("\n"));

	sl.AddTail(_T("AM_MEDIA_TYPE: "));
	str.Format(_T("majortype: %s %s"), CString(GuidNames[majortype]), major);
	sl.AddTail(str);
	str.Format(_T("subtype: %s %s"), CString(GuidNames[subtype]), sub);
	sl.AddTail(str);
	str.Format(_T("formattype: %s %s"), CString(GuidNames[formattype]), format);
	sl.AddTail(str);
	str.Format(_T("bFixedSizeSamples: %d"), bFixedSizeSamples);
	sl.AddTail(str);
	str.Format(_T("bTemporalCompression: %d"), bTemporalCompression);
	sl.AddTail(str);
	str.Format(_T("lSampleSize: %d"), lSampleSize);
	sl.AddTail(str);
	str.Format(_T("cbFormat: %d"), cbFormat);
	sl.AddTail(str);

	sl.AddTail(_T(""));

	if (formattype == FORMAT_VideoInfo || formattype == FORMAT_VideoInfo2
			|| formattype == FORMAT_MPEGVideo || formattype == FORMAT_MPEG2_VIDEO) {
		fmtsize =
			formattype == FORMAT_VideoInfo ? sizeof(VIDEOINFOHEADER) :
			formattype == FORMAT_VideoInfo2 ? sizeof(VIDEOINFOHEADER2) :
			formattype == FORMAT_MPEGVideo ? sizeof(MPEG1VIDEOINFO)-1 :
			formattype == FORMAT_MPEG2_VIDEO ? sizeof(MPEG2VIDEOINFO)-4 :
			0;

		VIDEOINFOHEADER& vih = *(VIDEOINFOHEADER*)pbFormat;
		BITMAPINFOHEADER* bih = &vih.bmiHeader;

		sl.AddTail(_T("VIDEOINFOHEADER:"));
		str.Format(_T("rcSource: (%d,%d)-(%d,%d)"), vih.rcSource.left, vih.rcSource.top, vih.rcSource.right, vih.rcSource.bottom);
		sl.AddTail(str);
		str.Format(_T("rcTarget: (%d,%d)-(%d,%d)"), vih.rcTarget.left, vih.rcTarget.top, vih.rcTarget.right, vih.rcTarget.bottom);
		sl.AddTail(str);
		str.Format(_T("dwBitRate: %d"), vih.dwBitRate);
		sl.AddTail(str);
		str.Format(_T("dwBitErrorRate: %d"), vih.dwBitErrorRate);
		sl.AddTail(str);
		str.Format(_T("AvgTimePerFrame: %I64d"), vih.AvgTimePerFrame);
		sl.AddTail(str);

		sl.AddTail(_T(""));

		if (formattype == FORMAT_VideoInfo2 || formattype == FORMAT_MPEG2_VIDEO) {
			VIDEOINFOHEADER2& vih = *(VIDEOINFOHEADER2*)pbFormat;
			bih = &vih.bmiHeader;

			sl.AddTail(_T("VIDEOINFOHEADER2:"));
			str.Format(_T("dwInterlaceFlags: 0x%08x"), vih.dwInterlaceFlags);
			sl.AddTail(str);
			str.Format(_T("dwCopyProtectFlags: 0x%08x"), vih.dwCopyProtectFlags);
			sl.AddTail(str);
			str.Format(_T("dwPictAspectRatioX: %d"), vih.dwPictAspectRatioX);
			sl.AddTail(str);
			str.Format(_T("dwPictAspectRatioY: %d"), vih.dwPictAspectRatioY);
			sl.AddTail(str);
			str.Format(_T("dwControlFlags: 0x%08x"), vih.dwControlFlags);
			sl.AddTail(str);
			str.Format(_T("dwReserved2: 0x%08x"), vih.dwReserved2);
			sl.AddTail(str);

			sl.AddTail(_T(""));
		}

		if (formattype == FORMAT_MPEGVideo) {
			MPEG1VIDEOINFO& mvih = *(MPEG1VIDEOINFO*)pbFormat;

			sl.AddTail(_T("MPEG1VIDEOINFO:"));
			str.Format(_T("dwStartTimeCode: %d"), mvih.dwStartTimeCode);
			sl.AddTail(str);
			str.Format(_T("cbSequenceHeader: %d"), mvih.cbSequenceHeader);
			sl.AddTail(str);

			sl.AddTail(_T(""));
		} else if (formattype == FORMAT_MPEG2_VIDEO) {
			MPEG2VIDEOINFO& mvih = *(MPEG2VIDEOINFO*)pbFormat;

			sl.AddTail(_T("MPEG2VIDEOINFO:"));
			str.Format(_T("dwStartTimeCode: %d"), mvih.dwStartTimeCode);
			sl.AddTail(str);
			str.Format(_T("cbSequenceHeader: %d"), mvih.cbSequenceHeader);
			sl.AddTail(str);
			str.Format(_T("dwProfile: 0x%08x"), mvih.dwProfile);
			sl.AddTail(str);
			str.Format(_T("dwLevel: 0x%08x"), mvih.dwLevel);
//.........这里部分代码省略.........
开发者ID:Samangan,项目名称:mpc-hc,代码行数:101,代码来源:MediaTypeEx.cpp

示例13: if


//.........这里部分代码省略.........
            ListView_InsertColumn(hServicesListCtrl, 2, &column);
            MemFree(column.pszText);

            // Fourth column : Service's status.
            column.mask = LVCF_TEXT | LVCF_WIDTH;
            column.pszText = LoadResourceString(hInst, IDS_SERVICES_COLUMN_STATUS);
            column.cx = 60;
            ListView_InsertColumn(hServicesListCtrl, 3, &column);
            MemFree(column.pszText);

            // Fifth column : Service's disabled date.
            column.mask = LVCF_TEXT | LVCF_WIDTH;
            column.pszText = LoadResourceString(hInst, IDS_SERVICES_COLUMN_DATEDISABLED);
            column.cx = 120;
            ListView_InsertColumn(hServicesListCtrl, 4, &column);
            MemFree(column.pszText);

            //
            // Populate and sort the list.
            //
            GetServices();
            ListView_Sort(hServicesListCtrl, 0);
            Update_Btn_States(hDlg);

            // Select the first item.
            ListView_SetItemState(hServicesListCtrl, 0, LVIS_SELECTED, LVIS_SELECTED);

            return TRUE;
        }

        case WM_DESTROY:
        {
            ClearServicesList();
            userModificationsList.RemoveAll();
            return 0;
        }

        case WM_COMMAND:
        {
            switch (LOWORD(wParam))
            {
                case IDC_BTN_SERVICES_ACTIVATE:
                {
                    BOOL bAreThereModifs = FALSE;

                    int index = -1; // From the beginning.
                    while ((index = ListView_GetNextItem(hServicesListCtrl, index, LVNI_ALL)) != -1)
                    {
                        bAreThereModifs = ValidateItem(index, TRUE, FALSE) || bAreThereModifs; // The order is verrrrrry important !!!!
                    }

                    if (bAreThereModifs)
                    {
                        Update_Btn_States(hDlg);
                        PropSheet_Changed(GetParent(hServicesPage), hServicesPage);
                    }

                    return TRUE;
                }

                case IDC_BTN_SERVICES_DEACTIVATE:
                {
                    BOOL bAreThereModifs = FALSE;

                    int index = -1; // From the beginning.
                    while ((index = ListView_GetNextItem(hServicesListCtrl, index, LVNI_ALL)) != -1)
开发者ID:GYGit,项目名称:reactos,代码行数:67,代码来源:srvpage.cpp


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