Commit b873b3c6 authored by Kenton Varda's avatar Kenton Varda

Add String::releaseArray() which extracts the backing Array<char>.

parent 44cc7697
......@@ -170,6 +170,10 @@ public:
inline ArrayPtr<const byte> asBytes() const { return asArray().asBytes(); }
// Result does not include NUL terminator.
inline Array<char> releaseArray() { return kj::mv(content); }
// Disowns the backing array (which includes the NUL terminator) and returns it. The String value
// is clobbered (as if moved away).
inline const char* cStr() const;
inline size_t size() const;
......
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