10 #ifndef BOOST_BEAST_DETAIL_STATIC_OSTREAM_HPP 11 #define BOOST_BEAST_DETAIL_STATIC_OSTREAM_HPP 24 :
public std::basic_streambuf<char>
27 using Traits = std::char_traits<CharT>;
28 using int_type =
typename 29 std::basic_streambuf<CharT, Traits>::int_type;
30 using traits_type =
typename 31 std::basic_streambuf<CharT, Traits>::traits_type;
46 this->setp(data_, data_ + size - 1);
57 return {s_.data(), len_};
64 if(! Traits::eq_int_type(ch, Traits::eof()))
66 Traits::assign(*this->pptr(),
67 static_cast<CharT>(ch));
73 return traits_type::eof();
88 static auto const growth_factor = 1.5;
93 data_ + len_, data_ + size_ - 2);
98 s_.resize(static_cast<std::size_t>(
99 growth_factor * len_));
100 Traits::copy(&s_[0], data_, len_);
104 s_.resize(static_cast<std::size_t>(
105 growth_factor * len_));
107 this->setp(&s_[len_], &s_[len_] +
108 s_.size() - len_ - 1);
114 len_ +=
static_cast<std::size_t
>(
115 this->pptr() - this->pbase() + extra);
125 :
std::basic_ostream<char>(&this->osb_)
128 imbue(std::locale::classic());
int sync() override
Definition: static_ostream.hpp:77
int_type overflow(int_type ch) override
Definition: static_ostream.hpp:62
Definition: async_result.hpp:20
static_ostream_buffer(char *data, std::size_t size)
Definition: static_ostream.hpp:42
Definition: static_ostream.hpp:119
~static_ostream_buffer() noexcept
Definition: static_ostream.hpp:49
string_view str() const
Definition: static_ostream.hpp:54
static_ostream(char *data, std::size_t size)
Definition: static_ostream.hpp:124
static_ostream_buffer(static_ostream_buffer &&)=delete
boost::string_ref string_view
The type of string view used by the library.
Definition: string.hpp:36
Definition: static_ostream.hpp:23
string_view str() const
Definition: static_ostream.hpp:132