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.
| 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_); |
nothing calls this directly
no outgoing calls
no test coverage detected