OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 class StringScanner | 25 class StringScanner |
26 { | 26 { |
27 private: | 27 private: |
28 const DependentString mStr; | 28 const DependentString mStr; |
29 String::size_type mPos; | 29 String::size_type mPos; |
30 String::size_type mEnd; | 30 String::size_type mEnd; |
31 String::value_type mTerminator; | 31 String::value_type mTerminator; |
32 public: | 32 public: |
33 explicit StringScanner(const String& str, String::size_type pos = 0, | 33 explicit StringScanner(const String& str, String::size_type pos = 0, |
34 String::value_type terminator = u'\0') | 34 String::value_type terminator = ABP_TEXT('\0')) |
35 : mStr(str), mPos(pos), mEnd(str.length()), mTerminator(terminator) {} | 35 : mStr(str), mPos(pos), mEnd(str.length()), mTerminator(terminator) {} |
36 | 36 |
37 bool done() const | 37 bool done() const |
38 { | 38 { |
39 return mPos >= mEnd; | 39 return mPos >= mEnd; |
40 } | 40 } |
41 | 41 |
42 String::size_type position() const | 42 String::size_type position() const |
43 { | 43 { |
44 return mPos - 1; | 44 return mPos - 1; |
(...skipping 19 matching lines...) Expand all Loading... |
64 | 64 |
65 bool skip(String::value_type ch) | 65 bool skip(String::value_type ch) |
66 { | 66 { |
67 bool skipped = false; | 67 bool skipped = false; |
68 while ((skipped = skipOne(ch))); | 68 while ((skipped = skipOne(ch))); |
69 return skipped; | 69 return skipped; |
70 } | 70 } |
71 }; | 71 }; |
72 | 72 |
73 ABP_NS_END | 73 ABP_NS_END |
OLD | NEW |