17 auto current_pos = m_str.tellg();
18 m_str.seekg(0, std::ios::end);
19 if(m_str.tellg() == current_pos) {
22 m_str.seekg(current_pos);
27 m_str.seekg(
static_cast<off_type
>(len), std::ios::cur);
37 m_str.setstate(std::ios::failbit);
42 auto read_vec = std::vector<char>(len);
43 if(!m_str.read(read_vec.data(),
static_cast<off_type
>(len))) {
47 std::memcpy(data, read_vec.data(), len);
auto read(void *data, size_t len) -> bool final
Attempts to read the given number of bytes from the current position in the stream.
void advance_cursor(size_t len) final
Moves the stream forward without reading from the stream.
auto write(const void *data, size_t len) -> bool final
Not implemented for istream.
istream_serializer(std::istream &s)
Constructor.
void reset() final
Seeks the stream position to the beginning.
auto end_of_buffer() const -> bool final
Indicates whether the serializer has reached the end of the stream.
Implementation of serializer for std::ios.