MCPcopy Create free account
hub / github.com/dmlc/xgboost / EncodeStr

Function EncodeStr

src/common/json.cc:883–894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

881}
882
883void EncodeStr(std::vector<char>* stream, std::string const& string) {
884 stream->push_back('L');
885
886 int64_t bsize = string.size();
887 WritePrimitive(bsize, stream);
888
889 auto s = stream->size();
890 stream->resize(s + string.size());
891
892 auto ptr = stream->data() + s;
893 std::memcpy(ptr, string.data(), string.size());
894}
895} // anonymous namespace
896
897void UBJWriter::Visit(JsonArray const* arr) {

Callers 1

VisitMethod · 0.85

Calls 4

WritePrimitiveFunction · 0.85
resizeMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected