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

Method AsString

Libs/flatbuffers/flexbuffers.h:522–532  ·  view source on GitHub ↗

This function returns the empty string if you try to read something that is not a string or key.

Source from the content-addressed store, hash-verified

520 // This function returns the empty string if you try to read something that
521 // is not a string or key.
522 String AsString() const {
523 if (type_ == FBT_STRING) {
524 return String(Indirect(), byte_width_);
525 } else if (type_ == FBT_KEY) {
526 auto key = Indirect();
527 return String(key, byte_width_,
528 strlen(reinterpret_cast<const char *>(key)));
529 } else {
530 return String::EmptyString();
531 }
532 }
533
534 // Unlike AsString(), this will convert any type to a std::string.
535 std::string ToString() const {

Callers

nothing calls this directly

Calls 2

IndirectFunction · 0.85
StringFunction · 0.70

Tested by

no test coverage detected