本文整理汇总了C++中TextParser::ReverseFind方法的典型用法代码示例。如果您正苦于以下问题:C++ TextParser::ReverseFind方法的具体用法?C++ TextParser::ReverseFind怎么用?C++ TextParser::ReverseFind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextParser
的用法示例。
在下文中一共展示了TextParser::ReverseFind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Parse
void PathParser::Parse (const TextFragment& input)
{
TextParser parser (input);
OptionalType<TextFragment> info;
parser.ReadText(info, _T(":"));
if ((info.IsSet()) && (info.Value().Length() == 1))
{
m_Drive = *(info.Value().Data());
parser.Skip(1);
}
// Find the last '/ or \ from the back, after the drive
uint32 index = parser.ReverseFind(_T("\\/"));
if (index != NUMBER_MAX_UNSIGNED(uint32))
{
m_Path = TextFragment(parser, 0, index);
parser.Skip(index+1);
}
// Now we are ate the complete filename
m_FileName = TextFragment (parser, 0, NUMBER_MAX_UNSIGNED(uint32));
// Find the extension from the current parser...
index = parser.ReverseFind(_T("."));
if (index == NUMBER_MAX_UNSIGNED(uint32))
{
// oops there is no extension, BaseFileName == Filename
m_BaseFileName = m_FileName;
}
else
{
m_BaseFileName = TextFragment (parser, 0, index);
m_Extension = TextFragment(parser, index + 1, NUMBER_MAX_UNSIGNED(uint32));
}
}