BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
stdio.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <fc/io/iostream.hpp>
3 
4 namespace fc
5 {
6 
7  class cout_t : virtual public ostream {
8  public:
9  virtual size_t writesome( const char* buf, size_t len );
10  virtual size_t writesome( const std::shared_ptr<const char>& buf, size_t len, size_t offset );
11  virtual void close();
12  virtual void flush();
13  };
14 
15  class cerr_t : virtual public ostream {
16  public:
17  virtual size_t writesome( const char* buf, size_t len );
18  virtual size_t writesome( const std::shared_ptr<const char>& buf, size_t len, size_t offset );
19  virtual void close();
20  virtual void flush();
21  };
22 
23  class cin_t : virtual public istream {
24  public:
25  ~cin_t();
26  virtual size_t readsome( char* buf, size_t len );
27  virtual size_t readsome( const std::shared_ptr<char>& buf, size_t len, size_t offset );
28  virtual istream& read( char* buf, size_t len );
29  virtual bool eof()const;
30  };
31 
32  extern cout_t& cout;
33  extern cerr_t& cerr;
34  extern cin_t& cin;
35 
36  extern std::shared_ptr<cin_t> cin_ptr;
37  extern std::shared_ptr<cout_t> cout_ptr;
38  extern std::shared_ptr<cerr_t> cerr_ptr;
39 }
virtual size_t writesome(const char *buf, size_t len)
Definition: iostream.cpp:92
std::shared_ptr< cerr_t > cerr_ptr
Definition: iostream.cpp:174
size_t read(AsyncReadStream &s, const MutableBufferSequence &buf)
wraps boost::asio::async_read
Definition: asio.hpp:104
cout_t & cout
Definition: iostream.cpp:175
cin_t & cin
Definition: iostream.cpp:177
virtual void flush()
Definition: iostream.cpp:95
std::shared_ptr< cout_t > cout_ptr
Definition: iostream.cpp:173
Definition: api.hpp:15
std::shared_ptr< cin_t > cin_ptr
Definition: iostream.cpp:172
virtual void close()
Definition: iostream.cpp:94
cerr_t & cerr
Definition: iostream.cpp:176