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

Delta Between Two Patch Sets: compiled/StringScanner.h

Issue 29630576: Issue 5146 - Part 2: Process http response in C++ (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Rebased Created Dec. 5, 2017, 6:09 p.m.
Right Patch Set: Rebased Created Aug. 14, 2018, 12:45 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 | « no previous file | 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 <cwctype> 20 #include <cwctype>
21 21
22 #include "base.h"
23
22 #include "String.h" 24 #include "String.h"
25
26 ABP_NS_BEGIN
23 27
24 class StringScanner 28 class StringScanner
25 { 29 {
26 private: 30 private:
27 const DependentString mStr; 31 const DependentString mStr;
28 String::size_type mPos; 32 String::size_type mPos;
29 String::size_type mEnd; 33 String::size_type mEnd;
30 String::value_type mTerminator; 34 String::value_type mTerminator;
31 public: 35 public:
32 explicit StringScanner(const String& str, String::size_type pos = 0, 36 explicit StringScanner(const String& str, String::size_type pos = 0,
33 String::value_type terminator = u'\0') 37 String::value_type terminator = ABP_TEXT('\0'))
34 : mStr(str), mPos(pos), mEnd(str.length()), mTerminator(terminator) {} 38 : mStr(str), mPos(pos), mEnd(str.length()), mTerminator(terminator) {}
35 39
36 bool done() const 40 bool done() const
37 { 41 {
38 return mPos >= mEnd; 42 return mPos >= mEnd;
39 } 43 }
40 44
41 String::size_type position() const 45 String::size_type position() const
42 { 46 {
43 return mPos - 1; 47 return mPos - 1;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return false; 101 return false;
98 } 102 }
99 103
100 bool skip(String::value_type ch) 104 bool skip(String::value_type ch)
101 { 105 {
102 bool skipped = false; 106 bool skipped = false;
103 while ((skipped = skipOne(ch))); 107 while ((skipped = skipOne(ch)));
104 return skipped; 108 return skipped;
105 } 109 }
106 }; 110 };
111
112 ABP_NS_END
LEFTRIGHT

Powered by Google App Engine
This is Rietveld