#include <logfile.h>
|
| | Logfile () |
| |
| | Logfile (const Logfile &)=default |
| |
| virtual | ~Logfile () |
| |
| const char * | file_name () const |
| | Return file name. More...
|
| |
| std::size_t | bytes_written () const |
| | Return number bytes written into a log file. More...
|
| |
| bool | flush () |
| | Flush any unwritten content from the stream's buffer to the associated file. More...
|
| |
| bool | open (const char *dirname, const char *filename, const char *ext) |
| | Construct a file path using directory name, file name and extension arguments and open it in write/update mode. More...
|
| |
| bool | write (const char *data, std::size_t length) |
| | Write the contents in data array to a file. More...
|
| |
| void | show_tail (unsigned int lines) |
| | Print the last N number of lines from a file to stderr. More...
|
| |
◆ Logfile() [1/2]
◆ Logfile() [2/2]
| Logfile::Logfile |
( |
const Logfile & |
| ) |
|
|
default |
◆ ~Logfile()
| virtual Logfile::~Logfile |
( |
| ) |
|
|
inlinevirtual |
◆ bytes_written()
| std::size_t Logfile::bytes_written |
( |
| ) |
const |
|
inline |
Return number bytes written into a log file.
- Return values
-
| Number | bytes written into a log file. |
◆ close()
Close the given file stream.
◆ file_name()
| const char * Logfile::file_name |
( |
| ) |
const |
|
inline |
Return file name.
- Return values
-
◆ flush()
Flush any unwritten content from the stream's buffer to the associated file.
- Return values
-
| False | if successful, true otherwise. |
◆ open()
| bool Logfile::open |
( |
const char * |
dirname, |
|
|
const char * |
filename, |
|
|
const char * |
ext |
|
) |
| |
Construct a file path using directory name, file name and extension arguments and open it in write/update mode.
- Parameters
-
| dirname | Directory name |
| filename | File name |
| ext | Extension name |
- Return values
-
| False | if successful, true otherwise. |
◆ show_tail()
| void Logfile::show_tail |
( |
unsigned int |
lines | ) |
|
Print the last N number of lines from a file to stderr.
- Parameters
-
◆ write()
| bool Logfile::write |
( |
const char * |
data, |
|
|
std::size_t |
length |
|
) |
| |
Write the contents in data array to a file.
- Parameters
-
| data | Pointer to the array to be written |
| length | Length of the buffer |
- Return values
-
| False | if successful, true otherwise. |
◆ m_bytes_written
| std::size_t Logfile::m_bytes_written |
|
private |
◆ m_file
◆ m_filename
The documentation for this class was generated from the following files: