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

Side by Side Diff: compiled/CommentFilter.cpp

Issue 29333474: Issue 4125 - [emscripten] Convert filter classes to C++ (Closed)
Patch Set: Fixed some bugs and exposed/tested more properties Created Jan. 15, 2016, 3:40 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
OLDNEW
(Empty)
1 #include "CommentFilter.h"
2
3 CommentFilter::CommentFilter(const std::u16string& text)
4 : Filter(text)
5 {
6 }
7
8 Filter::Type CommentFilter::Parse(const std::u16string& text)
9 {
10 if (text.length() && text[0] == u'!')
11 return Type::COMMENT;
12 else
13 return Type::UNKNOWN;
14 }
15
16 CommentFilter* CommentFilter::Create(const std::u16string& text)
17 {
18 Type type = Parse(text);
19 if (type == Type::UNKNOWN)
Felix Dahlke 2016/01/15 17:00:35 IMHO it'd make more sense to check for type != Typ
Wladimir Palant 2016/01/15 20:36:15 Done.
20 return nullptr;
21 else
22 return new CommentFilter(text);
23 }
24
25 Filter::Type CommentFilter::get_type()
26 {
27 return Type::COMMENT;
28 }
OLDNEW

Powered by Google App Engine
This is Rietveld