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 ba7c5ca133a27b4a4ebc5e87089b5a77071a143c..67f1d264b01c99c9d80ca862c276fe02d4cc87dc 100644 |
--- a/tools/json_schema_compiler/h_generator.py |
+++ b/tools/json_schema_compiler/h_generator.py |
@@ -156,11 +156,17 @@ class HGenerator(object): |
c.Append() |
for prop in self._cpp_type_generator.ExpandParams(props): |
- if prop.description: |
+ if prop.type_ == PropertyType.FUNCTION and prop.optional: |
+ c.Comment('Determines whether the given optional function was passed ' |
+ 'as a parameter.') |
not at google - send to devlin
2012/07/25 01:32:33
include the function name here, and include the ov
chebert
2012/07/25 18:38:30
Done.
|
+ elif prop.description: |
c.Comment(prop.description) |
- c.Append('%s %s;' % ( |
- self._cpp_type_generator.GetType(prop, wrap_optional=True), |
- prop.unix_name)) |
+ if prop.type_ == PropertyType.FUNCTION: |
+ c.Append('bool has_%s;' % prop.unix_name) |
not at google - send to devlin
2012/07/25 01:32:33
i think you only want this if it's optional too.
chebert
2012/07/25 18:38:30
Done.
|
+ else: |
+ c.Append('%s %s;' % ( |
+ self._cpp_type_generator.GetType(prop, wrap_optional=True), |
+ prop.unix_name)) |
c.Append() |
return c |