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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 // Return a String constructed from the rest of the input (between input | 119 // Return a String constructed from the rest of the input (between input |
120 // pointer and end of input), and advance the input pointer accordingly. | 120 // pointer and end of input), and advance the input pointer accordingly. |
121 String restOfInputAsString(); | 121 String restOfInputAsString(); |
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+ | |
Mike West
2014/01/21 07:59:24
Is "0." a valid floating point value? It doesn't s
fs
2014/01/21 08:19:57
It is a valid floating point value. (Compare to ot
| |
130 bool scanFloat(float& number); | |
131 | |
129 protected: | 132 protected: |
130 Position position() const { return m_data.characters8; } | 133 Position position() const { return m_data.characters8; } |
131 Position end() const { return m_end.characters8; } | 134 Position end() const { return m_end.characters8; } |
132 void seekTo(Position); | 135 void seekTo(Position); |
133 UChar currentChar() const; | 136 UChar currentChar() const; |
134 void advance(unsigned amount = 1); | 137 void advance(unsigned amount = 1); |
135 // Adapt a UChar-predicate to an LChar-predicate. | 138 // Adapt a UChar-predicate to an LChar-predicate. |
136 // (For use with skipWhile/Until from ParsingUtilities.h). | 139 // (For use with skipWhile/Until from ParsingUtilities.h). |
137 template<bool characterPredicate(UChar)> | 140 template<bool characterPredicate(UChar)> |
138 static inline bool LCharPredicateAdapter(LChar c) { return characterPredicat e(c); } | 141 static inline bool LCharPredicateAdapter(LChar c) { return characterPredicat e(c); } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
254 unsigned* m_outPosition; | 257 unsigned* m_outPosition; |
255 union { | 258 union { |
256 const LChar* characters8; | 259 const LChar* characters8; |
257 const UChar* characters16; | 260 const UChar* characters16; |
258 } m_start; | 261 } m_start; |
259 }; | 262 }; |
260 | 263 |
261 } | 264 } |
262 | 265 |
263 #endif | 266 #endif |
OLD | NEW |