MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / ToString

Method ToString

Bcore/src/main/cpp/base/stringpiece.h:120–122  ·  view source on GitHub ↗

We also define ToString() here, since many other string-like interfaces name the routine that converts to a C++ string "ToString", and it's confusing to have the method that does that for a StringPiece be called "as_string()". We also leave the "as_string()" method defined here for existing code.

Source from the content-addressed store, hash-verified

118 // for a StringPiece be called "as_string()". We also leave the
119 // "as_string()" method defined here for existing code.
120 std::string ToString() const {
121 return std::string(data(), size());
122 }
123
124 void CopyToString(std::string* target) const {
125 target->assign(ptr_, length_);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected