Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: tools/json_schema_compiler/h_generator.py

Issue 10796114: Added ToJson to JSON schema compiler. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/json_schema_compiler/h_generator.py
diff --git a/tools/json_schema_compiler/h_generator.py b/tools/json_schema_compiler/h_generator.py
index ba7c5ca133a27b4a4ebc5e87089b5a77071a143c..8aed0aa626a6d17f0d09b7ae64b5a551b853832f 100644
--- a/tools/json_schema_compiler/h_generator.py
+++ b/tools/json_schema_compiler/h_generator.py
@@ -35,6 +35,7 @@ class HGenerator(object):
.Append('#include <vector>')
.Append()
.Append('#include "base/basictypes.h"')
+ .Append('#include "base/json/json_writer.h"')
not at google - send to devlin 2012/07/24 23:04:29 this should go in the cc file not the header file.
mitchellwrosen 2012/07/25 17:08:20 Done.
.Append('#include "base/logging.h"')
.Append('#include "base/memory/linked_ptr.h"')
.Append('#include "base/memory/scoped_ptr.h"')
@@ -340,6 +341,8 @@ class HGenerator(object):
param, self._cpp_type_generator.GetType(param)))
c.Append('scoped_ptr<base::ListValue> Create(%s);' %
', '.join(declaration_list))
+ c.Append('scoped_ptr<std::string> ToJson(%s);' %
not at google - send to devlin 2012/07/24 23:04:29 ditto, only return std::string, and only generate
mitchellwrosen 2012/07/25 17:08:20 Done.
+ ', '.join(declaration_list))
return c
def _GenerateFunctionResults(self, callback):
« tools/json_schema_compiler/cc_generator.py ('K') | « tools/json_schema_compiler/cc_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698