| 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 #include "generator.h" | 18 #include "generator.h" |
| 19 | 19 |
| 20 #include <cstdio> | 20 #include <cstdio> |
| 21 | 21 |
| 22 namespace | 22 namespace |
| 23 { | 23 { |
| 24 std::vector<bindings_internal::ClassInfo> classes; | 24 std::vector<bindings_internal::ClassInfo> classes; |
| 25 std::vector<bindings_internal::CustomGenerator> customGenerators; | |
| 26 } | 25 } |
| 27 | 26 |
| 28 namespace bindings_internal | 27 namespace bindings_internal |
| 29 { | 28 { |
| 30 FunctionInfo::FunctionInfo() | 29 FunctionInfo::FunctionInfo() |
| 31 { | 30 { |
| 32 name[0] = '\0'; | 31 name[0] = '\0'; |
| 33 } | 32 } |
| 34 | 33 |
| 35 FunctionInfo::FunctionInfo(TypeCategory returnType, TYPEID pointerType, | 34 FunctionInfo::FunctionInfo(TypeCategory returnType, TYPEID pointerType, |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 } | 483 } |
| 485 } | 484 } |
| 486 } | 485 } |
| 487 | 486 |
| 488 void printBindings() | 487 void printBindings() |
| 489 { | 488 { |
| 490 bindings_internal::printHelpers(); | 489 bindings_internal::printHelpers(); |
| 491 | 490 |
| 492 for (const auto& item : classes) | 491 for (const auto& item : classes) |
| 493 bindings_internal::printClass(item); | 492 bindings_internal::printClass(item); |
| 494 | |
| 495 for (const auto& item : customGenerators) | |
| 496 item(); | |
| 497 } | 493 } |
| 498 | |
| 499 void custom_generator(bindings_internal::CustomGenerator generator) | |
| 500 { | |
| 501 customGenerators.push_back(generator); | |
| 502 } | |
| LEFT | RIGHT |