libcsdbg  1.28
C++ exception (and generic) stack trace debug library
filebuf.hpp
Go to the documentation of this file.
1 #ifndef _CSDBG_FILEBUF
2 #define _CSDBG_FILEBUF 1
3 
10 #include "./streambuf.hpp"
11 
12 namespace csdbg {
13 
31 class filebuf: virtual public streambuf
32 {
33 protected:
34 
35  /* Protected variables */
36 
39 public:
40 
41  /* Constructors, copy constructors and destructor */
42 
43  explicit filebuf(const i8*);
44 
45  filebuf(const filebuf&);
46 
47  virtual ~filebuf();
48 
49  virtual filebuf* clone() const;
50 
51 
52  /* Accessor methods */
53 
54  virtual const i8* path() const;
55 
56 
57  /* Operator overloading methods */
58 
59  virtual filebuf& operator=(const filebuf&);
60 
61 
62  /* Generic methods */
63 
64  virtual filebuf& open();
65 
66  virtual filebuf& open(u32, u32);
67 
68  virtual filebuf& flush();
69 
70  virtual filebuf& sync() const;
71 
72  virtual filebuf& sync(bool) const;
73 
74  virtual filebuf& seek_to(i32, bool = false);
75 
76  virtual filebuf& resize(u32);
77 
78  static string* unique_id(const i8*);
79 };
80 
81 }
82 
83 #endif
84 
virtual ~filebuf()
Object destructor.
Definition: filebuf.cpp:70
This abstract class is the base for all buffered output stream types (for files, sockets, serial interfaces e.t.c)
Definition: streambuf.hpp:37
virtual filebuf & flush()
Flush the buffered data to the file.
Definition: filebuf.cpp:216
char i8
8-bit signed integer
Definition: config.hpp:72
virtual filebuf & seek_to(i32, bool=false)
Seek the file pointer to a new position.
Definition: filebuf.cpp:282
virtual filebuf & operator=(const filebuf &)
Assignment operator.
Definition: filebuf.cpp:112
Class csdbg::streambuf definition.
virtual filebuf * clone() const
Object virtual copy constructor.
Definition: filebuf.cpp:85
virtual filebuf & open()
Open the file for output.
Definition: filebuf.cpp:143
virtual filebuf & resize(u32)
Resize the file.
Definition: filebuf.cpp:313
virtual filebuf & sync() const
Commit cached data to the file.
Definition: filebuf.cpp:241
virtual const i8 * path() const
Get the output file path.
Definition: filebuf.cpp:96
unsigned int u32
32-bit unsigned integer
Definition: config.hpp:102
int i32
32-bit signed integer
Definition: config.hpp:82
A buffered file output stream.
Definition: filebuf.hpp:31
i8 * m_path
Output file path.
Definition: filebuf.hpp:37
filebuf(const i8 *)
Object constructor.
Definition: filebuf.cpp:23
static string * unique_id(const i8 *)
Create a unique ID based on process identifiers arranged as indicated by a printf-style format string...
Definition: filebuf.cpp:355