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

Unified Diff: tools/json_schema_compiler/h_generator.py

Issue 10022005: Let json schema compiler handle using arrays as types (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Small style changes 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 5ae50bc0c0c36e5faec00c78b7fce2ed29e9f8df..dd07f4f637f9f82acc4bb649d65fa331673f71de 100644
--- a/tools/json_schema_compiler/h_generator.py
+++ b/tools/json_schema_compiler/h_generator.py
@@ -160,6 +160,13 @@ class HGenerator(object):
.Append()
)
c.Eblock('}')
+ elif type_.type_ == PropertyType.ARRAY:
+ if type_.description:
+ c.Comment(type_.description)
+ c.Append('typedef std::vector<%(item_type)s> %(classname)s;')
+ c.Substitute({'classname': classname, 'item_type':
+ self._cpp_type_generator.GetType(type_.item_type,
+ wrap_optional=True)})
else:
if type_.description:
c.Comment(type_.description)

Powered by Google App Engine
This is Rietveld 408576698