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

Function CreateString

native/thirdpart/flatbuffers/flatbuffers.h:1546–1553  ·  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

1544 /// @param[in] len The number of bytes that should be stored from `str`.
1545 /// @return Returns the offset in the buffer where the string starts.
1546 Offset<String> CreateString(const char *str, size_t len) {
1547 NotNested();
1548 PreAlign<uoffset_t>(len + 1); // Always 0-terminated.
1549 buf_.fill(1);
1550 PushBytes(reinterpret_cast<const uint8_t *>(str), len);
1551 PushElement(static_cast<uoffset_t>(len));
1552 return Offset<String>(GetSize());
1553 }
1554
1555 /// @brief Store a string in the buffer, which is null-terminated.
1556 /// @param[in] str A const char pointer to a C-string to add to the buffer.

Callers 2

CreateSharedStringFunction · 0.85
CreateVectorOfStringsFunction · 0.85

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