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

- Main Page
- Namespaces
- Classes
- Files

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Protected Attributes | Properties | List of all members
IG.Lib.CharacterBuffer Class Reference

CharacterBufferInterface wrapper for StringBilder. More...

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

## 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. More...
void | Delete (int startIndex, int length)
| Removes the specified section of the buffer. More...
void | Append (string str)
| Appends the specified string at the end of the buffer. More...
void | Append (char ch)
| Appends the specified character at the end of the buffer. More...
void | Append (char[] chArray)
| Appends the specified array of characters at the end of the buffer. More...
void | Append (List< char > chList)
| Inserts the specified list of characters at the end of the buffer. More...
void | Insert (int index, string str)
| Inserts the specified string at the specified position of the buffer. More...
void | Insert (int index, char ch)
| Inserts the specified character at the specified position of the buffer. More...
void | Insert (int index, char[] chArray)
| Inserts the specified array of characters at the specified position of the buffer. More...
void | Insert (int index, List< char > chList)
| Inserts the specified list of characters at the specified position of the buffer. More...
override string | ToString ()
| Saves buffer contents to string and returns it. More...
void | Save (string filePath, bool append)
| Saves buffer contents to a text file. More...
void | Save (string filePath)
| Saves buffer contents to a text file. If the file already exists then it is overwritten. More...

## Static Public Member Functions
static void | TestSpeed ()
| Compares speed of pure stringBuilder adnd of CharacterBuffer. More...

## Protected Attributes
StringBuilder | _str

## Properties
char | this[int index]`[get, set]`
| Character with the specified index. More...
int | Length`[get, set]`
| Current length of the buffer or object represented by the buffer. More...
int | Capacity`[get, set]`
| Buffer current capacity. More...
Properties inherited from IG.Lib.ICharacterBuffer
new char | this[int index]`[get, set]`
| Character with the specified index. More...
Properties inherited from IG.Lib.ICharacterBufferReadOnly
int | Length`[get, set]`
| Current length of the buffer or object represented by the buffer. More...
int | Capacity`[get, set]`
| Buffer current capacity. More...
char | this[int index]`[get]`
| Character with the specified index. More...

## 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.

References IG.Lib.CharacterBuffer.Length, IG.Lib.StopWatch1.Reset(), IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), and IG.Lib.StopWatch1.Time.

## 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.

int IG.Lib.CharacterBuffer.Length
| get set

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

Referenced by IG.Lib.CharacterBuffer.TestSpeed().

int IG.Lib.CharacterBuffer.Capacity
| get set

Buffer current capacity.

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

- igbase/data/StringParserBuffer.cs