Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
buffered_iostream.hpp
Go to the documentation of this file.
1#pragma once
2#include <fc/io/iostream.hpp>
3
4namespace fc
5{
6 namespace detail
7 {
8 class buffered_istream_impl;
9 class buffered_ostream_impl;
10 }
11
16 class buffered_istream : public virtual istream
17 {
18 public:
19 buffered_istream( istream_ptr is );
21
23
24 virtual ~buffered_istream();
25
34 virtual std::size_t readsome( char* buf, std::size_t len );
35 virtual size_t readsome( const std::shared_ptr<char>& buf, size_t len, size_t offset );
36
41 virtual char peek() const;
42
43 private:
44 std::unique_ptr<detail::buffered_istream_impl> my;
45 };
46 typedef std::shared_ptr<buffered_istream> buffered_istream_ptr;
47
48
52 class buffered_ostream : public virtual ostream
53 {
54 public:
55 buffered_ostream( ostream_ptr o, size_t bufsize = 4096 );
58
64 virtual size_t writesome( const char* buf, size_t len );
65 virtual size_t writesome( const std::shared_ptr<const char>& buf, size_t len, size_t offset );
66
67 virtual void close();
68 virtual void flush();
69 private:
70 std::unique_ptr<detail::buffered_ostream_impl> my;
71 };
72 typedef std::shared_ptr<buffered_ostream> buffered_ostream_ptr;
73}
Reads data from an unbuffered stream and enables peek functionality.
buffered_istream(istream_ptr is)
virtual char peek() const
buffered_istream & operator=(buffered_istream &&i)
virtual std::size_t readsome(char *buf, std::size_t len)
buffered_ostream(ostream_ptr o, size_t bufsize=4096)
virtual size_t writesome(const char *buf, size_t len)
buffered_ostream & operator=(buffered_ostream &&m)
namespace sysio::chain
Definition authority.cpp:3
std::shared_ptr< buffered_istream > buffered_istream_ptr
std::shared_ptr< buffered_ostream > buffered_ostream_ptr
size_t len
uint8_t buf[2048]