summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler/h_generator.py
diff options
context:
space:
mode:
authorcduvall@chromium.org <cduvall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-01 03:58:06 +0000
committercduvall@chromium.org <cduvall@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-01 03:58:06 +0000
commit0ef7f5a1c14f3378567e942715c442267dab4901 (patch)
tree7209092892f3868ad7930dc5d93491682be98131 /tools/json_schema_compiler/h_generator.py
parent8011b8f5dd6a4f289de28b8d7045f8a981723cb7 (diff)
downloadchromium_src-0ef7f5a1c14f3378567e942715c442267dab4901.zip
chromium_src-0ef7f5a1c14f3378567e942715c442267dab4901.tar.gz
chromium_src-0ef7f5a1c14f3378567e942715c442267dab4901.tar.bz2
JSON schema compiler can't handle strings as types
JSON schema compiler now supports having strings as types. Similar to http://crbug.com/122075 BUG=124771 TEST=cpp_type_generator_test.py Review URL: http://codereview.chromium.org/10206034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134674 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/json_schema_compiler/h_generator.py')
-rw-r--r--tools/json_schema_compiler/h_generator.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/json_schema_compiler/h_generator.py b/tools/json_schema_compiler/h_generator.py
index 35e8248..9ce2868 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)