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(); }
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(); }