Commit 9c25ecdc authored by Jun Hyeon, Nam's avatar Jun Hyeon, Nam Committed by Wouter van Oortmerssen

C++: add String::str() function (#4234)

for convenience
parent 1beed12e
......@@ -218,6 +218,7 @@ class String : public Sized {
size_t length() const { return size(); }
const char *c_str() const { return reinterpret_cast<const char *>(data_); }
std::string str() const { return std::string(c_str(), length()); }
static String EmptyString() {
static const uint8_t empty_string[] = { 0/*len*/, 0/*terminator*/ };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment