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 currentInputChar(); |
| 19 UChar peek(unsigned); |
| 20 |
| 21 void advance(unsigned = 1); |
| 22 void pushBack(UChar); |
| 23 |
| 24 unsigned long long getUInt(unsigned, unsigned); |
| 25 double getDouble(unsigned, unsigned); |
| 26 |
| 27 template<bool characterPredicate(UChar)> |
| 28 unsigned skipWhilePredicate(unsigned offset) |
| 29 { |
| 30 while ((m_offset + offset) < m_string.length() && characterPredicate(m_s
tring[m_offset + offset])) |
| 31 ++offset; |
| 32 return offset; |
| 33 } |
| 34 |
| 35 private: |
| 36 size_t m_offset; |
| 37 String m_string; |
| 38 }; |
| 39 |
| 40 } // namespace WebCore |
| 41 |
| 42 #endif // MediaQueryInputStream_h |
| 43 |
OLD | NEW |