Merge pull request #8869

2c98a82 Add byte_stream alue_type and data() (Lee *!* Clagett)
This commit is contained in:
luigi1111 2023-06-27 11:45:25 -05:00
commit 1261f0ac09
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -74,6 +74,7 @@ namespace epee
public: public:
using char_type = std::uint8_t; using char_type = std::uint8_t;
using Ch = char_type; using Ch = char_type;
using value_type = char_type;
//! Increase internal buffer by at least `byte_stream_increase` bytes. //! Increase internal buffer by at least `byte_stream_increase` bytes.
byte_stream() noexcept byte_stream() noexcept
@ -86,6 +87,7 @@ namespace epee
~byte_stream() noexcept = default; ~byte_stream() noexcept = default;
byte_stream& operator=(byte_stream&& rhs) noexcept; byte_stream& operator=(byte_stream&& rhs) noexcept;
std::uint8_t* data() noexcept { return buffer_.get(); }
const std::uint8_t* data() const noexcept { return buffer_.get(); } const std::uint8_t* data() const noexcept { return buffer_.get(); }
std::uint8_t* tellp() const noexcept { return next_write_; } std::uint8_t* tellp() const noexcept { return next_write_; }
std::size_t available() const noexcept { return end_ - next_write_; } std::size_t available() const noexcept { return end_ - next_write_; }