MCPcopy Create free account
hub / github.com/chronoxor/FastBinaryEncoding / AddValue

Method AddValue

source/fbe.cpp:19–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19void EnumBody::AddValue(EnumValue* v)
20{
21 if (v == nullptr)
22 yyerror("Enum is null!");
23 if (v->name->empty())
24 yyerror("Enum name is invalid!");
25
26 // Check for duplicates
27 auto it = std::find_if(values.begin(), values.end(), [v](auto item)->bool { return *item->name.get() == *v->name.get(); });
28 if (it != values.end())
29 yyerror("Duplicate enum name " + *v->name.get());
30
31 values.push_back(std::shared_ptr<EnumValue>(v));
32}
33
34void FlagsBody::AddValue(FlagsValue* v)
35{

Callers

nothing calls this directly

Calls 5

beginMethod · 0.80
endMethod · 0.80
push_backMethod · 0.80
emptyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected