Lines Matching defs:Enum
80 class Enum(object):
81 """Holds information about a protobuf enum.
84 name: The name of the enum.
85 values: A list of enum value names.
89 """Initializes a Enum instance.
92 name: The protobuf enum name.
98 """Adds a new value to the enum.
117 enums: A list of Enum objects; one for each enum in the proto.
129 enum_re = re.compile(r'enum\s+(\w+)\s*{')
159 # Look for an enum definition.
162 current_enum = Enum(match.group(1))
164 # Look for an enum value.
283 def GenerateEnumPrinter(enum, header_file, impl_file):
284 """Generates and prints a function to print an enum value.
287 enum: An Enum instance.
293 std::string GetProtoDebugString(%(name)s value);""" % {'name': enum.name}
300 """ % {'name': enum.name}
312 for value_name in enum.values:
407 for enum in enums:
408 GenerateEnumPrinter(enum, header_file, impl_file)