1 //===--------------------- StringLexer.h -------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef utility_StringLexer_h_
11 #define utility_StringLexer_h_
13 #include <initializer_list>
17 namespace lldb_utility {
22 typedef std::string::size_type Position;
23 typedef std::string::size_type Size;
25 typedef std::string::value_type Character;
27 StringLexer (std::string s);
29 StringLexer (const StringLexer& rhs);
31 // These APIs are not bounds-checked. Use HasAtLeast() if you're not sure.
38 std::pair<bool, Character>
39 NextIf (std::initializer_list<Character> cs);
42 AdvanceIf (const std::string& token);
56 // This will assert if there are less than s characters preceding the cursor.
61 operator = (const StringLexer& rhs);
71 } // namespace lldb_private
73 #endif // #ifndef utility_StringLexer_h_