top | up | prev | next

LogFileWriter Class

Definition at line 14 of LogFileWriter.hpp

Constructors

LogFileWriter(const std::string& logFilePath)
LogFileWriter(const std::string& logFilePath_, bool open_)

Member Functions

std::ostream& LogFile()
void Write(const std::string& s)
void WriteCurrentDateTime()
void WriteLine()
void WriteLine(const std::string& line)
LogFileWriter& operator<<(StandardEndLine manip)

Typedefs

std::basic_ostream<char, std::char_traits<char>> CoutType

Member Variables

std::ofstream logFile
std::string logFilePath
bool open

Constructor Details

LogFileWriter Constructor

soulng::util::LogFileWriter::LogFileWriter(const std::string& logFilePath)

Definition at line 20 of LogFileWriter.cpp :
 20 : LogFileWriter(logFilePathtrue)
 21 {
 22 }


Declaration at line 18 of LogFileWriter.hpp


LogFileWriter Constructor

soulng::util::LogFileWriter::LogFileWriter(const std::string& logFilePath_, bool open_)

Definition at line 11 of LogFileWriter.cpp :
 11 : logFilePath(logFilePath_)open(open_)
 12 {
 13     if (open)
 14     {
 15         std::ios_base::openmode mode = std::ios_base::app;
 16         logFile.open(logFilePathmode);
 17     }
 18 }


Declaration at line 17 of LogFileWriter.hpp


Member Function Details

LogFile Member Function

std::ostream& soulng::util::LogFileWriter::LogFile()

Definition at line 26 of LogFileWriter.hpp :
26 { return logFile; }


Write Member Function

void soulng::util::LogFileWriter::Write(const std::string& s)

Definition at line 50 of LogFileWriter.cpp :
 51 {
 52     if (!open) return;
 53     logFile << s;
 54 }


Declaration at line 22 of LogFileWriter.hpp


WriteCurrentDateTime Member Function

void soulng::util::LogFileWriter::WriteCurrentDateTime()

Definition at line 31 of LogFileWriter.cpp :
 32 {
 33     if (!open) return;
 34     DateTime timestamp = GetCurrentDateTime();
 35     logFile << timestamp.ToString() << std::endl;
 36 }


Declaration at line 19 of LogFileWriter.hpp

Calls: soulng::util::DateTime::ToString


WriteLine Member Function

void soulng::util::LogFileWriter::WriteLine()

Definition at line 38 of LogFileWriter.cpp :
 39 {
 40     if (!open) return;
 41     logFile << std::endl;
 42 }


Declaration at line 20 of LogFileWriter.hpp

Called by: soulng::util::LogFileWriter::operator<<


WriteLine Member Function

void soulng::util::LogFileWriter::WriteLine(const std::string& line)

Definition at line 44 of LogFileWriter.cpp :
 45 {
 46     if (!open) return;
 47     logFile << line << std::endl;
 48 }


Declaration at line 21 of LogFileWriter.hpp


operator<< Member Function

LogFileWriter & soulng::util::LogFileWriter::operator<<(StandardEndLine manip)

Definition at line 24 of LogFileWriter.cpp :
 25 {
 26     if (!open) return *this;
 27     WriteLine();
 28     return *this;
 29 }


Declaration at line 25 of LogFileWriter.hpp

Calls: soulng::util::LogFileWriter::WriteLine


top | up | prev | next