Index: compiled/CommentFilter.cpp |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/compiled/CommentFilter.cpp |
@@ -0,0 +1,36 @@ |
+#include <emscripten/bind.h> |
+ |
+#include "CommentFilter.h" |
+ |
+CommentFilter::CommentFilter(const std::wstring& text) |
+ : Filter(text) |
+{ |
+} |
+ |
+Filter::Type CommentFilter::Parse(const std::wstring& text) |
+{ |
+ if (text.length() && text[0] == L'!') |
+ return Type::COMMENT; |
+ else |
+ return Type::UNKNOWN; |
+} |
+ |
+CommentFilter* CommentFilter::Create(const std::wstring& text) |
+{ |
+ Type type = Parse(text); |
+ if (type == Type::COMMENT) |
+ return new CommentFilter(text); |
+ else |
+ return nullptr; |
+} |
+ |
+Filter::Type CommentFilter::GetType() const |
+{ |
+ return Type::COMMENT; |
+} |
+ |
+EMSCRIPTEN_BINDINGS(commentfilter) |
+{ |
+ using namespace emscripten; |
+ class_<CommentFilter,base<Filter>>("CommentFilter"); |
+} |