本文整理汇总了C++中StringRef::IndexOf方法的典型用法代码示例。如果您正苦于以下问题:C++ StringRef::IndexOf方法的具体用法?C++ StringRef::IndexOf怎么用?C++ StringRef::IndexOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringRef
的用法示例。
在下文中一共展示了StringRef::IndexOf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetExtension
StringRef FileInfo::GetExtension( StringRef file )
{
intp index= file.IndexOf('.');
if (index>0)
{
return file.SubString(index);
}
return StringRef::Empty;
}
示例2: EndType
bool SirenTextParser::EndType(StringRef& refProto)
{
refProto = refProto.TrimBegin();
intp index = refProto.IndexOf('}');
if (index < 0)
{
Log::Error("Cannot find }");
return false;
}
refProto = refProto.SubString(index + 1);
return EndBlock(refProto);;
}
示例3: ReadAttribute
StringRef SirenTextParser::ReadAttribute(StringRef& refProto)
{
refProto = refProto.TrimBegin();
intp index = refProto.IndexOf(']');
if (index < 0)
{
Log::Error("Cannot find ] on attribute");
return false;
}
StringRef result = refProto.SubString(0, index);
refProto = refProto.SubString(index + 1);
return result;
}
示例4: ReadFunctionArguments
bool SirenTextParser::ReadFunctionArguments(StringRef& refProto, List<StringRef>& outArguments)
{
//read arguments
intp endIndex = refProto.IndexOf(')');
if (endIndex < 0)
{
Log::Error("Invalid function.Lost ')' ");
return false;
}
StringRef args = refProto.SubString(1, endIndex - 1);
bool isSuccess = StringParser::Split(args, ",", outArguments, false);
if (!isSuccess)
{
Log::FormatError("Invalid function argument:{}", args);
return false;
}
refProto = refProto.SubString(endIndex);
return EndBlock(refProto);
}
示例5: Parse
bool ISirenFunction::Parse(SirenAssembly& assembly, StringRef& refProto)
{
//read arguments
intp endIndex = refProto.IndexOf(')');
if (endIndex < 0)
{
Log::Error("Invalid function.Lost ')' ");
return false;
}
StringRef args = refProto.SubString(1, endIndex - 1);
bool isSuccess = StringParser::Split(args, ",", mArguments, false);
if (!isSuccess)
{
Log::FormatError("Invalid function argument:{}", args);
return false;
}
refProto = refProto.SubString(endIndex);
return SirenTextParser::EndBlock(refProto);
}