Index: tools/json_schema_compiler/cpp_util.py |
diff --git a/tools/json_schema_compiler/cpp_util.py b/tools/json_schema_compiler/cpp_util.py |
index 83d526526105fb9aa166e6e90d6b9034622d5035..488261d1a8ce9b135791a4a6f597bc3142e78fb0 100644 |
--- a/tools/json_schema_compiler/cpp_util.py |
+++ b/tools/json_schema_compiler/cpp_util.py |
@@ -54,33 +54,8 @@ def GetValueType(prop): |
PropertyType.ARRAY: 'Value::TYPE_LIST' |
}[prop.type_] |
- |
-def CreateValueFromSingleProperty(prop, var): |
- """Creates a Value given a single property. Use for everything except |
- PropertyType.ARRAY. |
- |
- var: variable or variable* |
- """ |
- if prop.type_ in (PropertyType.REF, PropertyType.OBJECT): |
- if prop.optional: |
- return '%s->ToValue().release()' % var |
- else: |
- return '%s.ToValue().release()' % var |
- elif prop.type_.is_fundamental: |
- if prop.optional: |
- var = '*' + var |
- return { |
- PropertyType.STRING: 'Value::CreateStringValue(%s)', |
- PropertyType.BOOLEAN: 'Value::CreateBooleanValue(%s)', |
- PropertyType.INTEGER: 'Value::CreateIntegerValue(%s)', |
- PropertyType.DOUBLE: 'Value::CreateDoubleValue(%s)', |
- }[prop.type_] % var |
- else: |
- raise NotImplementedError('Conversion of single %s to Value not implemented' |
- % repr(prop.type_)) |
- |
def GetParameterDeclaration(param, type_): |
- """Gets a const parameter declaration of a given model.Property and its C++ |
+ """Gets a parameter declaration of a given model.Property and its C++ |
type. |
""" |
if param.type_ in (PropertyType.REF, PropertyType.OBJECT, PropertyType.ARRAY, |