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

Function Key

Libs/flatbuffers/flexbuffers.h:1008–1024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1006 }
1007
1008 size_t Key(const char *str, size_t len) {
1009 auto sloc = buf_.size();
1010 WriteBytes(str, len + 1);
1011 if (flags_ & BUILDER_FLAG_SHARE_KEYS) {
1012 auto it = key_pool.find(sloc);
1013 if (it != key_pool.end()) {
1014 // Already in the buffer. Remove key we just serialized, and use
1015 // existing offset instead.
1016 buf_.resize(sloc);
1017 sloc = *it;
1018 } else {
1019 key_pool.insert(sloc);
1020 }
1021 }
1022 stack_.push_back(Value(static_cast<uint64_t>(sloc), FBT_KEY, BIT_WIDTH_8));
1023 return sloc;
1024 }
1025
1026 size_t Key(const char *str) { return Key(str, strlen(str)); }
1027 size_t Key(const std::string &str) { return Key(str.c_str(), str.size()); }

Callers 15

NullFunction · 0.70
IntFunction · 0.70
UIntFunction · 0.70
FloatFunction · 0.70
DoubleFunction · 0.70
BoolFunction · 0.70
IndirectIntFunction · 0.70
IndirectUIntFunction · 0.70
IndirectFloatFunction · 0.70
IndirectDoubleFunction · 0.70
StringFunction · 0.70
BlobFunction · 0.70

Calls 9

WriteBytesFunction · 0.85
ValueClass · 0.70
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
resizeMethod · 0.45
insertMethod · 0.45
push_backMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected