summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler/util_cc_helper.py
diff options
context:
space:
mode:
authorkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-17 06:50:31 +0000
committerkalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-17 06:50:31 +0000
commit242d5e7aaf2658a88f1ed4954e34876d7082f1a7 (patch)
tree677cff28f304753c8e9f1d1e9062a9b2de871a77 /tools/json_schema_compiler/util_cc_helper.py
parent3543975945a5667aa3fb48c6d0e1b6312d1ed293 (diff)
downloadchromium_src-242d5e7aaf2658a88f1ed4954e34876d7082f1a7.zip
chromium_src-242d5e7aaf2658a88f1ed4954e34876d7082f1a7.tar.gz
chromium_src-242d5e7aaf2658a88f1ed4954e34876d7082f1a7.tar.bz2
Overhaul JSON Schema Compiler to support a number of features required to
support the full range of JSON/IDL features, improve the interface of generated code, and improve generated code formatting, notably: * Make "choices" generate a struct containing each possible type, rather than multiple fields with different names plus and enum. This makes it possible to embed choices inside containers - notably within arrays (as in bug). It also improves optional choices detection. * Remove the Any C++ type generated by "any", and model it as a base::Value. * Make "additionalProperties" generated a std::map with the actual types as values, rather than just a DictionaryValue forcing callers to extract types. * Fix enum naming, it was unnecessarily including the namespace as a prefix. R=yoz@chromium.org BUG=162044 Review URL: https://codereview.chromium.org/11827026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/json_schema_compiler/util_cc_helper.py')
-rw-r--r--tools/json_schema_compiler/util_cc_helper.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/json_schema_compiler/util_cc_helper.py b/tools/json_schema_compiler/util_cc_helper.py
index bf089dd..8d490ba 100644
--- a/tools/json_schema_compiler/util_cc_helper.py
+++ b/tools/json_schema_compiler/util_cc_helper.py
@@ -25,7 +25,7 @@ class UtilCCHelper(object):
'dst': dst,
}
- sub['type'] = self._type_manager.GetType(prop)
+ sub['type'] = self._type_manager.GetCppType(prop),
if array_prop.optional:
val = ('%(namespace)s::PopulateOptionalArrayFromDictionary'
'(*%(src)s, "%(name)s", &%(dst)s)')
@@ -46,7 +46,7 @@ class UtilCCHelper(object):
'namespace': API_UTIL_NAMESPACE,
'src': src,
'dst': dst,
- 'type': self._type_manager.GetType(prop),
+ 'type': self._type_manager.GetCppType(prop),
}
if optional:
@@ -65,7 +65,7 @@ class UtilCCHelper(object):
sub = {
'namespace': API_UTIL_NAMESPACE,
'src': src,
- 'type': self._type_manager.GetType(prop),
+ 'type': self._type_manager.GetCppType(prop),
}
if optional: