WARPXM v1.10.0
Loading...
Searching...
No Matches
WxFileHandler Class Reference

Class to log messages to a file. More...

#include <wxlogrecordhandler.h>

Inheritance diagram for WxFileHandler:
WxLogRecordHandler WxObject

Detailed Description

Class to log messages to a file.

By default the file is truncated while opening it.

Public Member Functions

 WxFileHandler ()
 
 WxFileHandler (const std::string &fname, std::ios_base::openmode mode=std::ios_base::trunc)
 Create new handler to write log messages to specified file.
 
 ~WxFileHandler ()
 
void setup (const WxCryptSet &wxc)
 Setup handler from supplied cryptset.
 
- Public Member Functions inherited from WxLogRecordHandler
 WxLogRecordHandler ()
 Create new handler and attach std::cout to it.
 
virtual ~WxLogRecordHandler ()
 
void setStream (std::ostream *stream)
 Set the output stream to one specified.
 
void write (const std::string &msg)
 Write message 'msg' to the output stream.
 
void setOwns (bool handlerOwns)
 Set if the stream to which data is being written is owned by the handler.
 
bool owns () const
 Returns true if handler owns the stream and false otherwise.
 
- Public Member Functions inherited from WxObject
virtual ~WxObject ()
 Dtor: destroy object.
 
void setIo (WxIoBase &io)
 Set the I/O pointer for use in object.
 
void setMsg (WxMsgBase &msg)
 Set the msg pointer for use in object.
 
WxIoBasegetIo ()
 Return reference to I/O object.
 
const WxIoBasegetIo () const
 Return constant reference to I/O object.
 
WxMsgBasegetMsg ()
 Return reference to msg object.
 
const WxMsgBasegetMsg () const
 Return const reference to msg object.
 
virtual void setup (const WxCryptSet &wxc)
 Setup object using supplied crypset.
 
virtual void init ()
 Initialize the object.
 
virtual void finishBuild ()
 Finish building the object.
 
virtual void load (WxIoBase &io, const WxIoNodeType &grpNode)
 Load object from file.
 
virtual void dump (WxIoBase &io, WxIoNodeType &grpNode) const
 Dump object to file.
 
virtual std::string name () const
 Get name of object.
 
void setName (const std::string &nm)
 Set object's name.
 

Additional Inherited Members

- Protected Member Functions inherited from WxObject
 WxObject ()
 Create object, that will be initialized subsequently.
 
 WxObject (const std::string &name)
 Create object with given name bypassing object setup phase Protected because there is no reason to have a WxObject directly, as it is meant to be a parent class.
 

Constructor & Destructor Documentation

◆ WxFileHandler() [1/2]

WxFileHandler::WxFileHandler ( )
inline

◆ WxFileHandler() [2/2]

WxFileHandler::WxFileHandler ( const std::string &  fname,
std::ios_base::openmode  mode = std::ios_base::trunc 
)
inline

Create new handler to write log messages to specified file.

By default the file is truncated on opening. However, the open mode can be specified, for example, to append to an existing file.

◆ ~WxFileHandler()

WxFileHandler::~WxFileHandler ( )
inline

Member Function Documentation

◆ setup()

void WxFileHandler::setup ( const WxCryptSet wxc)
inlinevirtual

Setup handler from supplied cryptset.

Reimplemented from WxObject.


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