Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: compiled/StringScanner.h

Issue 29606600: Issue 5146 - Implement DownloadableSubscription parsing in C++ (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Simplify the logic of Process() Created Dec. 4, 2017, 10:04 a.m.
Right Patch Set: Removed Md5sum and associated code Created Aug. 14, 2018, 12:38 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « compiled/FilterNotifier.h ('k') | compiled/bindings/main.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 #pragma once 18 #pragma once
19 19
20 #include "base.h"
20 #include "String.h" 21 #include "String.h"
22
23 ABP_NS_BEGIN
21 24
22 class StringScanner 25 class StringScanner
23 { 26 {
24 private: 27 private:
25 const DependentString mStr; 28 const DependentString mStr;
26 String::size_type mPos; 29 String::size_type mPos;
27 String::size_type mEnd; 30 String::size_type mEnd;
28 String::value_type mTerminator; 31 String::value_type mTerminator;
29 public: 32 public:
30 explicit StringScanner(const String& str, String::size_type pos = 0, 33 explicit StringScanner(const String& str, String::size_type pos = 0,
31 String::value_type terminator = u'\0') 34 String::value_type terminator = ABP_TEXT('\0'))
32 : mStr(str), mPos(pos), mEnd(str.length()), mTerminator(terminator) {} 35 : mStr(str), mPos(pos), mEnd(str.length()), mTerminator(terminator) {}
33 36
34 bool done() const 37 bool done() const
35 { 38 {
36 return mPos >= mEnd; 39 return mPos >= mEnd;
37 } 40 }
38 41
39 String::size_type position() const 42 String::size_type position() const
40 { 43 {
41 return mPos - 1; 44 return mPos - 1;
(...skipping 23 matching lines...) Expand all
65 return false; 68 return false;
66 } 69 }
67 70
68 bool skip(String::value_type ch) 71 bool skip(String::value_type ch)
69 { 72 {
70 bool skipped = false; 73 bool skipped = false;
71 while ((skipped = skipOne(ch))); 74 while ((skipped = skipOne(ch)));
72 return skipped; 75 return skipped;
73 } 76 }
74 }; 77 };
78
79 ABP_NS_END
LEFTRIGHT

Powered by Google App Engine
This is Rietveld