本文整理汇总了C++中utString::at方法的典型用法代码示例。如果您正苦于以下问题:C++ utString::at方法的具体用法?C++ utString::at怎么用?C++ utString::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utString
的用法示例。
在下文中一共展示了utString::at方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loom_asset_recognizeAssetTypeFromPath
// Helper to recognize an asset's type from its path/name.
static int loom_asset_recognizeAssetTypeFromPath(utString& path)
{
// Easy out - empty strings are no good!
if (path.length() == 0)
{
return 0;
}
// Walk backwards to first dot.
size_t firstDotPos = path.size() - 1;
for (size_t pos = path.size() - 1; pos > 0; pos--)
{
if (path.at(pos) != '.')
{
continue;
}
firstDotPos = pos;
break;
}
// Split out the extension.
utString pathExt = path.substr(firstDotPos + 1);
// See if we can get a type out of any of the recognizers.
int type = 0;
for (UTsize i = 0; i < gRecognizerList.size(); i++)
{
type = gRecognizerList[i](pathExt.c_str());
if (type)
{
break;
}
}
// No match, so let's use text.
if (type == 0)
{
lmLogInfo(gAssetLogGroup, "Couldn't recognize '%s', defaulting to LATText...", path.c_str());
type = LATText;
}
return type;
}