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

Side by Side Diff: compiled/StringScanner.h

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Patch Set: Almost complete implementation, missing CSS property filters Created Jan. 20, 2016, 12:04 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « compiled/RegExpFilter.cpp ('k') | compiled/WhiteListFilter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef ADBLOCK_PLUS_STRING_SCANNER_H
2 #define ADBLOCK_PLUS_STRING_SCANNER_H
3
4 #include <string>
5
6 class StringScanner
7 {
8 private:
9 const std::u16string str;
10 size_t pos;
11 size_t end;
12 public:
13 StringScanner(const std::u16string& str) : str(str), pos(0), end(str.length()) {}
14
15 bool done()
16 {
17 return pos >= end;
18 }
19
20 size_t position()
21 {
22 return pos - 1;
23 }
24
25 char16_t next()
26 {
27 return done() ? u'\0' : str[pos++];
28 }
29 };
30
31 #endif
OLDNEW
« no previous file with comments | « compiled/RegExpFilter.cpp ('k') | compiled/WhiteListFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld