MCPcopy Create free account
hub / github.com/Tencent/rapidjson / String

Method String

test/unittest/readertest.cpp:469–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467
468 bool Default() { ADD_FAILURE(); return false; }
469 bool String(const typename Encoding::Ch* str, size_t length, bool copy) {
470 EXPECT_EQ(0, str_);
471 if (copy) {
472 str_ = static_cast<typename Encoding::Ch*>(malloc((length + 1) * sizeof(typename Encoding::Ch)));
473 memcpy(const_cast<typename Encoding::Ch*>(str_), str, (length + 1) * sizeof(typename Encoding::Ch));
474 }
475 else
476 str_ = str;
477 length_ = length;
478 copy_ = copy;
479 return true;
480 }
481
482 const typename Encoding::Ch* str_;
483 size_t length_;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected