Index: tools/json_schema_compiler/cc_generator.py |
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py |
index 3e2a1be6eff997bf79b2dd5099e31adce192bc20..e39f6f5fd931ba5af58ee2a63717387d1a9814a7 100644 |
--- a/tools/json_schema_compiler/cc_generator.py |
+++ b/tools/json_schema_compiler/cc_generator.py |
@@ -148,8 +148,10 @@ class _Generator(object): |
real_t = self._type_helper.FollowRef(t) |
if real_t.property_type == PropertyType.ENUM: |
- items.append('%s(%s)' % ( |
+ items.append('%s(%s%s)' % ( |
prop.unix_name, |
+ ('%s::' % real_t.namespace.unix_name) if |
+ real_t.namespace != self._namespace else '', |
not at google - send to devlin
2015/04/03 17:04:38
So, the docserver code is all over the place when
Devlin
2015/04/03 19:38:51
Done.
|
self._type_helper.GetEnumNoneValue(t))) |
elif prop.optional: |
continue |
@@ -290,8 +292,10 @@ class _Generator(object): |
underlying_type = self._type_helper.FollowRef(prop.type_) |
if underlying_type.property_type == PropertyType.ENUM: |
(c.Append('} else {') |
- .Append('%%(dst)s->%%(name)s = %s;' % |
- self._type_helper.GetEnumNoneValue(prop.type_))) |
+ .Append('%%(dst)s->%%(name)s = %s%s;' % |
+ (('%s::' % underlying_type.namespace.unix_name) if |
not at google - send to devlin
2015/04/03 17:04:38
Ditto. This is even harder to dissect.
Devlin
2015/04/03 19:38:51
Done.
|
+ underlying_type.namespace != self._namespace else '', |
+ self._type_helper.GetEnumNoneValue(prop.type_)))) |
c.Eblock('}') |
else: |
(c.Sblock( |
@@ -1027,9 +1031,11 @@ class _Generator(object): |
underlying_type = self._type_helper.FollowRef(prop.type_) |
if (underlying_type.property_type == PropertyType.ENUM and |
prop.optional): |
- c.Append('%s->%s = %s;' % ( |
+ c.Append('%s->%s = %s%s;' % ( |
dst, |
prop.unix_name, |
+ ('%s::' % underlying_type.namespace.unix_name) if |
not at google - send to devlin
2015/04/03 17:04:38
Ditto.
Devlin
2015/04/03 19:38:51
Done.
|
+ underlying_type.namespace != self._namespace else '', |
self._type_helper.GetEnumNoneValue(prop.type_))) |
return c |