MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / GetBufferIdentifier

Function GetBufferIdentifier

native/thirdpart/flatbuffers/flatbuffers.h:2254–2258  ·  view source on GitHub ↗

@brief Get a pointer to the the file_identifier section of the buffer. @return Returns a const char pointer to the start of the file_identifier characters in the buffer. The returned char * has length 'flatbuffers::FlatBufferBuilder::kFileIdentifierLength'. This function is UNDEFINED for FlatBuffers whose schema does not include a file_identifier (likely points at padding or the start of a the ro

Source from the content-addressed store, hash-verified

2252/// a file_identifier (likely points at padding or the start of a the root
2253/// vtable).
2254inline const char *GetBufferIdentifier(const void *buf,
2255 bool size_prefixed = false) {
2256 return reinterpret_cast<const char *>(buf) +
2257 ((size_prefixed) ? 2 * sizeof(uoffset_t) : sizeof(uoffset_t));
2258}
2259
2260// Helper to see if the identifier in a buffer has the expected value.
2261inline bool BufferHasIdentifier(const void *buf, const char *identifier,

Callers 1

BufferHasIdentifierFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected