summaryrefslogtreecommitdiff
path: root/src/core/buffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/buffer.cpp')
-rw-r--r--src/core/buffer.cpp18
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} {}