예제 #1
0
size_t VariantToUINTArray(VARIANT vtVar, FArray<FString>& aVids)
{
	USES_CONVERSION; 

	if (vtVar.vt == VT_BSTR)
	{
		const tchar* psz = OLE2T(vtVar.bstrVal); 
		if (psz != NULL)
		{
			if (NULL != strchr(psz, ','))
			{
				SplitStringToArray(psz, aVids); 
			}
			else
			{
				aVids.Add(psz);
			}
		}
	}
	else
	{
		FString StrVid;
		StrVid.Format("%u", VariantToUINT(vtVar));
		aVids.Add(StrVid); 
	}

	return aVids.GetCount(); 
}
예제 #2
0
size_t BuildDownloadArray(FArray<FDownload> &DownArray, const FArray<FString>& aVids)
{
	for (size_t k = 0; k < aVids.GetCount(); k++)
	{
		vidtype videoID = strtoul(aVids[k], NULL, 10);
		FDownload pVideo = g_Objects._DownloadManager.GetDownloadInfo(videoID);
		if (pVideo.IsValid())
		{
			DownArray.Add(pVideo);
		}
	}
	return DownArray.GetCount(); 
}