Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

RpmDb::Logfile Class Reference

List of all members.

Public Member Functions

 Logfile ()
 ~Logfile ()
ostream & operator() (bool timestamp=false)

Static Public Member Functions

void setFname (const Pathname &fname_r)

Private Member Functions

 Logfile (const Logfile &)
Logfileoperator= (const Logfile &)

Static Private Member Functions

void openLog ()
void closeLog ()
void refUp ()
void refDown ()

Static Private Attributes

ofstream _log
unsigned _refcnt = 0
Pathname _fname

Detailed Description

Simple wrapper for progress log. Refcnt, filename and corresponding ofstream are static members. Logfile constructor raises, destructor lowers refcounter. On refcounter changing from 0->1, file is opened. Changing from 1->0 the file is closed. Thus Logfile objects should be local to those functions, writing the log, and must not be stored permanently;

Usage: some methothd () { Logfile progresslog; ... progresslog() << "some message" << endl; ... }


Constructor & Destructor Documentation

RpmDb::Logfile::Logfile const Logfile  )  [private]
 

RpmDb::Logfile::Logfile  )  [inline]
 

RpmDb::Logfile::~Logfile  )  [inline]
 


Member Function Documentation

void RpmDb::Logfile::closeLog  )  [inline, static, private]
 

void RpmDb::Logfile::openLog  )  [inline, static, private]
 

ostream& RpmDb::Logfile::operator() bool  timestamp = false  )  [inline]
 

Logfile& RpmDb::Logfile::operator= const Logfile  )  [private]
 

void RpmDb::Logfile::refDown  )  [inline, static, private]
 

void RpmDb::Logfile::refUp  )  [inline, static, private]
 

void RpmDb::Logfile::setFname const Pathname fname_r  )  [inline, static]
 


Member Data Documentation

Pathname RpmDb::Logfile::_fname [static, private]
 

ofstream RpmDb::Logfile::_log [static, private]
 

unsigned RpmDb::Logfile::_refcnt = 0 [static, private]
 


The documentation for this class was generated from the following file:
Generated on Fri Nov 9 14:30:33 2007 for yast2-packagemanager by doxygen 1.3.6