LEFT | RIGHT |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 void SetProperty(const std::string& name, const JsValue& value); | 103 void SetProperty(const std::string& name, const JsValue& value); |
104 inline void SetProperty(const std::string& name, const char* val) | 104 inline void SetProperty(const std::string& name, const char* val) |
105 { | 105 { |
106 SetProperty(name, std::string(val)); | 106 SetProperty(name, std::string(val)); |
107 } | 107 } |
108 inline void SetProperty(const std::string& name, int val) | 108 inline void SetProperty(const std::string& name, int val) |
109 { | 109 { |
110 SetProperty(name, static_cast<int64_t>(val)); | 110 SetProperty(name, static_cast<int64_t>(val)); |
111 } | 111 } |
112 //@} | 112 //@} |
| 113 /** |
| 114 * Sets a property value string if this is an object (see `IsObject()`). |
| 115 * @param name Property name. |
| 116 * @param val Property value as a StringBuffer. |
| 117 */ |
| 118 void SetStringBufferProperty(const std::string& name, const StringBuffer& va
l); |
113 | 119 |
114 /** | 120 /** |
115 * Returns the value's class name, e.g.\ _Array_ for arrays | 121 * Returns the value's class name, e.g.\ _Array_ for arrays |
116 * (see `IsArray()`). | 122 * (see `IsArray()`). |
117 * Technically, this is the name of the function that was used as a | 123 * Technically, this is the name of the function that was used as a |
118 * constructor. | 124 * constructor. |
119 * @return Class name of the value. | 125 * @return Class name of the value. |
120 */ | 126 */ |
121 std::string GetClass() const; | 127 std::string GetClass() const; |
122 | 128 |
(...skipping 30 matching lines...) Expand all Loading... |
153 | 159 |
154 // Parameter args is not const because a pointer to its internal arrays is | 160 // Parameter args is not const because a pointer to its internal arrays is |
155 // passed to v8::Function::Call but the latter does not expect a const point
er. | 161 // passed to v8::Function::Call but the latter does not expect a const point
er. |
156 JsValue Call(std::vector<v8::Local<v8::Value>>& args, v8::Local<v8::Object>
thisObj) const; | 162 JsValue Call(std::vector<v8::Local<v8::Value>>& args, v8::Local<v8::Object>
thisObj) const; |
157 | 163 |
158 std::unique_ptr<v8::Global<v8::Value>> value; | 164 std::unique_ptr<v8::Global<v8::Value>> value; |
159 }; | 165 }; |
160 } | 166 } |
161 | 167 |
162 #endif | 168 #endif |
LEFT | RIGHT |