OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MediaQueryInputStream_h | |
6 #define MediaQueryInputStream_h | |
7 | |
8 #include "wtf/text/WTFString.h" | |
9 | |
10 namespace WebCore { | |
11 | |
12 class MediaQueryInputStream { | |
13 WTF_MAKE_NONCOPYABLE(MediaQueryInputStream); | |
14 WTF_MAKE_FAST_ALLOCATED; | |
15 public: | |
16 MediaQueryInputStream(String input); | |
17 | |
18 UChar peek(unsigned); | |
19 inline UChar currentInputChar() | |
20 { | |
21 return peek(0); | |
22 } | |
23 | |
24 void advance(unsigned = 1); | |
25 void pushBack(UChar); | |
26 | |
27 inline size_t maxLength() | |
28 { | |
29 return m_string.length() + 1; | |
30 } | |
31 | |
32 unsigned long long getUInt(unsigned, unsigned); | |
eseidel
2014/03/13 17:22:07
I think these need named arguments so we can tell
| |
33 double getDouble(unsigned, unsigned); | |
34 | |
35 template<bool characterPredicate(UChar)> | |
36 unsigned skipWhilePredicate(unsigned offset) | |
37 { | |
38 while ((m_offset + offset) < m_string.length() && characterPredicate(m_s tring[m_offset + offset])) | |
39 ++offset; | |
40 return offset; | |
41 } | |
42 | |
43 private: | |
44 size_t m_offset; | |
45 String m_string; | |
46 }; | |
47 | |
48 } // namespace WebCore | |
49 | |
50 #endif // MediaQueryInputStream_h | |
51 | |
OLD | NEW |