default_stream.h 957 B

1234567891011121314151617181920212223242526272829
  1. // Copyright (C) 2008-2018 Samuel Newbold
  2. struct Default_istream : public Rwsh_istream {
  3. Default_istream(int fd_i);
  4. virtual ~Default_istream(void) {};
  5. virtual Rwsh_istream* copy_pointer(void);
  6. virtual Rwsh_istream& getline(std::string& dest);
  7. Rwsh_istream& readline_getline(std::string& dest);
  8. virtual int fd(void);
  9. virtual std::string str(void) const;};
  10. class Default_ostream : public Rwsh_ostream {
  11. std::ostream* cpp_style; // usage is ultimately incompatible with fd
  12. public:
  13. Default_ostream(int fd_i);
  14. virtual ~Default_ostream(void) {};
  15. virtual Rwsh_ostream* copy_pointer(void);
  16. virtual Rwsh_ostream& operator<<(const std::string& r);
  17. virtual Rwsh_ostream& operator<<(int r);
  18. virtual Rwsh_ostream& operator<<(unsigned int r);
  19. virtual Rwsh_ostream& operator<<(double r);
  20. virtual Rwsh_ostream& operator<<(struct timeval r);
  21. virtual int fd(void);
  22. virtual void flush(void);
  23. virtual std::string str(void) const;};