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.
5 #ifndef MediaQueryInputStream_h
6 #define MediaQueryInputStream_h
8 #include "wtf/text/WTFString.h"
12 class MediaQueryInputStream {
13 WTF_MAKE_NONCOPYABLE(MediaQueryInputStream);
14 WTF_MAKE_FAST_ALLOCATED;
16 MediaQueryInputStream(String input);
19 inline UChar nextInputChar()
24 void advance(unsigned = 1);
27 inline size_t maxLength()
29 return m_string.length() + 1;
32 inline size_t leftChars()
34 return m_string.length() - m_offset;
38 unsigned long long getUInt(unsigned start, unsigned end);
39 double getDouble(unsigned start, unsigned end);
41 template<bool characterPredicate(UChar)>
42 unsigned skipWhilePredicate(unsigned offset)
44 while ((m_offset + offset) < m_string.length() && characterPredicate(m_string[m_offset + offset]))
56 #endif // MediaQueryInputStream_h