Index: src/FilterEngine.cpp |
=================================================================== |
--- a/src/FilterEngine.cpp |
+++ b/src/FilterEngine.cpp |
@@ -277,3 +277,20 @@ |
std::string error(params.size() >= 1 && !params[0]->IsNull() ? params[0]->AsString() : ""); |
callback(error); |
} |
+ |
+std::string FilterEngine::GetRequire(std::string requireName) |
+{ |
+ JsValuePtr func = jsEngine->Evaluate("API.getRequire"); |
+ JsValueList params; |
+ params.push_back(jsEngine->NewValue(requireName)); |
+ JsValuePtr requireContent = func->Call(params); |
+ |
+ if (requireContent->IsString()) |
+ { |
+ return requireContent->AsString(); |
+ } |
+ else |
+ { |
+ return ""; |
+ } |
+} |