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

Delta Between Two Patch Sets: compiled/bindings/generator.cpp

Issue 29410617: Issue 5131 - [emscripten] Clean separation of bindings code and runtime code (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Left Patch Set: Rebased Created April 13, 2017, 1:08 p.m.
Right Patch Set: Rebased Created April 20, 2017, 1:49 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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
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 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld