Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include/AdblockPlus/JsValue.h

Issue 29449592: Issue 5183 - Provide async interface for FileSystem (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Rebased on https://codereview.adblockplus.org/29481704 Created July 6, 2017, 10:40 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/AdblockPlus/JsValue.h
===================================================================
--- a/include/AdblockPlus/JsValue.h
+++ b/include/AdblockPlus/JsValue.h
@@ -18,31 +18,35 @@
#ifndef ADBLOCK_PLUS_JS_VALUE_H
#define ADBLOCK_PLUS_JS_VALUE_H
#include <stdint.h>
#include <string>
#include <vector>
#include <memory>
+#include <AdblockPlus/IFileSystem.h>
+
namespace v8
{
class Value;
class Object;
template<class T> class Local;
template<class T> class Global;
}
namespace AdblockPlus
{
class JsValue;
class JsEngine;
typedef std::shared_ptr<JsEngine> JsEnginePtr;
+ typedef IFileSystem::IOBuffer StringBuffer;
+
/**
* List of JavaScript values.
*/
typedef std::vector<AdblockPlus::JsValue> JsValueList;
/**
* Wrapper for JavaScript values.
* See `JsEngine` for creating `JsValue` objects.
@@ -62,16 +66,17 @@
bool IsNull() const;
bool IsString() const;
bool IsNumber() const;
bool IsBool() const;
bool IsObject() const;
bool IsArray() const;
bool IsFunction() const;
std::string AsString() const;
+ StringBuffer AsStringBuffer() const;
int64_t AsInt() const;
bool AsBool() const;
JsValueList AsList() const;
/**
* Returns a list of property names if this is an object (see `IsObject()`).
* @return List of property names.
*/
@@ -87,16 +92,17 @@
//@{
/**
* Sets a property value if this is an object (see `IsObject()`).
* @param name Property name.
* @param val Property value.
*/
void SetProperty(const std::string& name, const std::string& val);
+ void SetProperty(const std::string& name, const StringBuffer& val);
void SetProperty(const std::string& name, int64_t val);
void SetProperty(const std::string& name, bool val);
void SetProperty(const std::string& name, const JsValue& value);
inline void SetProperty(const std::string& name, const char* val)
{
SetProperty(name, std::string(val));
}
inline void SetProperty(const std::string& name, int val)
« no previous file with comments | « include/AdblockPlus/JsEngine.h ('k') | libadblockplus.gyp » ('j') | src/DefaultFileSystem.cpp » ('J')

Powered by Google App Engine
This is Rietveld