// Info for Enum.
518507
func (e *Enum) Info() DefinitionInfo {
	return DefinitionInfo{Name: e.Name, Line: e.Line}
}
496
func (e *EnumDescriptor) prefix() string {
	typeName := e.alias()
	if e.parent == nil {
		// If the enum is not part of a message, the prefix is just the type name.
		return CamelCase(typeName[len(typeName)-1]) + "_"
	}
	return CamelCaseSlice(typeName[0:len(typeName)-1]) + "_"
}
387003
func (c *Chunk) AppendEnum(colIdx int, enum types.Enum) {
	c.columns[colIdx].appendNameValue(enum.Name, enum.Value)
}
896816
func (f *FileDescriptor) GetEnum(name string) *EnumDescriptor {
	for _, e := range f.GetEnums() {
		if e.GetName() == name || e.GetLongName() == name {
			return e
		}
	}

	return nil
}
825310
func enumItemName(enumName string, spec *compile.EnumItem) (string, error) {
	name, err := goNameAnnotation(spec)
	if err != nil {
		return "", err
	}
	if name == "" {
		name = pascalCase(false, /* all caps */
			strings.Split(spec.ThriftName(), "_")...)
	}
	return enumName + name, err
}
857606
func SQLScanEnumString(obj interface{}, value interface{}, stringMapEnum map[string]interface{}) (err error) {
	if value == nil {
		return
	}

	pv, err := ensureScanValue(obj)
	if err != nil {
		return
	}

	var enumstr string
	switch value.(type) {
	case []byte:
		enumstr = string(value.([]byte))
	case string:
		enumstr = value.(string)
	default:
		return ErrorUnsupportedScanType1.New(nil, value)
	}

	enumval, ok := stringMapEnum[enumstr]
	if !ok {
		return ErrorNoValueFound1.New(nil, value)
	}
	ev := reflect.ValueOf(enumval)
	pv.Set(ev)
	return
}
252199
func findMessageByEnumName(s string) (*dotaMessage, bool) {
	for _, t := range messageTypes {
		if s == t.enumName {
			return t, true
		}
	}
	return nil, false
}
802841
func injectEnumValues(d starlark.StringDict, enum *descpb.EnumDescriptorProto) {
	for _, val := range enum.Value {
		d[val.GetName()] = starlark.MakeInt(int(val.GetNumber()))
	}
}
1128760
func (enum *GenericEnum) Set(symbol string) {
	if index, exists := enum.symbolsToIndex[symbol]; !exists {
		panic("Unknown enum symbol")
	} else {
		enum.index = index
	}
}
91016
func (e *Errors) Info(format string, a ...interface{}) error {
	return e.add(Info, format, a...)
}
96769
func MyEnumValues(db XODB, schema string, enum string) (*MyEnumValue, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`SUBSTRING(column_type, 6, CHAR_LENGTH(column_type) - 6) AS enum_values ` +
		`FROM information_schema.columns ` +
		`WHERE data_type = 'enum' AND table_schema = ? AND column_name = ?`

	// run query
	XOLog(sqlstr, schema, enum)
	var mev MyEnumValue
	err = db.QueryRow(sqlstr, schema, enum).Scan(&mev.EnumValues)
	if err != nil {
		return nil, err
	}

	return &mev, nil
}
273566
func (self *EnumTypeDef) Init() *EnumTypeDef {
	if self.Elements == nil {
		self.Elements = make([]*EnumElementDef, 0)
	}
	return self
}
594478
func (self *EnumTypeDef) UnmarshalJSON(b []byte) error {
	var m rawEnumTypeDef
	err := json.Unmarshal(b, &m)
	if err == nil {
		o := EnumTypeDef(m)
		*self = *((&o).Init())
		err = self.Validate()
	}
	return err
}
321322
func (t *Typedef) Info() DefinitionInfo {
	return DefinitionInfo{Name: t.Name, Line: t.Line}
}
752303
func (_m *API) Info(ctx context.Context) (*types.Info, error) {
	ret := _m.Called(ctx)

	var r0 *types.Info
	if rf, ok := ret.Get(0).(func(context.Context) *types.Info); ok {
		r0 = rf(ctx)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*types.Info)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
		r1 = rf(ctx)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
789043
func ContextWithEnumDescriptor(ctx context.Context, d *EnumDescriptor) context.Context {
	return context.WithValue(ctx, enumContextKey, d)
}
491228
func (p *printer) EnumValue(v *descriptor.EnumValueDescriptorProto) {
	p.MaybeLeadingComments(v)
	p.Printf("%s = %d;\n", v.GetName(), v.GetNumber())
}