本文整理汇总了C++中StrVec::SortNatural方法的典型用法代码示例。如果您正苦于以下问题:C++ StrVec::SortNatural方法的具体用法?C++ StrVec::SortNatural怎么用?C++ StrVec::SortNatural使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StrVec
的用法示例。
在下文中一共展示了StrVec::SortNatural方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadImageDir
bool ImageDirEngineImpl::LoadImageDir(const TCHAR *dirName)
{
fileName = str::Dup(dirName);
fileExt = _T("");
ScopedMem<TCHAR> pattern(path::Join(dirName, _T("*")));
WIN32_FIND_DATA fdata;
HANDLE hfind = FindFirstFile(pattern, &fdata);
if (INVALID_HANDLE_VALUE == hfind)
return false;
do {
if (!(fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
if (ImageEngine::IsSupportedFile(fdata.cFileName))
pageFileNames.Append(path::Join(dirName, fdata.cFileName));
}
} while (FindNextFile(hfind, &fdata));
FindClose(hfind);
if (pageFileNames.Count() == 0)
return false;
pageFileNames.SortNatural();
pages.AppendBlanks(pageFileNames.Count());
mediaboxes.AppendBlanks(pageFileNames.Count());
return true;
}
示例2: OpenDir
bool StressTest::OpenDir(const TCHAR *dirPath)
{
assert(filesToOpen.Count() == 0);
bool hasFiles = CollectStressTestSupportedFilesFromDirectory(dirPath, fileFilter, filesToOpen);
filesToOpen.SortNatural();
ScopedMem<TCHAR> pattern(str::Format(_T("%s\\*"), dirPath));
bool hasSubDirs = CollectPathsFromDirectory(pattern, dirsToVisit, true);
return hasFiles || hasSubDirs;
}
示例3: ParsePageRanges
// parses a list of page ranges such as 1,3-5,7- (i..e all but pages 2 and 6)
// into an interable list (returns NULL on parsing errors)
// caller must delete the result
static bool ParsePageRanges(const TCHAR *ranges, Vec<PageRange>& result)
{
if (!ranges)
return false;
StrVec rangeList;
rangeList.Split(ranges, _T(","), true);
rangeList.SortNatural();
for (size_t i = 0; i < rangeList.Count(); i++) {
int start, end;
if (str::Parse(rangeList.At(i), _T("%d-%d%$"), &start, &end) && 0 < start && start <= end)
result.Append(PageRange(start, end));
else if (str::Parse(rangeList.At(i), _T("%d-%$"), &start) && 0 < start)
result.Append(PageRange(start, INT_MAX));
else if (str::Parse(rangeList.At(i), _T("%d%$"), &start) && 0 < start)
result.Append(PageRange(start, start));
else
return false;
}
return result.Count() > 0;
}