tools/json_schema_compiler/h_generator.py
def _GenerateEnumDeclaration(self, enum_name, type_):
    """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_) + ',')
    for value in type_.enum_values:
      current_enum_string = self._type_helper.GetEnumValue(type_, value)
      c.Append(current_enum_string + ',')
    c.Append('%s = %s,' % (
        self._type_helper.GetEnumLastValue(type_), current_enum_string))
    c.Eblock('};')
    return c
Generate a code object with the  declaration of a C++ enum.
    
Generate a code object with the  declaration of a C++ enum.
Generate a code object with the declaration of a C ++ enum .
def _GenerateEnumDeclaration(self, enum_name, type_):
    c = Code()
    c.Sblock('enum %s {' % enum_name)
    c.Append(self._type_helper.GetEnumNoneValue(type_) + ',')
    for value in type_.enum_values:
      current_enum_string = self._type_helper.GetEnumValue(type_, value)
      c.Append(current_enum_string + ',')
    c.Append('%s = %s,' % (
        self._type_helper.GetEnumLastValue(type_), current_enum_string))
    c.Eblock('};')
    return c
def _GenerateEnumDeclaration ( self , enum_name , type_ ) : c = Code ( ) c . Sblock ( 'enum %s {' % enum_name ) c . Append ( self . _type_helper . GetEnumNoneValue ( type_ ) + ',' ) for value in type_ . enum_values : current_enum_string = self . _type_helper . GetEnumValue ( type_ , value ) c . Append ( current_enum_string + ',' ) c . Append ( '%s = %s,' % ( self . _type_helper . GetEnumLastValue ( type_ ) , current_enum_string ) ) c . Eblock ( '};' ) return c
Generate a code object with the  declaration of a C++ enum.
Generate a code object with the declaration of a C ++ enum .
"""Generate a code object with the  declaration of a C++ enum.
    """
self
enum_name
type_