本文整理汇总了C#中Tokenizer.HasToken方法的典型用法代码示例。如果您正苦于以下问题:C# Tokenizer.HasToken方法的具体用法?C# Tokenizer.HasToken怎么用?C# Tokenizer.HasToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tokenizer
的用法示例。
在下文中一共展示了Tokenizer.HasToken方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessLine
/// @brief Helper method to process one line of the script file.
///
/// @throw Throws a scriptException on failure
///
/// @param testInfo The Info to populate from the script file.
/// @param str The line as read from the file.
private void ProcessLine(Info testInfo, string str)
{
str.Trim();
// Check for empty line or line starting with # comment indicator.
testInfo.SetActive( str.Length > 0 && str[0] != '#');
if (testInfo.IsActive()) {
Tokenizer t = new Tokenizer(str, m_nameDelimiter);
if (t.HasToken()) {
testInfo.SetId( t.Get() );
t++;
// It is possible for the test to have only a name and no arguments.
if (t.HasToken()) {
this.processArgs( testInfo, t.Get() );
}
}
}
}
示例2: processArgs
/// @brief Helper method to process the arguments portion of the script line.
///
/// @throw Throws a scriptException on failure
///
/// @param testInfo The Info to populate from the script file.
/// @param args The args portion of the script line.
private void processArgs(Info testInfo, string args)
{
Tokenizer t = new Tokenizer(args, m_argDelimiter);
for (; t.HasToken(); t++)
{
this.processArg(testInfo, t.Get());
}
}