DtFilePrinter is a subclass of DtPrinter which opens a file and dumps all information received from DtOutputStream to the file.
More...
Public Member Functions |
| | DtFilePrinter () |
| | Default CTOR.
|
| | DtFilePrinter (const char *filename) |
| | CTOR.
|
| virtual | ~DtFilePrinter () |
| | Virtual DTOR.
|
| virtual void | setPrintTimestamps (bool doit) |
| | Set whether timestamps should be printed.
|
| virtual void | setLogRollingInterval (unsigned int intervalInSeconds) |
| | Set the interval over which the logs should be rolled to a new file.
|
| virtual void | resetFile (const char *filename) |
| | Reset file will close the existing file, if there is one, and open a new file stream.
|
| virtual bool | isOpen () |
| | returns if the file was successfully opened
|
| virtual void | write (const std::string &st, int notify_level, bool newLine) |
| | Writes the latest data to the file.
|
| | DtPrinter () |
| | Default CTOR.
|
| | DtPrinter (const DtPrinter &) |
| | Copy CTOR.
|
| virtual | ~DtPrinter () |
| | Virtual DTOR.
|
Protected Member Functions |
| virtual void | cacheFilename (const std::string &filename) |
| | Caches the filename and stores as base and extension.
|
Detailed Description
DtFilePrinter is a subclass of DtPrinter which opens a file and dumps all information received from DtOutputStream to the file.
If the file does not open for whatever reason no error is reported and all input is lost.
Constructor & Destructor Documentation
| DtFilePrinter::DtFilePrinter |
( |
| ) |
|
Default CTOR.
Does not open a file; user must call resetFile to open a new file.
| DtFilePrinter::DtFilePrinter |
( |
const char * |
filename | ) |
|
CTOR.
Opens output file with the given name.
| virtual DtFilePrinter::~DtFilePrinter |
( |
| ) |
|
|
virtual |
Virtual DTOR.
Closes a file, so anything which is buffered will be written at this time.
Copy CTOR - not implemented.
Member Function Documentation
| virtual void DtFilePrinter::cacheFilename |
( |
const std::string & |
filename | ) |
|
|
protectedvirtual |
Caches the filename and stores as base and extension.
| virtual bool DtFilePrinter::isOpen |
( |
| ) |
|
|
virtual |
returns if the file was successfully opened
Assignment operator - not implemented.
| virtual void DtFilePrinter::resetFile |
( |
const char * |
filename | ) |
|
|
virtual |
Reset file will close the existing file, if there is one, and open a new file stream.
| virtual void DtFilePrinter::setLogRollingInterval |
( |
unsigned int |
intervalInSeconds | ) |
|
|
virtual |
Set the interval over which the logs should be rolled to a new file.
Once the interval has elapsed, the file is closed, moved to a new file, then reopened before logging continues. An interval of zero disables rolling.
| virtual void DtFilePrinter::setPrintTimestamps |
( |
bool |
doit | ) |
|
|
virtual |
Set whether timestamps should be printed.
| virtual void DtFilePrinter::write |
( |
const std::string & |
st, |
|
|
int |
notify_level, |
|
|
bool |
newLine |
|
) |
| |
|
virtual |
Writes the latest data to the file.
This method uses the newLine argument to prepend timestamps.
Implements DtPrinter.
Member Data Documentation
| std::ofstream DtFilePrinter::myFile |
|
protected |
| std::string DtFilePrinter::myFileBase |
|
protected |
| std::string DtFilePrinter::myFileExt |
|
protected |
| std::string DtFilePrinter::myFilename |
|
protected |
| time_t DtFilePrinter::myLogFileOpenTime |
|
protected |
| unsigned int DtFilePrinter::myLogRollingIndex |
|
protected |
| unsigned int DtFilePrinter::myLogRollingInterval |
|
protected |
| bool DtFilePrinter::myTimestampFlag |
|
protected |
The documentation for this class was generated from the following file: