Lines Matching refs:enum_def
139 } else if (type.enum_def != nullptr) { in GetFullType()
140 if (type.enum_def->is_union) { in GetFullType()
320 const auto &enum_def = **it; in generate() local
321 if (enum_def.defined_namespace != ns) { continue; } in generate()
322 if (!enum_def.generated) { in generate()
323 SetNameSpace(enum_def.defined_namespace); in generate()
324 GenEnum(enum_def); in generate()
526 if (type.enum_def) { return WrapInNameSpace(*type.enum_def); } in GetTypeBasic()
573 std::string GetEnumValUse(const EnumDef &enum_def, in GetEnumValUse() argument
575 return Name(enum_def) + "::" + Name(enum_val); in GetEnumValUse()
582 void GenEnum(const EnumDef &enum_def) { in GenEnum() argument
583 code_.SetValue("ENUM_NAME", Name(enum_def)); in GenEnum()
584 code_.SetValue("BASE_TYPE", GetEnumTypeForDecl(enum_def.underlying_type)); in GenEnum()
586 GenComment(enum_def.doc_comment); in GenEnum()
590 code_ += "pub enum " + Name(enum_def) + " {"; in GenEnum()
594 for (auto it = enum_def.vals.vec.begin(); it != enum_def.vals.vec.end(); in GenEnum()
612 code_.SetValue("ENUM_NAME", Name(enum_def)); in GenEnum()
613 code_.SetValue("ENUM_NAME_SNAKE", MakeSnakeCase(Name(enum_def))); in GenEnum()
614 code_.SetValue("ENUM_NAME_CAPS", MakeUpper(MakeSnakeCase(Name(enum_def)))); in GenEnum()
658 auto num_fields = NumToString(enum_def.vals.vec.size()); in GenEnum()
662 for (auto it = enum_def.vals.vec.begin(); it != enum_def.vals.vec.end(); in GenEnum()
665 auto value = GetEnumValUse(enum_def, ev); in GenEnum()
666 auto suffix = *it != enum_def.vals.vec.back() ? "," : ""; in GenEnum()
677 enum_def.vals.vec.back()->value - enum_def.vals.vec.front()->value + 1; in GenEnum()
681 if (range / static_cast<int64_t>(enum_def.vals.vec.size()) < in GenEnum()
687 auto val = enum_def.vals.vec.front()->value; in GenEnum()
688 for (auto it = enum_def.vals.vec.begin(); it != enum_def.vals.vec.end(); in GenEnum()
692 auto suffix = *it != enum_def.vals.vec.back() ? "," : ""; in GenEnum()
702 if (enum_def.vals.vec.front()->value) { in GenEnum()
703 auto vals = GetEnumValUse(enum_def, *enum_def.vals.vec.front()); in GenEnum()
713 if (enum_def.is_union) { in GenEnum()
715 code_.SetValue("NAME", Name(enum_def)); in GenEnum()
716 code_.SetValue("UNION_OFFSET_NAME", Name(enum_def) + "UnionTableOffset"); in GenEnum()
740 auto ev = field.value.type.enum_def->ReverseLookup( in GetDefaultScalarValue()
743 return WrapInNameSpace(field.value.type.enum_def->defined_namespace, in GetDefaultScalarValue()
744 GetEnumValUse(*field.value.type.enum_def, *ev)); in GetDefaultScalarValue()
789 const auto typname = WrapInNameSpace(*type.enum_def); in TableBuilderArgsDefnType()
793 const auto typname = WrapInNameSpace(*type.enum_def); in TableBuilderArgsDefnType()
808 const auto typname = WrapInNameSpace(*type.enum_def); in TableBuilderArgsDefnType()
829 const auto typname = WrapInNameSpace(*type.enum_def) + \ in TableBuilderArgsDefnType()
885 const auto typname = WrapInNameSpace(*type.enum_def); in TableBuilderArgsAddFuncType()
890 const auto typname = WrapInNameSpace(*type.enum_def); in TableBuilderArgsAddFuncType()
896 const auto typname = WrapInNameSpace(*type.enum_def); in TableBuilderArgsAddFuncType()
919 const auto typname = WrapInNameSpace(*type.enum_def); in TableBuilderArgsAddFuncType()
923 const auto typname = WrapInNameSpace(*type.enum_def); in TableBuilderArgsAddFuncType()
999 const auto typname = WrapInNameSpace(*type.enum_def); in GenTableAccessorFuncReturnType()
1021 const auto typname = WrapInNameSpace(*type.enum_def); in GenTableAccessorFuncReturnType()
1080 const auto typname = WrapInNameSpace(*type.enum_def); in GenTableAccessorFuncBody()
1108 const auto typname = WrapInNameSpace(*type.enum_def); in GenTableAccessorFuncBody()
1315 auto u = field.value.type.enum_def; in GenTable()