Index: src/JsValue.cpp |
=================================================================== |
--- a/src/JsValue.cpp |
+++ b/src/JsValue.cpp |
@@ -122,16 +122,22 @@ |
} |
std::string AdblockPlus::JsValue::AsString() const |
{ |
const JsContext context(*jsEngine); |
return Utils::FromV8String(UnwrapValue()); |
} |
+StringBuffer AdblockPlus::JsValue::AsStringBuffer() const |
+{ |
+ const JsContext context(*jsEngine); |
+ return Utils::StringBufferFromV8String(UnwrapValue()); |
+} |
+ |
int64_t AdblockPlus::JsValue::AsInt() const |
{ |
const JsContext context(*jsEngine); |
return UnwrapValue()->IntegerValue(); |
} |
bool AdblockPlus::JsValue::AsBool() const |
{ |
@@ -198,16 +204,22 @@ |
} |
void AdblockPlus::JsValue::SetProperty(const std::string& name, const std::string& val) |
{ |
const JsContext context(*jsEngine); |
SetProperty(name, Utils::ToV8String(jsEngine->GetIsolate(), val)); |
} |
+void AdblockPlus::JsValue::SetStringBufferProperty(const std::string& name, const StringBuffer& val) |
+{ |
+ const JsContext context(*jsEngine); |
+ SetProperty(name, Utils::StringBufferToV8String(jsEngine->GetIsolate(), val)); |
+} |
+ |
void AdblockPlus::JsValue::SetProperty(const std::string& name, int64_t val) |
{ |
const JsContext context(*jsEngine); |
SetProperty(name, v8::Number::New(jsEngine->GetIsolate(), val)); |
} |
void AdblockPlus::JsValue::SetProperty(const std::string& name, const JsValue& val) |
{ |