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

Method AddFlags

source/fbe.cpp:139–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void Statements::AddFlags(std::shared_ptr<FlagsType>& f)
140{
141 if (f == nullptr)
142 yyerror("Flags is null!");
143 if (f->name->empty())
144 yyerror("Flags name is invalid!");
145 if (!f->body)
146 yyerror("Flags is empty - " + *f->name.get());
147
148 // Check for duplicates
149 auto it = std::find_if(flags.begin(), flags.end(), [&f](auto item)->bool { return *item->name.get() == *f->name.get(); });
150 if (it != flags.end())
151 yyerror("Duplicate flags name " + *f->name.get());
152
153 flags.push_back(f);
154}
155
156void Statements::AddStruct(std::shared_ptr<StructType>& s)
157{

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