String WebVTTParser::collectWord(const String& input, unsigned* position) { StringBuilder string; while (*position < input.length() && !isASpace(input[*position])) string.append(input[(*position)++]); return string.toString(); }
bool VTTParser::hasRequiredFileIdentifier(const String& line) { // A WebVTT file identifier consists of an optional BOM character, // the string "WEBVTT" followed by an optional space or tab character, // and any number of characters that are not line terminators ... if (!line.startsWith("WEBVTT", fileIdentifierLength)) return false; if (line.length() > fileIdentifierLength && !isASpace(line[fileIdentifierLength])) return false; return true; }
void WebVTTParser::skipWhiteSpace(const String& line, unsigned* position) { while (*position < line.length() && isASpace(line[*position])) (*position)++; }