libcsdbg  1.28
C++ exception (and generic) stack trace debug library
streambuf.hpp
Go to the documentation of this file.
1 #ifndef _CSDBG_STREAMBUF
2 #define _CSDBG_STREAMBUF 1
3 
10 #include "./string.hpp"
11 
12 namespace csdbg {
13 
37 class streambuf: virtual public string
38 {
39 protected:
40 
41  /* Protected variables */
42 
45 public:
46 
47  /* Constructors, copy constructors and destructor */
48 
49  streambuf();
50 
51  streambuf(const streambuf&);
52 
53  virtual ~streambuf() = 0;
55  virtual streambuf* clone() const = 0;
58  /* Accessor methods */
59 
60  virtual i32 handle() const;
61 
62  virtual bool is_opened() const;
63 
64 
65  /* Operator overloading methods */
66 
67  virtual streambuf& operator=(const streambuf&);
68 
69 
70  /* Generic methods */
71 
72  virtual streambuf& open() = 0;
74  virtual streambuf& close();
75 
76  virtual streambuf& flush() = 0;
78  virtual streambuf& sync() const = 0;
80  virtual streambuf& lock() const;
81 
82  virtual streambuf& unlock() const;
83 
84  virtual streambuf& header();
85 };
86 
87 }
88 
89 #endif
90 
virtual streambuf & header()
Append LDP headers to the buffer.
Definition: streambuf.cpp:248
virtual streambuf & flush()=0
To be implemented.
Definition: streambuf.cpp:156
virtual streambuf & sync() const =0
To be implemented.
This abstract class is the base for all buffered output stream types (for files, sockets, serial interfaces e.t.c)
Definition: streambuf.hpp:37
i32 m_handle
Stream handle (descriptor)
Definition: streambuf.hpp:43
streambuf()
Object default constructor.
Definition: streambuf.cpp:20
virtual streambuf & operator=(const streambuf &)
Assignment operator.
Definition: streambuf.cpp:96
virtual streambuf & lock() const
Lock the stream (exclusively)
Definition: streambuf.cpp:188
Class csdbg::string definition.
Lightweight string buffer class (for ISO-8859-1 text)
Definition: string.hpp:36
virtual ~streambuf()=0
To be implemented.
Definition: streambuf.cpp:58
virtual i32 handle() const
Get the handle.
Definition: streambuf.cpp:69
int i32
32-bit signed integer
Definition: config.hpp:82
virtual streambuf & unlock() const
Unlock the stream.
Definition: streambuf.cpp:210
virtual bool is_opened() const
Check if the stream is opened for output.
Definition: streambuf.cpp:80
virtual streambuf & open()=0
To be implemented.
virtual streambuf & close()
Close the stream.
Definition: streambuf.cpp:130
virtual streambuf * clone() const =0
To be implemented.