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

Unified Diff: tools/json_schema_compiler/h_generator.py

Issue 10206034: JSON schema compiler can't handle strings as types (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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 35e82480649a605dd6da518822dba4d1611a6e30..9ce2868d3843ec5785ac536a9af7ab47daddbe13 100644
--- a/tools/json_schema_compiler/h_generator.py
+++ b/tools/json_schema_compiler/h_generator.py
@@ -179,6 +179,11 @@ class HGenerator(object):
c.Substitute({'classname': classname, 'item_type':
self._cpp_type_generator.GetType(type_.item_type,
wrap_optional=True)})
+ elif type_.type_ == PropertyType.STRING:
+ if type_.description:
+ c.Comment(type_.description)
+ c.Append('typedef std::string %(classname)s;')
+ c.Substitute({'classname': classname})
else:
if type_.description:
c.Comment(type_.description)

Powered by Google App Engine
This is Rietveld 408576698