mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
Include a SizePrefixed..HasIdentifier for c++. (#6871)
* Include a SizePrefixed..HasIdentifier for c++. * Add updated generated code.
This commit is contained in:
@@ -535,6 +535,14 @@ class CppGenerator : public BaseGenerator {
|
||||
code_ += " buf, {{STRUCT_NAME}}Identifier());";
|
||||
code_ += "}";
|
||||
code_ += "";
|
||||
|
||||
// Check if a size-prefixed buffer has the identifier.
|
||||
code_ += "inline \\";
|
||||
code_ += "bool SizePrefixed{{STRUCT_NAME}}BufferHasIdentifier(const void *buf) {";
|
||||
code_ += " return flatbuffers::BufferHasIdentifier(";
|
||||
code_ += " buf, {{STRUCT_NAME}}Identifier(), true);";
|
||||
code_ += "}";
|
||||
code_ += "";
|
||||
}
|
||||
|
||||
// The root verifier.
|
||||
|
||||
Reference in New Issue
Block a user