decUnicodeLineBuffer Class Reference

Manages a line buffer of unicode string. More...

#include <decUnicodeLineBuffer.h>

List of all members.

Public Member Functions

Constructors and Destructors
 decUnicodeLineBuffer (int initialSize)
 Creates a new line buffer object.
 ~decUnicodeLineBuffer ()
 Frees the line buffer object.
Management
int GetLineCount () const
 Retrieves the number of lines in the buffer.
int GetBufferSize () const
 Retrieves the size of the line buffer.
void SetBufferSize (int bufferSize)
 Sets the size of the line buffer.
const decUnicodeStringGetLineAt (int line) const
 Retrieves the string at the given line with 0 being the most recent line.
void AddLine (const decUnicodeString &line)
 Adds a string to the end of the list and discards lines beyond the buffer size.
void Clear ()
 Clears the line buffer.
void AddMultipleLines (const decUnicodeString &lines)
 Convenience function for adding lines separated by newlines.
void FillLinesInto (decUnicodeString &string)
 Fills a unicode string with all lines separated by newlines.

Detailed Description

Manages a line buffer of unicode string.

Unicode buffer lists are useful for logging purpose or any other situation where holding a number of text lines in memory with easy line rotation. New unicode strings are added to the end of the list. If the number of lines increases above a given threshold all lines beyond are removed. Best example for this are consoles which hold the most recent lines.

Author:
Plüss Roland
Version:
1.0
Date:
2008

Constructor & Destructor Documentation

decUnicodeLineBuffer::decUnicodeLineBuffer ( int  initialSize )

Creates a new line buffer object.

decUnicodeLineBuffer::~decUnicodeLineBuffer (  )

Frees the line buffer object.


Member Function Documentation

void decUnicodeLineBuffer::AddLine ( const decUnicodeString line )

Adds a string to the end of the list and discards lines beyond the buffer size.

void decUnicodeLineBuffer::AddMultipleLines ( const decUnicodeString lines )

Convenience function for adding lines separated by newlines.

Breaks up the provided string into individual lines and adds them.

void decUnicodeLineBuffer::Clear (  )

Clears the line buffer.

void decUnicodeLineBuffer::FillLinesInto ( decUnicodeString string )

Fills a unicode string with all lines separated by newlines.

int decUnicodeLineBuffer::GetBufferSize (  ) const [inline]

Retrieves the size of the line buffer.

All lines beyond this limit are discarded automatically.

const decUnicodeString* decUnicodeLineBuffer::GetLineAt ( int  line ) const

Retrieves the string at the given line with 0 being the most recent line.

int decUnicodeLineBuffer::GetLineCount (  ) const [inline]

Retrieves the number of lines in the buffer.

void decUnicodeLineBuffer::SetBufferSize ( int  bufferSize )

Sets the size of the line buffer.

All lines beyond this limit are discarded automatically.


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