tool::datafile Struct Reference

Output file which creation/opening is delayed until the first output. More...

#include <wipal/tool/datafile.hh>

Inheritance diagram for tool::datafile:

wifi::addr_mapping

List of all members.

Public Member Functions

 datafile (const std::string &)
 operator std::ostream & ()
template<class T>
std::ostream & operator<< (const T &)


Detailed Description

Output file which creation/opening is delayed until the first output.

A datafile object represents an output file. It may be casted to std::ostream& and has an << operator for formatted outputs. The main difference with std::ofstream is the file is not opened until the corresponding stream is effectively solicited. Thus, if the file does not exist on the filesystem and no operation is performed on it, no file will be created.

Unlike std::ostream, datafile is copy-constructible.


Constructor & Destructor Documentation

tool::datafile::datafile ( const std::string &  filename  )  [inline]

Construct a datafile object given a filename.


Member Function Documentation

tool::datafile::operator std::ostream & (  )  [inline]

Retrieve the underlying C++ stream.

template<class T>
std::ostream & tool::datafile::operator<< ( const T &  data  )  [inline]

Formatted output.


The documentation for this struct was generated from the following files:
Generated on Wed Jan 16 16:15:14 2008 for wipal by  doxygen 1.5.4