claw::file_logger Class Reference

This class write log messages in a file. More...

#include <log_stream.hpp>

Inheritance diagram for claw::file_logger:
claw::log_stream claw::concept::non_copyable

List of all members.

Public Member Functions

 file_logger (const std::string &filename)
 Constructor.
virtual ~file_logger ()
 Destructor.
virtual void write (const std::string &str)
 Write a string in the file.
virtual void flush ()
 Flush the stream.

Private Attributes

std::ofstream * m_file
 The file in which we write the messages.

Detailed Description

This class write log messages in a file.

Author:
Julien Jorge

Definition at line 80 of file log_stream.hpp.


Constructor & Destructor Documentation

claw::file_logger::file_logger ( const std::string &  filename  ) 

Constructor.

Definition at line 79 of file log_stream.cpp.

References m_file.

00080 {
00081   m_file = new std::ofstream( filename.c_str() );
00082 } // file_logger::file_logger()

claw::file_logger::~file_logger (  )  [virtual]

Destructor.

Definition at line 88 of file log_stream.cpp.

References m_file.

00089 {
00090   delete m_file;
00091 } // file_logger::~file_logger()


Member Function Documentation

void claw::file_logger::flush (  )  [virtual]

Flush the stream.

Reimplemented from claw::log_stream.

Definition at line 106 of file log_stream.cpp.

References m_file.

00107 {
00108   m_file->flush();
00109 } // file_logger::flush()

void claw::file_logger::write ( const std::string &  str  )  [virtual]

Write a string in the file.

Implements claw::log_stream.

Definition at line 97 of file log_stream.cpp.

00098 {
00099   (*m_file) << str;
00100 } // file_logger::write()


Member Data Documentation

std::ofstream* claw::file_logger::m_file [private]

The file in which we write the messages.

Definition at line 93 of file log_stream.hpp.

Referenced by file_logger(), flush(), and ~file_logger().


The documentation for this class was generated from the following files:

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1