本文整理汇总了C++中VTTScanner::isAt方法的典型用法代码示例。如果您正苦于以下问题:C++ VTTScanner::isAt方法的具体用法?C++ VTTScanner::isAt怎么用?C++ VTTScanner::isAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VTTScanner
的用法示例。
在下文中一共展示了VTTScanner::isAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scanPercentage
// Used for 'position' and 'size'.
static bool scanPercentage(VTTScanner& input, const VTTScanner::Run& valueRun, int& number)
{
// 1. If value contains any characters other than U+0025 PERCENT SIGN
// characters (%) and characters in the range U+0030 DIGIT ZERO (0) to
// U+0039 DIGIT NINE (9), then jump to the step labeled next setting.
// 2. If value does not contain at least one character in the range U+0030
// DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then jump to the step
// labeled next setting.
if (!input.scanDigits(number))
return false;
// 3. If any character in value other than the last character is a U+0025
// PERCENT SIGN character (%), then jump to the step labeled next
// setting.
// 4. If the last character in value is not a U+0025 PERCENT SIGN character
// (%), then jump to the step labeled next setting.
if (!input.scan('%') || !input.isAt(valueRun.end()))
return false;
// 5. Ignoring the trailing percent sign, interpret value as an integer,
// and let number be that number.
// 6. If number is not in the range 0 ≤ number ≤ 100, then jump to the step
// labeled next setting.
return number >= 0 && number <= 100;
}
示例2: parsedEntireRun
static inline bool parsedEntireRun(const VTTScanner& input, const VTTScanner::Run& run)
{
return input.isAt(run.end());
}