| 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 c64241cd62d6d66b46230ee62cf84867f0432e08..3f7584d55d5e738574b99960a5b82fd3ef792e19 100644
|
| --- a/tools/json_schema_compiler/h_generator.py
|
| +++ b/tools/json_schema_compiler/h_generator.py
|
| @@ -141,13 +141,17 @@ class _Generator(object):
|
| """Generate a code object with the declaration of a C++ enum.
|
| """
|
| c = Code()
|
| - c.Sblock('enum %s {' % enum_name)
|
| - c.Append(self._type_helper.GetEnumNoneValue(type_) + ',')
|
| + c.Sblock('enum %s%s {' % ('class ' if type_.is_enum_class else '',
|
| + enum_name))
|
| + c.Append(self._type_helper.GetEnumNoneValue(
|
| + type_, is_in_declaration=True) + ',')
|
| for value in type_.enum_values:
|
| - current_enum_string = self._type_helper.GetEnumValue(type_, value)
|
| + current_enum_string = self._type_helper.GetEnumValue(
|
| + type_, value, is_in_declaration=True)
|
| c.Append(current_enum_string + ',')
|
| c.Append('%s = %s,' % (
|
| - self._type_helper.GetEnumLastValue(type_), current_enum_string))
|
| + self._type_helper.GetEnumLastValue(type_, is_in_declaration=True),
|
| + current_enum_string))
|
| c.Eblock('};')
|
| return c
|
|
|
|
|