本文整理汇总了C++中CIntVector::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ CIntVector::Clear方法的具体用法?C++ CIntVector::Clear怎么用?C++ CIntVector::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIntVector
的用法示例。
在下文中一共展示了CIntVector::Clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseSubCharsCommand
bool ParseSubCharsCommand(int numForms, const CCommandSubCharsSet *forms,
const UString &commandString, CIntVector &indices)
{
indices.Clear();
int numUsedChars = 0;
for(int i = 0; i < numForms; i++)
{
const CCommandSubCharsSet &set = forms[i];
int currentIndex = -1;
int len = MyStringLen(set.Chars);
for(int j = 0; j < len; j++)
{
wchar_t c = set.Chars[j];
int newIndex = commandString.Find(c);
if (newIndex >= 0)
{
if (currentIndex >= 0)
return false;
if (commandString.Find(c, newIndex + 1) >= 0)
return false;
currentIndex = j;
numUsedChars++;
}
}
if(currentIndex == -1 && !set.EmptyAllowed)
return false;
indices.Add(currentIndex);
}
return (numUsedChars == commandString.Length());
}
示例2: SortFileNames
void SortFileNames(const UStringVector &strings, CIntVector &indices)
{
indices.Clear();
int numItems = strings.Size();
indices.Reserve(numItems);
for(int i = 0; i < numItems; i++)
indices.Add(i);
indices.Sort(CompareStrings, (void *)&strings);
}
示例3: FindFormatForArchiveType
bool CCodecs::FindFormatForArchiveType(const UString &arcType, CIntVector &formatIndices) const
{
formatIndices.Clear();
for (int pos = 0; pos < arcType.Length();)
{
int pos2 = arcType.Find('.', pos);
if (pos2 < 0)
pos2 = arcType.Length();
const UString name = arcType.Mid(pos, pos2 - pos);
int index = FindFormatForArchiveType(name);
if (index < 0 && name != L"*")
{
formatIndices.Clear();
return false;
}
formatIndices.Add(index);
pos = pos2 + 1;
}
return true;
}