MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / StartEnum

Method StartEnum

native/thirdpart/flatbuffers/idl_parser.cpp:2750–2766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2748}
2749
2750CheckedError Parser::StartEnum(const std::string &enum_name, bool is_union,
2751 EnumDef **dest) {
2752 auto &enum_def = *new EnumDef();
2753 enum_def.name = enum_name;
2754 enum_def.file = file_being_parsed_;
2755 enum_def.doc_comment = doc_comment_;
2756 enum_def.is_union = is_union;
2757 enum_def.defined_namespace = current_namespace_;
2758 if (enums_.Add(current_namespace_->GetFullyQualifiedName(enum_name),
2759 &enum_def))
2760 return Error("enum already exists: " + enum_name);
2761 enum_def.underlying_type.base_type =
2762 is_union ? BASE_TYPE_UTYPE : BASE_TYPE_INT;
2763 enum_def.underlying_type.enum_def = &enum_def;
2764 if (dest) *dest = &enum_def;
2765 return NoError();
2766}
2767
2768CheckedError Parser::ParseProtoFields(StructDef *struct_def, bool isextend,
2769 bool inside_oneof) {

Callers

nothing calls this directly

Calls 4

ErrorFunction · 0.85
NoErrorFunction · 0.85
AddMethod · 0.80
GetFullyQualifiedNameMethod · 0.80

Tested by

no test coverage detected