BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
buffered_iostream.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <fc/io/iostream.hpp>
3 
4 namespace 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:
21 
23 
24  virtual ~buffered_istream();
25 
34  virtual size_t readsome( char* buf, 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 }
fc::buffered_ostream::close
virtual void close()
Definition: buffered_iostream.cpp:202
fc::buffered_istream::operator=
buffered_istream & operator=(buffered_istream &&i)
Definition: buffered_iostream.cpp:41
fc::buffered_ostream::operator=
buffered_ostream & operator=(buffered_ostream &&m)
Definition: buffered_iostream.cpp:161
fc
Definition: api.hpp:15
fc::istream_ptr
std::shared_ptr< istream > istream_ptr
Definition: iostream.hpp:35
fc::buffered_istream::peek
virtual char peek() const
Definition: buffered_iostream.cpp:112
fc::buffered_ostream::buffered_ostream
buffered_ostream(ostream_ptr o, size_t bufsize=4096)
Definition: buffered_iostream.cpp:153
iostream.hpp
fc::buffered_ostream_ptr
std::shared_ptr< buffered_ostream > buffered_ostream_ptr
Definition: buffered_iostream.hpp:72
fc::buffered_ostream::~buffered_ostream
~buffered_ostream()
Definition: buffered_iostream.cpp:167
fc::ostream
Definition: iostream.hpp:41
fc::buffered_istream
Reads data from an unbuffered stream and enables peek functionality.
Definition: buffered_iostream.hpp:16
fc::istream
Definition: iostream.hpp:11
fc::buffered_ostream::writesome
virtual size_t writesome(const char *buf, size_t len)
Definition: buffered_iostream.cpp:169
fc::buffered_ostream::flush
virtual void flush()
Definition: buffered_iostream.cpp:181
fc::buffered_istream::~buffered_istream
virtual ~buffered_istream()
Definition: buffered_iostream.cpp:47
fc::buffered_istream::readsome
virtual size_t readsome(char *buf, size_t len)
Definition: buffered_iostream.cpp:49
fc::buffered_ostream
Definition: buffered_iostream.hpp:52
fc::buffered_istream_ptr
std::shared_ptr< buffered_istream > buffered_istream_ptr
Definition: buffered_iostream.hpp:46
fc::ostream_ptr
std::shared_ptr< ostream > ostream_ptr
Definition: iostream.hpp:59
fc::buffered_istream::buffered_istream
buffered_istream(istream_ptr is)
Definition: buffered_iostream.cpp:32