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

Method AddField

source/fbe.cpp:59–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void StructBody::AddField(StructField* f)
60{
61 if (f == nullptr)
62 yyerror("Struct field is null!");
63 if (f->name->empty())
64 yyerror("Struct field name is invalid!");
65 if (f->type->empty())
66 yyerror("Struct field type is invalid!");
67
68 // Check for duplicates
69 auto it = std::find_if(fields.begin(), fields.end(), [f](auto item)->bool { return *item->name.get() == *f->name.get(); });
70 if (it != fields.end())
71 yyerror("Duplicate struct field name " + *f->name.get());
72
73 fields.push_back(std::shared_ptr<StructField>(f));
74}
75
76void StructRejects::AddReject(std::string* r, bool g)
77{

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