diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-06-11 19:24:59 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2023-06-11 19:24:59 +0200 |
commit | b84b576a221684a39ef12891bafd233ba6289b09 (patch) | |
tree | 30570dc6f526023ffee31e9432e5077ff414725e /src/core/buffer.cpp | |
parent | 8228426823ce6f305e2d2eb687aeb78c20109259 (diff) |
c++, codec-json: Added testing for tuples and fixed minor buffer
changes
Diffstat (limited to 'src/core/buffer.cpp')
-rw-r--r-- | src/core/buffer.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/core/buffer.cpp b/src/core/buffer.cpp index 81fc0df..15f4cae 100644 --- a/src/core/buffer.cpp +++ b/src/core/buffer.cpp @@ -60,14 +60,7 @@ error buffer::pop(uint8_t &buffer, size_t size) { return no_error(); } -std::string buffer::to_string() const { - std::ostringstream oss; - for (size_t i = 0; i < read_composite_length(); ++i) { - oss << read(i); - } - return oss.str(); -} - +/* std::string buffer::to_hex() const { std::ostringstream oss; oss << std::hex << std::setfill('0'); @@ -79,6 +72,15 @@ std::string buffer::to_hex() const { } return oss.str(); } +*/ + +std::string convert_to_string(const buffer& buff){ + std::ostringstream oss; + for (size_t i = 0; i < buff.read_composite_length(); ++i) { + oss << buff.read(i); + } + return oss.str(); +} buffer_view::buffer_view(buffer &buffer) : buffer_{&buffer}, read_offset_{0}, write_offset_{0} {} |