本文整理汇总了C++中UStringVector::Insert方法的典型用法代码示例。如果您正苦于以下问题:C++ UStringVector::Insert方法的具体用法?C++ UStringVector::Insert怎么用?C++ UStringVector::Insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UStringVector
的用法示例。
在下文中一共展示了UStringVector::Insert方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
void CProxyArc2::GetDirPathParts(int dirIndex, UStringVector &pathParts, bool &isAltStreamDir) const
{
pathParts.Clear();
isAltStreamDir = false;
if (dirIndex == k_Proxy2_RootDirIndex)
return;
if (dirIndex == k_Proxy2_AltRootDirIndex)
{
isAltStreamDir = true;
return;
}
while (dirIndex >= k_Proxy2_NumRootDirs)
{
const CProxyDir2 &dir = Dirs[dirIndex];
const CProxyFile2 &file = Files[dir.ArcIndex];
if (pathParts.IsEmpty() && dirIndex == file.AltDirIndex)
isAltStreamDir = true;
pathParts.Insert(0, file.Name);
int par = file.Parent;
if (par < 0)
break;
dirIndex = Files[par].DirIndex;
}
}
示例2: CheckPathToRoot
bool CCensorNode::CheckPathToRoot(bool include, UStringVector &pathParts, bool isFile) const
{
if (CheckPathCurrent(include, pathParts, isFile))
return true;
if (Parent == 0)
return false;
pathParts.Insert(0, Name);
return Parent->CheckPathToRoot(include, pathParts, isFile);
}
示例3: AddUniqueStringToHeadOfList
void AddUniqueStringToHeadOfList(UStringVector &list, const UString &s)
{
for (unsigned i = 0; i < list.Size();)
if (s.IsEqualTo_NoCase(list[i]))
list.Delete(i);
else
i++;
list.Insert(0, s);
}
示例4: GetPathParts
void CProxyFolder::GetPathParts(UStringVector &pathParts) const
{
pathParts.Clear();
const CProxyFolder *current = this;
while (current->Parent != NULL)
{
pathParts.Insert(0, current->Name);
current = current->Parent;
}
}
示例5: GetDirPathParts
void CProxyArc::GetDirPathParts(int dirIndex, UStringVector &pathParts) const
{
pathParts.Clear();
while (dirIndex >= 0)
{
const CProxyDir &dir = Dirs[dirIndex];
dirIndex = dir.ParentDir;
if (dirIndex < 0)
break;
pathParts.Insert(0, dir.Name);
}
}
示例6: ParseVolumeSizes
bool ParseVolumeSizes(const UString &s, CRecordVector<UInt64> &values)
{
values.Clear();
UStringVector destStrings;
SplitString(s, destStrings);
bool prevIsNumber = false;
for (int i = 0; i < destStrings.Size(); i++)
{
UString subString = destStrings[i];
subString.MakeUpper();
if (subString.IsEmpty())
return false;
if (subString == L"-")
return true;
if (prevIsNumber)
{
wchar_t c = subString[0];
UInt64 &value = values.Back();
prevIsNumber = false;
switch(c)
{
case L'B':
continue;
case L'K':
value <<= 10;
continue;
case L'M':
value <<= 20;
continue;
case L'G':
value <<= 30;
continue;
}
}
const wchar_t *start = subString;
const wchar_t *end;
UInt64 value = ConvertStringToUInt64(start, &end);
if (start == end)
return false;
if (value == 0)
return false;
values.Add(value);
prevIsNumber = true;
UString rem = subString.Mid((int)(end - start));
if (!rem.IsEmpty())
destStrings.Insert(i + 1, rem);
}
return true;
}
示例7: GetPathParts
void CPlugin::GetPathParts(UStringVector &pathParts)
{
pathParts.Clear();
CMyComPtr<IFolderFolder> folderItem = _folder;
for (;;)
{
CMyComPtr<IFolderFolder> newFolder;
folderItem->BindToParentFolder(&newFolder);
if (newFolder == NULL)
break;
NCOM::CPropVariant prop;
if (folderItem->GetFolderProperty(kpidName, &prop) == S_OK)
if (prop.vt == VT_BSTR)
pathParts.Insert(0, (const wchar_t *)prop.bstrVal);
folderItem = newFolder;
}
}
示例8: SetFolder
STDMETHODIMP CAgent::SetFolder(IFolderFolder *folder)
{
_archiveNamePrefix.Empty();
if (folder == NULL)
{
_agentFolder = NULL;
return S_OK;
}
else
{
CMyComPtr<IFolderFolder> archiveFolder = folder;
CMyComPtr<IArchiveFolderInternal> archiveFolderInternal;
RINOK(archiveFolder.QueryInterface(IID_IArchiveFolderInternal, &archiveFolderInternal));
RINOK(archiveFolderInternal->GetAgentFolder(&_agentFolder));
}
UStringVector pathParts;
pathParts.Clear();
CMyComPtr<IFolderFolder> folderItem = folder;
if (folderItem != NULL)
for (;;)
{
CMyComPtr<IFolderFolder> newFolder;
folderItem->BindToParentFolder(&newFolder);
if (newFolder == NULL)
break;
NCOM::CPropVariant prop;
if (folderItem->GetFolderProperty(kpidName, &prop) == S_OK)
if (prop.vt == VT_BSTR)
pathParts.Insert(0, (const wchar_t *)prop.bstrVal);
folderItem = newFolder;
}
for (int i = 0; i < pathParts.Size(); i++)
{
_archiveNamePrefix += pathParts[i];
_archiveNamePrefix += WCHAR_PATH_SEPARATOR;
}
return S_OK;
}
示例9: Correct_FsPath
void Correct_FsPath(bool absIsAllowed, UStringVector &parts, bool isDir)
{
unsigned i = 0;
if (absIsAllowed)
{
#if defined(_WIN32) && !defined(UNDER_CE)
bool isDrive = false;
#endif
if (parts[0].IsEmpty())
{
i = 1;
#if defined(_WIN32) && !defined(UNDER_CE)
if (parts.Size() > 1 && parts[1].IsEmpty())
{
i = 2;
if (parts.Size() > 2 && parts[2] == L"?")
{
i = 3;
if (parts.Size() > 3 && NWindows::NFile::NName::IsDrivePath2(parts[3]))
{
isDrive = true;
i = 4;
}
}
}
#endif
}
#if defined(_WIN32) && !defined(UNDER_CE)
else if (NWindows::NFile::NName::IsDrivePath2(parts[0]))
{
isDrive = true;
i = 1;
}
if (isDrive)
{
// we convert "c:name" to "c:\name", if absIsAllowed path.
UString &ds = parts[i - 1];
if (ds.Len() > 2)
{
parts.Insert(i, ds.Ptr(2));
ds.DeleteFrom(2);
}
}
#endif
}
for (; i < parts.Size();)
{
UString &s = parts[i];
Correct_PathPart(s);
if (s.IsEmpty())
{
if (isDir || i != parts.Size() - 1)
{
parts.Delete(i);
continue;
}
s = k_EmptyReplaceName;
}
else
{
#ifdef _WIN32
CorrectUnsupportedName(s);
#endif
}
i++;
}
if (!isDir)
{
if (parts.IsEmpty())
parts.Add((UString)k_EmptyReplaceName);
else
{
UString &s = parts.Back();
if (s.IsEmpty())
s = k_EmptyReplaceName;
}
}
}