Home
last modified time | relevance | path

Searched refs:enum_def (Results 1 – 21 of 21) sorted by relevance

/third_party/flatbuffers/src/
Didl_gen_cpp.cpp383 const auto &enum_def = **it; in generate() local
384 if (!enum_def.generated) { in generate()
385 SetNameSpace(enum_def.defined_namespace); in generate()
386 GenEnum(enum_def); in generate()
419 const auto &enum_def = **it; in generate() local
420 if (enum_def.is_union && !enum_def.generated) { in generate()
421 SetNameSpace(enum_def.defined_namespace); in generate()
422 GenUnionPost(enum_def); in generate()
431 const auto &enum_def = **it; in generate() local
432 if (!enum_def.generated) { in generate()
[all …]
Didl_gen_fbs.cpp33 if (type.enum_def && !underlying) { in GenType()
34 return type.enum_def->defined_namespace->GetFullyQualifiedName( in GenType()
35 type.enum_def->name); in GenType()
101 EnumDef &enum_def = **enum_def_it; in GenerateFBS() local
102 if (parser.opts.include_dependence_headers && enum_def.generated) { in GenerateFBS()
105 GenNameSpace(*enum_def.defined_namespace, &schema, &last_namespace); in GenerateFBS()
106 GenComment(enum_def.doc_comment, &schema, nullptr); in GenerateFBS()
107 if (enum_def.is_union) in GenerateFBS()
108 schema += "union " + enum_def.name; in GenerateFBS()
110 schema += "enum " + enum_def.name + " : "; in GenerateFBS()
[all …]
Didl_gen_go.cpp149 std::string GetEnumTypeName(const EnumDef &enum_def) { in GetEnumTypeName() argument
150 return WrapInNameSpaceAndTrack(enum_def.defined_namespace, in GetEnumTypeName()
151 GoIdentity(enum_def.name)); in GetEnumTypeName()
155 void GenEnumType(const EnumDef &enum_def, std::string *code_ptr) { in GenEnumType() argument
157 code += "type " + GetEnumTypeName(enum_def) + " "; in GenEnumType()
158 code += GenTypeBasic(enum_def.underlying_type) + "\n\n"; in GenEnumType()
168 void EnumMember(const EnumDef &enum_def, const EnumVal &ev, in EnumMember() argument
172 code += enum_def.name; in EnumMember()
176 code += GetEnumTypeName(enum_def); in EnumMember()
178 code += enum_def.ToString(ev) + "\n"; in EnumMember()
[all …]
Didl_gen_dart.cpp166 auto &enum_def = **it; in GenerateEnums() local
167 GenEnum(enum_def, namespace_code); // enum_code_ptr); in GenerateEnums()
221 void GenEnum(EnumDef &enum_def, namespace_code_map *namespace_code) { in GenEnum() argument
222 if (enum_def.generated) return; in GenEnum()
223 auto ns = BuildNamespaceName(*enum_def.defined_namespace); in GenEnum()
225 GenDocComment(enum_def.doc_comment, &code, ""); in GenEnum()
227 auto name = enum_def.is_union ? enum_def.name + "TypeId" : enum_def.name; in GenEnum()
228 auto is_bit_flags = enum_def.attributes.Lookup("bit_flags"); in GenEnum()
250 enum_def.ToString(*enum_def.MinValue()) + ";\n"; in GenEnum()
252 enum_def.ToString(*enum_def.MaxValue()) + ";\n"; in GenEnum()
[all …]
Didl_gen_rust.cpp151 } else if (type.enum_def != nullptr) { in GetFullType()
152 if (type.enum_def->is_union) { in GetFullType()
199 bool IsBitFlagsEnum(const EnumDef &enum_def) { in IsBitFlagsEnum() argument
200 return enum_def.attributes.Lookup("bit_flags") != nullptr; in IsBitFlagsEnum()
203 EnumDef *ed = field.value.type.enum_def; in IsBitFlagsEnum()
352 const auto &enum_def = **it; in generate() local
353 if (enum_def.defined_namespace == ns && !enum_def.generated) { in generate()
354 SetNameSpace(enum_def.defined_namespace); in generate()
355 GenEnum(enum_def); in generate()
552 if (type.enum_def) { return WrapInNameSpace(*type.enum_def); } in GetTypeBasic()
[all …]
Didl_gen_ts.cpp87 auto &enum_def = **it; in generateEnums() local
88 GenEnum(enum_def, &enumcode, imports, false); in generateEnums()
89 GenEnum(enum_def, &enumcode, imports, true); in generateEnums()
90 SaveType(enum_def, enumcode, imports, bare_imports); in generateEnums()
133 void GenEnum(EnumDef &enum_def, std::string *code_ptr, import_set &imports, in GenEnum() argument
135 if (enum_def.generated) return; in GenEnum()
138 GenDocComment(enum_def.doc_comment, code_ptr); in GenEnum()
139 std::string ns = GetNameSpace(enum_def); in GenEnum()
140 std::string enum_def_name = enum_def.name + (reverse ? "Name" : ""); in GenEnum()
141 code += "export enum " + enum_def.name + "{\n"; in GenEnum()
[all …]
Didl_gen_lobster.cpp72 if (IsScalar(type.base_type) && type.enum_def) in LobsterType()
73 return NormalizedName(*type.enum_def); in LobsterType()
117 if (field.value.type.enum_def) in GenStructAccessor()
118 acc = NormalizedName(*field.value.type.enum_def) + "(" + acc + ")"; in GenStructAccessor()
165 for (auto it = field.value.type.enum_def->Vals().begin(); in GenStructAccessor()
166 it != field.value.type.enum_def->Vals().end(); ++it) { in GenStructAccessor()
276 void GenEnum(const EnumDef &enum_def, std::string *code_ptr) { in GenEnum() argument
277 if (enum_def.generated) return; in GenEnum()
279 CheckNameSpace(enum_def, &code); in GenEnum()
280 GenComment(enum_def.doc_comment, code_ptr, nullptr, ""); in GenEnum()
[all …]
Didl_gen_json_schema.cpp27 template<class T> std::string GenFullName(const T *enum_def) { in GenFullName() argument
29 const auto &name_spaces = enum_def->defined_namespace->components; in GenFullName()
33 full_name.append(enum_def->name); in GenFullName()
37 template<class T> std::string GenTypeRef(const T *enum_def) { in GenTypeRef() argument
38 return "\"$ref\" : \"#/definitions/" + GenFullName(enum_def) + "\""; in GenTypeRef()
89 if (type.enum_def != nullptr) { return GenTypeRef(type.enum_def); } in GenBaseType()
97 } else if (type.enum_def != nullptr) { in GenArrayType()
98 element_type = GenTypeRef(type.enum_def); in GenArrayType()
117 const auto &union_types = type.enum_def->Vals(); in GenType()
125 if (union_type != *type.enum_def->Vals().rbegin()) { in GenType()
[all …]
Didl_gen_csharp.cpp61 auto &enum_def = **it; in generate() local
62 if (!parser_.opts.one_file) cur_name_space_ = enum_def.defined_namespace; in generate()
63 GenEnum(enum_def, &enumcode, parser_.opts); in generate()
67 if (!SaveType(enum_def.name, *enum_def.defined_namespace, enumcode, in generate()
137 if (IsEnum(type)) return WrapInNameSpace(*type.enum_def); in GenTypeBasic()
182 if (IsEnum(type)) return "(" + WrapInNameSpace(*type.enum_def) + ")"; in DestinationCast()
208 FLATBUFFERS_ASSERT(value.type.enum_def); in GenEnumDefaultValue()
209 auto &enum_def = *value.type.enum_def; in GenEnumDefaultValue() local
210 auto enum_val = enum_def.FindByValue(value.constant); in GenEnumDefaultValue()
211 return enum_val ? (WrapInNameSpace(enum_def) + "." + enum_val->name) in GenEnumDefaultValue()
[all …]
Didl_parser.cpp625 auto enum_def = LookupEnum(id); in ParseTypeIdent() local
626 if (enum_def) { in ParseTypeIdent()
627 type = enum_def->underlying_type; in ParseTypeIdent()
628 if (enum_def->is_union) type.base_type = BASE_TYPE_UNION; in ParseTypeIdent()
701 type = Type(BASE_TYPE_ARRAY, subtype.struct_def, subtype.enum_def, in ParseType()
705 type = Type(BASE_TYPE_VECTOR, subtype.struct_def, subtype.enum_def); in ParseType()
782 type.enum_def->underlying_type, &typefield)); in ParseField()
793 Type union_vector(BASE_TYPE_VECTOR, nullptr, type.enum_def); in ParseField()
904 if (type.enum_def && type.enum_def->Lookup("null")) { in ParseField()
909 type.enum_def->name + "'."); in ParseField()
[all …]
Didl_gen_java.cpp56 auto &enum_def = **it; in generate() local
57 if (!parser_.opts.one_file) cur_name_space_ = enum_def.defined_namespace; in generate()
58 GenEnum(enum_def, &enumcode); in generate()
62 if (!SaveType(enum_def.name, *enum_def.defined_namespace, enumcode, in generate()
258 FLATBUFFERS_ASSERT(value.type.enum_def); in GenEnumDefaultValue()
259 auto &enum_def = *value.type.enum_def; in GenEnumDefaultValue() local
260 auto enum_val = enum_def.FindByValue(value.constant); in GenEnumDefaultValue()
261 return enum_val ? (WrapInNameSpace(enum_def) + "." + enum_val->name) in GenEnumDefaultValue()
296 void GenEnum(EnumDef &enum_def, std::string *code_ptr) const { in GenEnum() argument
298 if (enum_def.generated) return; in GenEnum()
[all …]
Didl_gen_python.cpp107 void EnumMember(const EnumDef &enum_def, const EnumVal &ev, in EnumMember() argument
113 code += enum_def.ToString(ev) + "\n"; in EnumMember()
327 } else if (type.enum_def) { in GenPackageReference()
328 namespaces = type.enum_def->defined_namespace; in GenPackageReference()
885 auto enum_def = field.value.type.enum_def; in GenUnionInit() local
886 for (auto it = enum_def->Vals().begin(); it != enum_def->Vals().end(); in GenUnionInit()
916 Namespace *namespaces = field.value.type.enum_def->defined_namespace; in GenUnionInit()
918 MakeUpperCamel(*(field.value.type.enum_def))); in GenUnionInit()
919 auto union_name = MakeUpperCamel(*(field.value.type.enum_def)); in GenUnionInit()
1103 auto union_name = MakeUpperCamel(*(field.value.type.enum_def)); in GenUnPackForUnion()
[all …]
Didl_gen_swift.cpp148 const auto &enum_def = **it; in generate() local
149 if (!enum_def.generated) { GenEnum(enum_def); } in generate()
844 void GenEnum(const EnumDef &enum_def) { in GenEnum() argument
845 if (enum_def.generated) return; in GenEnum()
846 auto is_private_access = enum_def.attributes.Lookup("private"); in GenEnum()
848 code_.SetValue("ENUM_NAME", NameWrappedInNameSpace(enum_def)); in GenEnum()
849 code_.SetValue("BASE_TYPE", GenTypeBasic(enum_def.underlying_type, false)); in GenEnum()
850 GenComment(enum_def.doc_comment); in GenEnum()
860 for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); ++it) { in GenEnum()
864 code_.SetValue("VALUE", enum_def.ToString(ev)); in GenEnum()
[all …]
Didl_gen_kotlin.cpp73 auto &enum_def = **it; in generate() local
74 if (!parser_.opts.one_file) cur_name_space_ = enum_def.defined_namespace; in generate()
75 GenEnum(enum_def, enumWriter); in generate()
79 if (!SaveType(enum_def.name, *enum_def.defined_namespace, in generate()
137 return type.enum_def != nullptr && IsInteger(type.base_type); in IsEnum()
187 FLATBUFFERS_ASSERT(value.type.enum_def); in GenEnumDefaultValue()
188 auto &enum_def = *value.type.enum_def; in GenEnumDefaultValue() local
189 auto enum_val = enum_def.FindByValue(value.constant); in GenEnumDefaultValue()
190 return enum_val ? (WrapInNameSpace(enum_def) + "." + enum_val->name) in GenEnumDefaultValue()
259 void GenEnum(EnumDef &enum_def, CodeWriter &writer) const { in GenEnum() argument
[all …]
Didl_gen_php.cpp45 auto &enum_def = **it; in GenerateEnums() local
47 GenEnum(enum_def, &enumcode); in GenerateEnums()
48 if (!SaveType(enum_def, enumcode, false)) return false; in GenerateEnums()
122 static void EnumMember(const EnumDef &enum_def, const EnumVal &ev, in EnumMember() argument
128 code += enum_def.ToString(ev) + ";\n"; in EnumMember()
811 static void GenEnum(const EnumDef &enum_def, std::string *code_ptr) { in GenEnum() argument
812 if (enum_def.generated) return; in GenEnum()
814 GenComment(enum_def.doc_comment, code_ptr, nullptr); in GenEnum()
815 BeginEnum(enum_def.name, code_ptr); in GenEnum()
816 for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); ++it) { in GenEnum()
[all …]
Didl_gen_text.cpp59 if (opts.output_enum_identifiers && type.enum_def) { in PrintScalar()
60 const auto &enum_def = *type.enum_def; in PrintScalar() local
61 if (auto ev = enum_def.ReverseLookup(static_cast<int64_t>(val))) { in PrintScalar()
66 } else if (val && enum_def.attributes.Lookup("bit_flags")) { in PrintScalar()
71 for (auto it = enum_def.Vals().begin(), e = enum_def.Vals().end(); in PrintScalar()
181 auto enum_val = type.enum_def->ReverseLookup(union_type_byte, true); in PrintOffset()
Didl_gen_lua.cpp94 void EnumMember(const EnumDef &enum_def, const EnumVal &ev, in EnumMember() argument
98 enum_def.ToString(ev) + ",\n"; in EnumMember()
585 void GenEnum(const EnumDef &enum_def, std::string *code_ptr) { in GenEnum() argument
586 if (enum_def.generated) return; in GenEnum()
588 GenComment(enum_def.doc_comment, code_ptr, &def_comment); in GenEnum()
589 BeginEnum(NormalizedName(enum_def), code_ptr); in GenEnum()
590 for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end(); ++it) { in GenEnum()
593 EnumMember(enum_def, ev, code_ptr); in GenEnum()
678 auto &enum_def = **it; in generateEnums() local
680 GenEnum(enum_def, &enumcode); in generateEnums()
[all …]
Dcode_generators.cpp329 auto &enum_def = **it; in JavaCSharpMakeRule() local
332 BaseGenerator::NamespaceDir(parser, path, *enum_def.defined_namespace); in JavaCSharpMakeRule()
333 make_rule += directory + enum_def.name + file_extension; in JavaCSharpMakeRule()
/third_party/flatbuffers/include/flatbuffers/
Didl.h167 enum_def(_ed), in base_type()
172 struct_def == o.struct_def && enum_def == o.enum_def;
176 return Type(element, struct_def, enum_def, fixed_length); in VectorType()
186 EnumDef *enum_def; // set if t == BASE_TYPE_UNION / BASE_TYPE_UTYPE, member
475 return type.enum_def != nullptr && type.enum_def->is_union; in IsUnion()
491 return type.enum_def != nullptr && IsInteger(type.base_type); in IsEnum()
523 (a.enum_def == b.enum_def || a.enum_def->name == b.enum_def->name); in EqualByName()
/third_party/grpc/third_party/upb/upb/pb/
Dtextprinter.c188 const upb_enumdef *enum_def = upb_fielddef_enumsubdef(f); in STRINGIFY_MACROVAL() local
189 const char *label = upb_enumdef_iton(enum_def, val); in STRINGIFY_MACROVAL()
/third_party/protobuf/ruby/ext/google/protobuf_c/
Dupb.c8735 const upb_enumdef *enum_def = upb_fielddef_enumsubdef(f); in STRINGIFY_MACROVAL() local
8736 const char *label = upb_enumdef_iton(enum_def, val); in STRINGIFY_MACROVAL()