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

Method MutateString

Libs/flatbuffers/flexbuffers.h:718–726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716 }
717
718 bool MutateString(const char *str, size_t len) {
719 auto s = AsString();
720 if (s.IsTheEmptyString()) return false;
721 // This is very strict, could allow shorter strings, but that creates
722 // garbage.
723 if (s.length() != len) return false;
724 memcpy(const_cast<char *>(s.c_str()), str, len);
725 return true;
726 }
727 bool MutateString(const char *str) { return MutateString(str, strlen(str)); }
728 bool MutateString(const std::string &str) {
729 return MutateString(str.data(), str.length());

Callers

nothing calls this directly

Calls 4

IsTheEmptyStringMethod · 0.80
lengthMethod · 0.80
c_strMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected