本文整理汇总了C#中Tokenizer.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Tokenizer.Get方法的具体用法?C# Tokenizer.Get怎么用?C# Tokenizer.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tokenizer
的用法示例。
在下文中一共展示了Tokenizer.Get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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());
}
}
示例2: 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() );
}
}
}
}
示例3: processArg
/// @brief Helper method to process one argument string token.
///
/// Each argument should be in the format name=value.
///
/// @throw Throws a scriptException on failure
///
/// @param testInfo The Info to populate from the script file.
/// @param args The arg token from the script line.
private void processArg(Info testInfo, string arg)
{
char[] delimiters = {'='};
Tokenizer t = new Tokenizer(arg, delimiters);
this.scriptAssert(t.Number() == 2, "Invalid Argument Format", arg);
string name = t.Get();
t++;
// TODO - parse the third part (type)
testInfo.AddArgument(new Arg(name, t.Get(), ""));
}