// Copyright © 2017 ChaiShushan . // License: https://creativecommons.org/licenses/by-nc-sa/4.0/ #include struct MyBuffer { std::string* s_; MyBuffer(int size) { this->s_ = new std::string(size, char('\0')); } ~MyBuffer() { delete this->s_; } int Size() const { return this->s_->size(); } char* Data() { return (char*)this->s_->data(); } };