MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / CreateString

Function CreateString

Libs/flatbuffers/flatbuffers.h:1620–1627  ·  view source on GitHub ↗

@brief Store a string in the buffer, which can contain any binary data. @param[in] str A const char pointer to the data to be stored as a string. @param[in] len The number of bytes that should be stored from `str`. @return Returns the offset in the buffer where the string starts.

Source from the content-addressed store, hash-verified

1618 /// @param[in] len The number of bytes that should be stored from `str`.
1619 /// @return Returns the offset in the buffer where the string starts.
1620 Offset<String> CreateString(const char *str, size_t len) {
1621 NotNested();
1622 PreAlign<uoffset_t>(len + 1); // Always 0-terminated.
1623 buf_.fill(1);
1624 PushBytes(reinterpret_cast<const uint8_t *>(str), len);
1625 PushElement(static_cast<uoffset_t>(len));
1626 return Offset<String>(GetSize());
1627 }
1628
1629 /// @brief Store a string in the buffer, which is null-terminated.
1630 /// @param[in] str A const char pointer to a C-string to add to the buffer.

Callers 2

CreateSharedStringFunction · 0.70
CreateVectorOfStringsFunction · 0.70

Calls 8

NotNestedFunction · 0.85
PushBytesFunction · 0.85
PushElementFunction · 0.85
lengthMethod · 0.80
GetSizeFunction · 0.70
c_strMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected