# Log File Class

Topics

:

Overview
Functions

Overview

The LogFile class is used to log program events to a disk file. The LogFile class is derived from the OutputStreamB class enabling LogFile objects to output filtered text to an output stream. The OutputStreamB base class includes several overloads that give LogFile objects the same functionality as C++ ostream objects and allows standard C++ I/O manipulators to be used with LogFile objects.

Functions

LogFile::LogFile()
LogFile::~LogFile()
LogFile::Close()
LogFile::Flush()
LogFile::Open()
LogFile::OverWrite()
LogFile::WriteSysTime()

LogFile::LogFile()

- Default class constructor.

LogFile::~LogFile()

- Class destructor responsible for closing an open logfile.

void LogFile::Close()

- Public member function used to close an open logfile.

void LogFile::Flush()

- Public member function used to flush all disk buffers.

int LogFile::Open(char *fname)

- Public member function use to open an existing logfile without overwriting it. Returns zero to indicate success or a non-zero value to indicate a failure.

int LogFile::Open(const char *fname)

- Public member function use to open an existing logfile without overwriting it. Returns zero to indicate success or a non-zero value to indicate a failure.

int LogFile::OverWrite(char *fname)

- Public member function use to open an existing logfile and overwrite it. Returns zero to indicate success or a non-zero value to indicate a failure.

int LogFile::OverWrite(const char *fname)

- Public member function use to open an existing logfile and overwrite it. Returns zero to indicate success or a non-zero value to indicate a failure.

void LogFile::WriteSysTime()

- Public member function used to write the current system time and date to an open logfile.

End Of Document