Manages a line buffer of unicode string. More...
#include <decUnicodeLineBuffer.h>
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 decUnicodeString * | GetLineAt (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. | |
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.
| decUnicodeLineBuffer::decUnicodeLineBuffer | ( | int | initialSize ) |
Creates a new line buffer object.
| decUnicodeLineBuffer::~decUnicodeLineBuffer | ( | ) |
Frees the line buffer object.
| 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.
1.7.2