OLD | NEW |
(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 } |
OLD | NEW |