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: Using embind Created Jan. 15, 2016, 8:44 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/CommentFilter.h ('k') | compiled/ElemHideBase.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 #include <emscripten/bind.h>
2
3 #include "CommentFilter.h"
4
5 CommentFilter::CommentFilter(const std::wstring& text)
6 : Filter(text)
7 {
8 }
9
10 Filter::Type CommentFilter::Parse(const std::wstring& text)
11 {
12 if (text.length() && text[0] == L'!')
13 return Type::COMMENT;
14 else
15 return Type::UNKNOWN;
16 }
17
18 CommentFilter* CommentFilter::Create(const std::wstring& text)
19 {
20 Type type = Parse(text);
21 if (type == Type::COMMENT)
22 return new CommentFilter(text);
23 else
24 return nullptr;
25 }
26
27 Filter::Type CommentFilter::GetType() const
28 {
29 return Type::COMMENT;
30 }
31
32 EMSCRIPTEN_BINDINGS(commentfilter)
33 {
34 using namespace emscripten;
35 class_<CommentFilter,base<Filter>>("CommentFilter");
36 }
OLDNEW
« no previous file with comments | « compiled/CommentFilter.h ('k') | compiled/ElemHideBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld