| IGLib 1.4 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Attributes | Properties

# IG::Lib::CharacterBuffer Class Reference

CharacterBufferInterface wrapper for StringBilder. More...

Inheritance diagram for IG::Lib::CharacterBuffer:
[legend]
Collaboration diagram for IG::Lib::CharacterBuffer:
[legend]

List of all members.

## Public Member Functions
| CharacterBuffer ()
| CharacterBuffer (String str)
| CharacterBuffer (StringBuilder sb)
int | EnsureCapacity (int Capacity)
| Ensures that the buffer's current capacity is at least the specified number of bytes.
void | Delete (int startIndex, int length)
| Removes the specified section of the buffer.
void | Append (string str)
| Appends the specified string at the end of the buffer.
void | Append (char ch)
| Appends the specified character at the end of the buffer.
void | Append (char[] chArray)
| Appends the specified array of characters at the end of the buffer.
void | Append (List< char > chList)
| Inserts the specified list of characters at the end of the buffer.
void | Insert (int index, string str)
| Inserts the specified string at the specified position of the buffer.
void | Insert (int index, char ch)
| Inserts the specified character at the specified position of the buffer.
void | Insert (int index, char[] chArray)
| Inserts the specified array of characters at the specified position of the buffer.
void | Insert (int index, List< char > chList)
| Inserts the specified list of characters at the specified position of the buffer.
override string | ToString ()
| Saves buffer contents to string and returns it.
void | Save (string filePath, bool append)
| Saves buffer contents to a text file.
void | Save (string filePath)
| Saves buffer contents to a text file. If the file already exists then it is overwritten.
## Static Public Member Functions
static void | TestSpeed ()
| Compares speed of pure stringBuilder adnd of CharacterBuffer.
## Protected Attributes
StringBuilder | _str
## Properties
char | this [int index]`[get, set]`
| Character with the specified index.
int | Length`[get, set]`
| Current length of the buffer or object represented by the buffer.
int | Capacity`[get, set]`
| Buffer current capacity.

## Detailed Description

CharacterBufferInterface wrapper for StringBilder.

$A Igor Feb09;

## Constructor & Destructor Documentation

IG::Lib::CharacterBuffer::CharacterBuffer | ( |  | ) | `[inline]`

IG::Lib::CharacterBuffer::CharacterBuffer | ( | String | str | ) | `[inline]`

IG::Lib::CharacterBuffer::CharacterBuffer | ( | StringBuilder | sb | ) | `[inline]`

## Member Function Documentation

int IG::Lib::CharacterBuffer::EnsureCapacity | ( | int | Capacity | ) | `[inline]`

Ensures that the buffer's current capacity is at least the specified number of bytes.

Parameters:

  Capacity | Minimal capacity to be ensured.

Returns:
  Current capacity after the call.

Implements IG::Lib::ICharacterBufferReadOnly.

void IG::Lib::CharacterBuffer::Delete | ( | int | startIndex,
|  | int | length
| ) |  | `[inline]`

Removes the specified section of the buffer.

Parameters:

  startIndex | The first index of the removed text.
  length | Length of the removed section (number of characters removed).

Implements IG::Lib::ICharacterBuffer.

void IG::Lib::CharacterBuffer::Append | ( | string | str | ) | `[inline]`

Appends the specified string at the end of the buffer.

Implements IG::Lib::ICharacterBuffer.

void IG::Lib::CharacterBuffer::Append | ( | char | ch | ) | `[inline]`

Appends the specified character at the end of the buffer.

Implements IG::Lib::ICharacterBuffer.

void IG::Lib::CharacterBuffer::Append | ( | char[] | chArray | ) | `[inline]`

Appends the specified array of characters at the end of the buffer.

Implements IG::Lib::ICharacterBuffer.

void IG::Lib::CharacterBuffer::Append | ( | List< char > | chList | ) | `[inline]`

Inserts the specified list of characters at the end of the buffer.

Parameters:

  chList |

Implements IG::Lib::ICharacterBuffer.

void IG::Lib::CharacterBuffer::Insert | ( | int | index,
|  | string | str
| ) |  | `[inline]`

Inserts the specified string at the specified position of the buffer.

Implements IG::Lib::ICharacterBuffer.

void IG::Lib::CharacterBuffer::Insert | ( | int | index,
|  | char | ch
| ) |  | `[inline]`

Inserts the specified character at the specified position of the buffer.

Implements IG::Lib::ICharacterBuffer.

void IG::Lib::CharacterBuffer::Insert | ( | int | index,
|  | char[] | chArray
| ) |  | `[inline]`

Inserts the specified array of characters at the specified position of the buffer.

Implements IG::Lib::ICharacterBuffer.

void IG::Lib::CharacterBuffer::Insert | ( | int | index,
|  | List< char > | chList
| ) |  | `[inline]`

Inserts the specified list of characters at the specified position of the buffer.

Implements IG::Lib::ICharacterBuffer.

override string IG::Lib::CharacterBuffer::ToString | ( |  | ) | `[inline]`

Saves buffer contents to string and returns it.

Implements IG::Lib::ICharacterBufferReadOnly.

void IG::Lib::CharacterBuffer::Save | ( | string | filePath,
|  | bool | append
| ) |  | `[inline]`

Saves buffer contents to a text file.

Parameters:

  filePath | Path of the file where buffer is stored.
  append | Whether the file is appended. If true and if the file already exists then buffer contents are appended at the end of the file.

Implements IG::Lib::ICharacterBufferReadOnly.

void IG::Lib::CharacterBuffer::Save | ( | string | filePath | ) | `[inline]`

Saves buffer contents to a text file. If the file already exists then it is overwritten.

Parameters:

  filePath | Path of the file where buffer is stored.

Implements IG::Lib::ICharacterBufferReadOnly.

static void IG::Lib::CharacterBuffer::TestSpeed | ( |  | ) | `[inline, static]`

Compares speed of pure stringBuilder adnd of CharacterBuffer.

## Member Data Documentation

StringBuilder IG::Lib::CharacterBuffer::_str`[protected]`

## Property Documentation

char IG::Lib::CharacterBuffer::this[int index]`[get, set]`

Character with the specified index.

Implements IG::Lib::ICharacterBufferReadOnly.

int IG::Lib::CharacterBuffer::Length`[get, set]`

Current length of the buffer or object represented by the buffer.

Implements IG::Lib::ICharacterBufferReadOnly.

int IG::Lib::CharacterBuffer::Capacity`[get, set]`

Buffer current capacity.

Implements IG::Lib::ICharacterBufferReadOnly.

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

- StringParserBuffer.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events