Workspace 6.21.5
Public Member Functions | List of all members
MockLogStream Class Reference

#include <Workspace/testcommon.h>

Inheritance diagram for MockLogStream:
[legend]

Public Member Functions

 ~MockLogStream () override
 
void flush () override
 
QString getStreamContents ()
 
bool isStreamOkay () const override
 
QString popStreamContents ()
 
void sendText (const QString &msg) override
 
void sendText (const QString &msg, const QDateTime &) override
 
- Public Member Functions inherited from LogStream
virtual ~LogStream ()
 
virtual void flush ()=0
 
virtual bool isStreamOkay () const =0
 
void logText (const QString &msg, const QDateTime &timestamp)
 

Constructor & Destructor Documentation

◆ ~MockLogStream()

~MockLogStream ( )
inlineoverride

Member Function Documentation

◆ flush()

void flush ( )
inlineoverridevirtual

Clients would not normally need to call this function, but if for some reason they want to be sure that all logged text has been sent to where it needs to go before performing some task, they can call flush(). When flush() returns, all underlying streams and buffers associated with the LogStream object will have been flushed to disk, etc.

Implements LogStream.

◆ getStreamContents()

QString getStreamContents ( )
inline

◆ isStreamOkay()

bool isStreamOkay ( ) const
inlineoverridevirtual
Returns
True if the stream is able to accept text for writing.

Implements LogStream.

◆ popStreamContents()

QString popStreamContents ( )
inline

◆ sendText() [1/2]

void sendText ( const QString &  msg)
inlineoverridevirtual
Parameters
msgThe text to be sent to the stream.

This function is called by logText() with the expectation that msg will be sent to the relevant place by the subclass' implementation. It's now preferred to override the 3 parameters version of sendText to handle additional information properly.If the 3 parameters version is overridden, this method won't be used.

Reimplemented from LogStream.

◆ sendText() [2/2]

void sendText ( const QString &  msg,
const QDateTime &   
)
inlineoverridevirtual
Parameters
msgThe text to be sent to the stream.

This function is called by logText() with the expectation that msg will be sent to the relevant place by the subclass' implementation. Please override this only.

Reimplemented from LogStream.