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

Method AddEnum

source/fbe.cpp:122–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void Statements::AddEnum(std::shared_ptr<EnumType>& e)
123{
124 if (e == nullptr)
125 yyerror("Enum is null!");
126 if (e->name->empty())
127 yyerror("Enum name is invalid!");
128 if (!e->body)
129 yyerror("Enum is empty - " + *e->name.get());
130
131 // Check for duplicates
132 auto it = std::find_if(enums.begin(), enums.end(), [&e](auto item)->bool { return *item->name.get() == *e->name.get(); });
133 if (it != enums.end())
134 yyerror("Duplicate enum name " + *e->name.get());
135
136 enums.push_back(e);
137}
138
139void Statements::AddFlags(std::shared_ptr<FlagsType>& f)
140{

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