| 149 | } |
| 150 | |
| 151 | std::shared_ptr<Buffer> Buffer::FromString(std::string data) { |
| 152 | if (data.empty()) { |
| 153 | return std::shared_ptr<Buffer>{new Buffer()}; |
| 154 | } |
| 155 | |
| 156 | auto size_in_bytes = static_cast<int64_t>(data.size()); |
| 157 | return TakeOwnership(std::move(data), size_in_bytes); |
| 158 | } |
| 159 | |
| 160 | std::shared_ptr<Buffer> SliceMutableBuffer(std::shared_ptr<Buffer> buffer, |
| 161 | const int64_t offset, const int64_t length) { |
nothing calls this directly
no test coverage detected