本文整理汇总了C++中StringHash::SetCaseInsensitive方法的典型用法代码示例。如果您正苦于以下问题:C++ StringHash::SetCaseInsensitive方法的具体用法?C++ StringHash::SetCaseInsensitive怎么用?C++ StringHash::SetCaseInsensitive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringHash
的用法示例。
在下文中一共展示了StringHash::SetCaseInsensitive方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: s
// DirPath should by a directory with a trailing slash.
// Returns all files in all search paths, as unique relative paths.
// Subdirectories will have a trailing slash.
// All files and directories that start with . are skipped.
StringHash< String > RelativeDirectoryFileList( const Array< String > & searchPaths, const char * RelativeDirPath )
{
//Check each of the mirrors in searchPaths and build up a list of unique strings
StringHash< String > uniqueStrings;
const int numSearchPaths = searchPaths.GetSizeI();
for ( int index = 0; index < numSearchPaths; ++index )
{
const String fullPath = searchPaths[index] + String( RelativeDirPath );
DIR * dir = opendir( fullPath.ToCStr() );
if ( dir != NULL )
{
struct dirent * entry;
while ( ( entry = readdir( dir ) ) != NULL )
{
if ( entry->d_name[ 0 ] == '.' )
{
continue;
}
if ( entry->d_type == DT_DIR )
{
String s( RelativeDirPath );
s += entry->d_name;
s += "/";
uniqueStrings.SetCaseInsensitive( s, s );
}
else if ( entry->d_type == DT_REG )
{
String s( RelativeDirPath );
s += entry->d_name;
uniqueStrings.SetCaseInsensitive( s, s );
}
}
closedir( dir );
}
}
return uniqueStrings;
}