OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 (*position)++; | 53 (*position)++; |
54 return *position - startPosition; | 54 return *position - startPosition; |
55 } | 55 } |
56 | 56 |
57 unsigned VTTParser::collectDigitsToInt(const String& input, unsigned* position,
int& number) | 57 unsigned VTTParser::collectDigitsToInt(const String& input, unsigned* position,
int& number) |
58 { | 58 { |
59 VTTLegacyScanner inputScanner(input, position); | 59 VTTLegacyScanner inputScanner(input, position); |
60 return inputScanner.scanDigits(number); | 60 return inputScanner.scanDigits(number); |
61 } | 61 } |
62 | 62 |
63 String VTTParser::collectWord(const String& input, unsigned* position) | |
64 { | |
65 StringBuilder string; | |
66 while (*position < input.length() && !isASpace(input[*position])) | |
67 string.append(input[(*position)++]); | |
68 return string.toString(); | |
69 } | |
70 | |
71 bool VTTParser::parseFloatPercentageValue(const String& value, float& percentage
) | 63 bool VTTParser::parseFloatPercentageValue(const String& value, float& percentage
) |
72 { | 64 { |
73 // '%' must be present and at the end of the setting value. | 65 // '%' must be present and at the end of the setting value. |
74 if (value.isEmpty() || value[value.length() - 1] != '%') | 66 if (value.isEmpty() || value[value.length() - 1] != '%') |
75 return false; | 67 return false; |
76 | 68 |
77 unsigned position = 0; | 69 unsigned position = 0; |
78 unsigned digitsBeforeDot = scanDigits(value, &position); | 70 unsigned digitsBeforeDot = scanDigits(value, &position); |
79 unsigned digitsAfterDot = 0; | 71 unsigned digitsAfterDot = 0; |
80 if (value[position] == '.') { | 72 if (value[position] == '.') { |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 m_currentNode->parserAppendChild(ProcessingInstruction::create(docum
ent, "timestamp", charactersString)); | 581 m_currentNode->parserAppendChild(ProcessingInstruction::create(docum
ent, "timestamp", charactersString)); |
590 break; | 582 break; |
591 } | 583 } |
592 default: | 584 default: |
593 break; | 585 break; |
594 } | 586 } |
595 } | 587 } |
596 | 588 |
597 } | 589 } |
598 | 590 |
OLD | NEW |