IrrIMGUI  0.3.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
IrrIMGUI::Debug::CChannelBuffer Class Reference

Is a stream channel buffer, that adds to each new line a defined prefix. More...

#include <IrrIMGUIDebug.h>

Inheritance diagram for IrrIMGUI::Debug::CChannelBuffer:
Inheritance graph
[legend]
Collaboration diagram for IrrIMGUI::Debug::CChannelBuffer:
Collaboration graph
[legend]

Public Member Functions

 CChannelBuffer (std::streambuf *pStreamBuffer, char const *pPrefix)
 Constructor. More...
 
virtual ~CChannelBuffer (void)
 Destructor. More...
 
void setupBuffer (std::streambuf *pStreamBuffer, bool NextSymbolOnNewLine)
 Setups a new output buffer. More...
 
void setupPrefix (char const *pPrefix)
 Setups a new prefix. More...
 

Private Member Functions

virtual int overflow (int Character=EOF)
 Since this is not a real buffer, this method is called for each character that is written to this stream buffer. More...
 
virtual int sync (void)
 This methods synchronizes the buffer. More...
 
bool printPrefix (void)
 Prints the prefix. More...
 

Private Attributes

char const * mpPrefix
 The prefix that should be written at the beginning of each new line. More...
 
std::streambuf * mpBuffer
 The stream buffer where the output should be put in. More...
 
bool mIsNewLine
 Is true, when the next char should be written to a new line. More...
 

Detailed Description

Is a stream channel buffer, that adds to each new line a defined prefix.

Definition at line 56 of file IrrIMGUIDebug.h.

Constructor & Destructor Documentation

IrrIMGUI::Debug::CChannelBuffer::CChannelBuffer ( std::streambuf *  pStreamBuffer,
char const *  pPrefix 
)

Constructor.

Parameters
pStreamBufferIs a pointer to a stream buffer, where all input data should be written to.
pPrefixIs a prefix string that should be added before each new line.

Definition at line 42 of file CChannelBuffer.cpp.

virtual IrrIMGUI::Debug::CChannelBuffer::~CChannelBuffer ( void  )
inlinevirtual

Destructor.

Definition at line 67 of file IrrIMGUIDebug.h.

Member Function Documentation

int IrrIMGUI::Debug::CChannelBuffer::overflow ( int  Character = EOF)
privatevirtual

Since this is not a real buffer, this method is called for each character that is written to this stream buffer.

Parameters
CharacterIs the character that shall be written.
Returns
Returns EOF if the original buffer returns it.

Definition at line 63 of file CChannelBuffer.cpp.

Here is the call graph for this function:

bool IrrIMGUI::Debug::CChannelBuffer::printPrefix ( void  )
private

Prints the prefix.

Returns
Returns true when prefix print was successful.

Definition at line 113 of file CChannelBuffer.cpp.

Here is the caller graph for this function:

void IrrIMGUI::Debug::CChannelBuffer::setupBuffer ( std::streambuf *  pStreamBuffer,
bool  NextSymbolOnNewLine 
)

Setups a new output buffer.

Parameters
pStreamBufferIs a pointer to a output buffer. If this pointer is NULL or nullptr, no output is generated anymore.
NextSymbolOnNewLineMust be true, when the next symbol should start at a new line.

Definition at line 50 of file CChannelBuffer.cpp.

void IrrIMGUI::Debug::CChannelBuffer::setupPrefix ( char const *  pPrefix)

Setups a new prefix.

Parameters
pPrefixIs a prefix string that should be added before each new line.

Definition at line 57 of file CChannelBuffer.cpp.

int IrrIMGUI::Debug::CChannelBuffer::sync ( void  )
privatevirtual

This methods synchronizes the buffer.

Returns
Returns -1 when the buffer indicates an error, otherwise it returns 0.

Definition at line 98 of file CChannelBuffer.cpp.

Member Data Documentation

bool IrrIMGUI::Debug::CChannelBuffer::mIsNewLine
private

Is true, when the next char should be written to a new line.

Definition at line 103 of file IrrIMGUIDebug.h.

std::streambuf* IrrIMGUI::Debug::CChannelBuffer::mpBuffer
private

The stream buffer where the output should be put in.

Definition at line 100 of file IrrIMGUIDebug.h.

char const* IrrIMGUI::Debug::CChannelBuffer::mpPrefix
private

The prefix that should be written at the beginning of each new line.

Definition at line 97 of file IrrIMGUIDebug.h.


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