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


C++ CAtlArray::GetCount方法代码示例

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


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

示例1: Expand

bool TrackEntry::Expand(CBinary& data, UINT64 Scope)
{
    if (ces.ce.IsEmpty()) {
        return true;
    }

    CAtlArray<ContentEncoding*> cearray;
    POSITION pos = ces.ce.GetHeadPosition();
    while (pos) {
        cearray.Add(ces.ce.GetNext(pos));
    }
    qsort(cearray.GetData(), cearray.GetCount(), sizeof(ContentEncoding*), cesort);

    for (int i = (int)cearray.GetCount() - 1; i >= 0; i--) {
        ContentEncoding* ce = cearray[i];

        if (!(ce->ContentEncodingScope & Scope)) {
            continue;
        }

        if (ce->ContentEncodingType == ContentEncoding::Compression) {
            if (!data.Decompress(ce->cc)) {
                return false;
            }
        } else if (ce->ContentEncodingType == ContentEncoding::Encryption) {
            // TODO
            return false;
        }
    }

    return true;
}
开发者ID:GottfriedCP,项目名称:mpc-hc,代码行数:32,代码来源:MatroskaFile.cpp

示例2: CreateSplineCoeffs

void Glyph::CreateSplineCoeffs(const CRect& spdrc)
{
    spline.RemoveAll();

    if (style.placement.path.IsEmpty()) {
        return;
    }

    size_t i = 0, j = style.placement.path.GetCount();

    CAtlArray<Point> pts;
    pts.SetCount(j + 2);

    Point p;

    while (i < j) {
        p.x = style.placement.path[i].x * scale.cx + spdrc.left * 64;
        p.y = style.placement.path[i].y * scale.cy + spdrc.top * 64;
        pts[++i] = p;
    }

    if (pts.GetCount() >= 4) {
        if (pts[1].x == pts[j].x && pts[1].y == pts[j].y) {
            pts.SetAt(0, pts[j - 1]);
            pts.SetAt(j + 1, pts[2]);
        } else {
            p.x = pts[1].x * 2 - pts[2].x;
            p.y = pts[1].y * 2 - pts[2].y;
            pts.SetAt(0, p);

            p.x = pts[j].x * 2 - pts[j - 1].x;
            p.y = pts[j].y * 2 - pts[j - 1].y;
            pts.SetAt(j + 1, p);
        }

        spline.SetCount(pts.GetCount() - 3);

        for (size_t i = 0, j = pts.GetCount() - 4; i <= j; i++) {
            static const float _1div6 = 1.0f / 6;

            SplineCoeffs sc;

            sc.cx[3] = _1div6 * (-  pts[i + 0].x + 3 * pts[i + 1].x - 3 * pts[i + 2].x + pts[i + 3].x);
            sc.cx[2] = _1div6 * (3 * pts[i + 0].x - 6 * pts[i + 1].x + 3 * pts[i + 2].x);
            sc.cx[1] = _1div6 * (-3 * pts[i + 0].x                + 3 * pts[i + 2].x);
            sc.cx[0] = _1div6 * (pts[i + 0].x + 4 * pts[i + 1].x + 1 * pts[i + 2].x);

            sc.cy[3] = _1div6 * (-  pts[i + 0].y + 3 * pts[i + 1].y - 3 * pts[i + 2].y + pts[i + 3].y);
            sc.cy[2] = _1div6 * (3 * pts[i + 0].y - 6 * pts[i + 1].y + 3 * pts[i + 2].y);
            sc.cy[1] = _1div6 * (-3 * pts[i + 0].y                + 3 * pts[i + 2].y);
            sc.cy[0] = _1div6 * (pts[i + 0].y + 4 * pts[i + 1].y + 1 * pts[i + 2].y);

            spline.SetAt(i, sc);
        }
    }
}
开发者ID:kenygia,项目名称:xy-vsfilter,代码行数:56,代码来源:Glyph.cpp

示例3: EnumWebSitesFromXML

BOOL CIISConfigHelper::EnumWebSitesFromXML(std::vector<IISWebSite>& sites)
{
	sites.clear();

	// connect to the config file
	CComPtr<IXMLDOMDocument> pDOM;
	HRESULT hr = CIIS7XMLConfigHelper::GetApplicationHostConfigDocument(&pDOM);
	if (hr != S_OK || pDOM == NULL)
		return FALSE;

	// get the site collection
	CComPtr<IXMLDOMNodeList> pSites;
	hr = CIIS7XMLConfigHelper::GetSitesCollection(pDOM, &pSites);
	if (hr != S_OK)
		return FALSE;

	long nSites = 0;
	pSites->get_length(&nSites);

	// loop thru the available sites
	for (long i = 0; i < nSites; i++)
	{
		CComPtr<IXMLDOMNode> pSite;
		hr = pSites->get_item(i, &pSite);
		if (hr != S_OK || pSite == NULL)
			continue;

		IISWebSite item;		
		item.eSource = IISWebSite::XML;

		CAtlArray<CAtlString> Ports;
		CAtlArray<CAtlString> SecurePorts;

		hr = CIIS7XMLConfigHelper::GetSiteInfo(pSite, item.sInstance, item.sDescription, item.sFileSystemPath, Ports, SecurePorts);
		if (hr != S_OK)
			continue;

		const int nPorts = (int) Ports.GetCount();
		for (int i = 0; i < nPorts; i++)
		{
			IISWebSiteBindings binding(Ports[i]);
			item.Ports.Add(binding);
		}

		const int nSecurePorts = (int) SecurePorts.GetCount();
		for (int i = 0; i < nSecurePorts; i++)
		{
			IISWebSiteBindings binding(SecurePorts[i]);
			item.Ports.Add(binding);
		}

		sites.push_back(item);
	}

	return TRUE;
}
开发者ID:UIKit0,项目名称:IISxpress,代码行数:56,代码来源:IISConfigHelper.cpp

示例4: SortByPath

void CPlaylist::SortByPath()
{
    CAtlArray<plsort2_t> a;
    a.SetCount(GetCount());
    POSITION pos = GetHeadPosition();
    for (int i = 0; pos; i++, GetNext(pos)) {
        a[i].str = GetAt(pos).m_fns.GetHead(), a[i].pos = pos;
    }
    qsort(a.GetData(), a.GetCount(), sizeof(plsort2_t), compare2);
    for (size_t i = 0; i < a.GetCount(); i++) {
        MoveToTail(a[i].pos);
    }
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:13,代码来源:Playlist.cpp

示例5: Randomize

void CPlaylist::Randomize()
{
    CAtlArray<plsort_t> a;
    a.SetCount(GetCount());
    srand((unsigned int)time(nullptr));
    POSITION pos = GetHeadPosition();
    for (int i = 0; pos; i++, GetNext(pos)) {
        a[i].n = rand(), a[i].pos = pos;
    }
    qsort(a.GetData(), a.GetCount(), sizeof(plsort_t), compare);
    for (size_t i = 0; i < a.GetCount(); i++) {
        MoveToTail(a[i].pos);
    }
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:14,代码来源:Playlist.cpp

示例6: SortStringArray

void SortStringArray(CAtlArray<CString>& Arr, bool bAcsesnding /* = true */)
{
	if (Arr.GetCount() > 1)
	{
		if (bAcsesnding)
		{
			QSortAcs(Arr, 0, (int)Arr.GetCount() - 1);
		}
		else
		{
			QSortDesc(Arr, 0, (int)Arr.GetCount() - 1);
		}
	}
}
开发者ID:axxapp,项目名称:winxgui,代码行数:14,代码来源:common.cpp

示例7: SortClasses

void SortClasses(CAtlArray<VSClass*>& Arr, bool bAcsesnding /* = true */)
{
	if (Arr.GetCount() > 1)
	{
		if (bAcsesnding)
		{
			QSortAcs(Arr, 0, (int)Arr.GetCount() - 1);
		}
		else
		{
			QSortDesc(Arr, 0, (int)Arr.GetCount() - 1);
		}
	}
}
开发者ID:axxapp,项目名称:winxgui,代码行数:14,代码来源:common.cpp

示例8: SortByName

void CPlaylist::SortByName()
{
    CAtlArray<plsort2_t> a;
    a.SetCount(GetCount());
    POSITION pos = GetHeadPosition();
    for (int i = 0; pos; i++, GetNext(pos)) {
        CString& fn = GetAt(pos).m_fns.GetHead();
        a[i].str = (LPCTSTR)fn + std::max(fn.ReverseFind('/'), fn.ReverseFind('\\')) + 1;
        a[i].pos = pos;
    }
    qsort(a.GetData(), a.GetCount(), sizeof(plsort2_t), compare2);
    for (size_t i = 0; i < a.GetCount(); i++) {
        MoveToTail(a[i].pos);
    }
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:15,代码来源:Playlist.cpp

示例9: Shuffle

POSITION CPlaylist::Shuffle()
{
	CAtlArray<plsort2_t> a;
	a.SetCount(GetCount());
	srand((unsigned)time(NULL));
	POSITION pos = GetHeadPosition();
	for(int i = 0; pos; i++, GetNext(pos))
		a[i].pos = pos;
	
	pos = GetPos();
	int rnd = Rand(0, a.GetCount()-1);
	while(pos == a[rnd].pos) rnd = Rand(0, a.GetCount()-1);

	return a[rnd].pos;
}
开发者ID:Fluffiest,项目名称:splayer,代码行数:15,代码来源:Playlist.cpp

示例10: VerifyFile

int CCommon::VerifyFile(CAtlArray<CString>& arrFile)
{
	DWORD dwWinTrust = 0;
	size_t nCount = arrFile.GetCount();
	CWinTrustVerifier verifier;
	verifier.TryLoadDll();
	CString strFile;
	HRESULT hr = S_OK;
	for (size_t i = 0; i < nCount; i++)
	{
		strFile = arrFile[i];
		dwWinTrust = verifier.VerifyFile(strFile, NULL);
		if (dwWinTrust <= 0x0000FFFF)
			hr = AtlHresultFromWin32(dwWinTrust);
		else
			hr = dwWinTrust;

		if ( FAILED(hr))
		{
			CKSafeExamLog::GetLogPtr()->WriteLog(L"VerifyFile Failed: File = %s, hr = 0x%x", strFile, hr);
			dwWinTrust = -1;
			break;
		}

		strFile.Empty();
	}

	return dwWinTrust;
}
开发者ID:dreamsxin,项目名称:PcManager,代码行数:29,代码来源:common.cpp

示例11: GetExceptionInfoByCode

static CExceptionInfo* GetExceptionInfoByCode( DWORD dwExceptionCode )
{
	for( size_t i = 0; i < g_aException.GetCount(); ++i )
		if( g_aException[i].dwCode == dwExceptionCode )
			return &g_aException[i];
	return NULL;
}
开发者ID:localvar,项目名称:backup,代码行数:7,代码来源:Main.cpp

示例12: ScanPathSync

void SlimItem::ScanPathSync()
{
    DWORD dwAttributes;
    CAtlArray<CString> itemPaths;

    GetPaths(itemPaths);

    for (size_t i = 0; i < itemPaths.GetCount(); i++)
    {
        dwAttributes = ::GetFileAttributes(itemPaths[i]);
        if (INVALID_FILE_ATTRIBUTES == dwAttributes)
            continue;

        if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY)
        {
            if (!slimhelper::ScanDirectory(itemPaths[i], this))
                break;
        }
        else
        {
            slimhelper::ScanFile(itemPaths[i], 0, INVALID_FILE_ATTRIBUTES, this);
        }
    }

    CheckEnable();
    ::PostMessage(m_hNotifyWnd, SLIM_WM_ITEM_SCAN_END, 0, 0);
}
开发者ID:6520874,项目名称:pcmanager,代码行数:27,代码来源:slimdata.cpp

示例13: CompressPaths

BOOL SlimItem::CompressPaths()
{
    DWORD dwAttributes;
    CAtlArray<CString> itemPaths;

    GetPaths(itemPaths);

    for (size_t i = 0; i < itemPaths.GetCount(); i++)
    {
        dwAttributes = ::GetFileAttributes(itemPaths[i]);
        if (INVALID_FILE_ATTRIBUTES == dwAttributes)
            continue;

        if (dwAttributes & FILE_ATTRIBUTE_COMPRESSED
            || dwAttributes & FILE_ATTRIBUTE_SPARSE_FILE)
        {
            continue;
        }

        if (dwAttributes & FILE_ATTRIBUTE_DIRECTORY)
        {
            slimhelper::CompressDirectory(itemPaths[i], this);
        }
        else
        {
            slimhelper::CompressFile(itemPaths[i], 0, dwAttributes, this);
        }
    }

    return TRUE;
}
开发者ID:6520874,项目名称:pcmanager,代码行数:31,代码来源:slimdata.cpp

示例14: if

/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/
int	CWsHook::GetAddrInfoW(PCWSTR pNodeName, PCWSTR pServiceName, const ADDRINFOW * pHints, PADDRINFOW * ppResult)
{
	int ret = WSAEINVAL;
	bool overrideDNS = false;

	void * context = NULL;
	CString name = CW2T(pNodeName);
	CAtlArray<DWORD> addresses;
	if( dlg && pNodeName )
		overrideDNS = dlg->DnsLookupStart( name, context, addresses );

	if( _GetAddrInfoW && !overrideDNS )
		ret = _GetAddrInfoW(CT2W((LPCWSTR)name), pServiceName, pHints, ppResult);
	else if( overrideDNS ) {
		if( addresses.IsEmpty() )
			ret = EAI_NONAME;
		else {
			// build the response structure with the addresses we looked up
			ret = 0;
			DWORD count = addresses.GetCount();

			ADDRINFOW_ADDR * result = (ADDRINFOW_ADDR *)malloc(sizeof(ADDRINFOW_ADDR) * count);
			for (DWORD i = 0; i < count; i++) {
				memset( &result[i], 0, sizeof(ADDRINFOW_ADDR) );
				result->info.ai_family = AF_INET;
				result->info.ai_addrlen = sizeof(struct sockaddr_in);
				result->info.ai_addr = (struct sockaddr *)&(result->addr);
				result->addr.sin_family = AF_INET;
				result->addr.sin_addr.S_un.S_addr = addresses[i];
				if( i < count - 1 )
					result->info.ai_next = (PADDRINFOW)&result[i+1];
			}
			addrInfo.AddTail(result);

			*ppResult = (PADDRINFOW)result;
		}
	}

	if (!ret && dlg) {
		PADDRINFOW addr = *ppResult;
		while (addr) {
      if (addr->ai_canonname)
        dlg->DnsLookupAlias(name, addr->ai_canonname);

      if (context && 
          addr->ai_addrlen >= sizeof(struct sockaddr_in) &&
          addr->ai_family == AF_INET ) {
				struct sockaddr_in * ipName = (struct sockaddr_in *)addr->ai_addr;
				dlg->DnsLookupAddress(context, ipName->sin_addr);
			}

			addr = addr->ai_next;
		}
    
    if (context)
		  dlg->DnsLookupDone(context);
	}

	return ret;
}
开发者ID:Appdynamics,项目名称:webpagetest,代码行数:62,代码来源:WsHook.cpp

示例15: getProperties

void COPCItem::getProperties(const CAtlArray<CPropertyDescription> &propsToRead, ATL::CAutoPtrArray<SPropertyValue> &propsRead){
	unsigned noProperties = (DWORD)propsToRead.GetCount();
	VARIANT *pValues = NULL;
	HRESULT *pErrors = NULL;
	DWORD *pPropertyIDs = new DWORD[noProperties];
	for (unsigned i = 0; i < noProperties; i++){
		pPropertyIDs[i] = propsToRead.GetAt(i).id;
	}
	propsRead.RemoveAll();
	propsRead.SetCount(noProperties);
	
	USES_CONVERSION;
	HRESULT res = group.getServer().getPropertiesInterface()->GetItemProperties(T2OLE(name), noProperties, pPropertyIDs, &pValues, &pErrors);
	delete []pPropertyIDs;
	if (FAILED(res)){
		throw OPCException("Failed to restrieve property values", res);
	}

	for (unsigned i = 0; i < noProperties; i++){
		CAutoPtr<SPropertyValue> v;
		if (!FAILED(pErrors[i])){
			v.Attach(new SPropertyValue(propsToRead[i], pValues[i]));
		}
		propsRead[i]=v;
	}

	COPCClient::comFree(pErrors);
	COPCClient::comFreeVariant(pValues, noProperties);
}
开发者ID:fahram,项目名称:DataServer,代码行数:29,代码来源:OPCItem.cpp


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