OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. | 2 * Copyright (c) 2013, Opera Software ASA. 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 // Scan a set of ASCII digits from the input. Return the number of digits | 123 // Scan a set of ASCII digits from the input. Return the number of digits |
124 // scanned, and set |number| to the computed value. If the digits make up a | 124 // scanned, and set |number| to the computed value. If the digits make up a |
125 // number that does not fit the 'int' type, |number| is set to INT_MAX. | 125 // number that does not fit the 'int' type, |number| is set to INT_MAX. |
126 // Note: Does not handle sign. | 126 // Note: Does not handle sign. |
127 unsigned scanDigits(int& number); | 127 unsigned scanDigits(int& number); |
128 | 128 |
129 // Scan a floating point value on one of the forms: \d+\.? \d+\.\d+ \.\d+ | 129 // Scan a floating point value on one of the forms: \d+\.? \d+\.\d+ \.\d+ |
130 bool scanFloat(float& number); | 130 bool scanFloat(float& number); |
131 | 131 |
| 132 // Scan a floating point value (per scanFloat) followed by a '%'. |
| 133 bool scanPercentage(float& percentage); |
| 134 |
132 protected: | 135 protected: |
133 Position position() const { return m_data.characters8; } | 136 Position position() const { return m_data.characters8; } |
134 Position end() const { return m_end.characters8; } | 137 Position end() const { return m_end.characters8; } |
135 void seekTo(Position); | 138 void seekTo(Position); |
136 UChar currentChar() const; | 139 UChar currentChar() const; |
137 void advance(unsigned amount = 1); | 140 void advance(unsigned amount = 1); |
138 // Adapt a UChar-predicate to an LChar-predicate. | 141 // Adapt a UChar-predicate to an LChar-predicate. |
139 // (For use with skipWhile/Until from ParsingUtilities.h). | 142 // (For use with skipWhile/Until from ParsingUtilities.h). |
140 template<bool characterPredicate(UChar)> | 143 template<bool characterPredicate(UChar)> |
141 static inline bool LCharPredicateAdapter(LChar c) { return characterPredicat
e(c); } | 144 static inline bool LCharPredicateAdapter(LChar c) { return characterPredicat
e(c); } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 ASSERT(position() < end()); | 227 ASSERT(position() < end()); |
225 if (m_is8Bit) | 228 if (m_is8Bit) |
226 m_data.characters8 += amount; | 229 m_data.characters8 += amount; |
227 else | 230 else |
228 m_data.characters16 += amount; | 231 m_data.characters16 += amount; |
229 } | 232 } |
230 | 233 |
231 } | 234 } |
232 | 235 |
233 #endif | 236 #endif |
OLD | NEW |