Left: | ||
Right: |
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 void register_property(TYPEID classID, const char* name, | 199 void register_property(TYPEID classID, const char* name, |
200 const FunctionInfo& getter, const FunctionInfo& setter, | 200 const FunctionInfo& getter, const FunctionInfo& setter, |
201 const char* jsValue = ""); | 201 const char* jsValue = ""); |
202 | 202 |
203 void register_method(TYPEID classID, const char* name, | 203 void register_method(TYPEID classID, const char* name, |
204 const FunctionInfo& call); | 204 const FunctionInfo& call); |
205 | 205 |
206 void register_differentiator(TYPEID classID, size_t offset, | 206 void register_differentiator(TYPEID classID, size_t offset, |
207 std::vector<std::pair<int, std::string>>& mapping); | 207 std::vector<std::pair<int, std::string>>& mapping); |
208 | 208 |
209 const std::string generateCall(const FunctionInfo& call, | 209 std::string generateCall(const FunctionInfo& call, |
210 std::vector<std::string>& params); | 210 std::vector<std::string>& params); |
211 | 211 |
212 const std::string wrapCall(const FunctionInfo& call, bool isFunction = true); | 212 std::string wrapCall(const FunctionInfo& call, bool isFunction = true); |
hub
2017/04/25 18:24:58
since we return a copy, do we really need the "con
Wladimir Palant
2017/04/26 05:52:55
The "const" modifier in C++ is really weird. Hey,
| |
213 | |
214 std::string generatePropertyDescriptor(const PropertyInfo& property); | |
215 | 213 |
216 void printHelpers(); | 214 void printHelpers(); |
217 | 215 |
218 void printClass(const ClassInfo& cls); | 216 void printClass(const ClassInfo& cls); |
219 } | 217 } |
220 | 218 |
221 template<typename ClassType, | 219 template<typename ClassType, |
222 typename BaseClass = bindings_internal::NoBaseClass, | 220 typename BaseClass = bindings_internal::NoBaseClass, |
223 typename std::enable_if<std::is_base_of<ref_counted, ClassType>::value>::typ e* = nullptr> | 221 typename std::enable_if<std::is_base_of<ref_counted, ClassType>::value>::typ e* = nullptr> |
224 class class_ | 222 class class_ |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 for (const auto& item : list) | 291 for (const auto& item : list) |
294 mapping.emplace_back(item.first, item.second); | 292 mapping.emplace_back(item.first, item.second); |
295 | 293 |
296 bindings_internal::register_differentiator( | 294 bindings_internal::register_differentiator( |
297 bindings_internal::TypeInfo<ClassType>(), offset, mapping); | 295 bindings_internal::TypeInfo<ClassType>(), offset, mapping); |
298 return *this; | 296 return *this; |
299 } | 297 } |
300 }; | 298 }; |
301 | 299 |
302 void printBindings(); | 300 void printBindings(); |
LEFT | RIGHT |