C# Class Majestic12.DynaString

Class for fast dynamic string building - it is faster than StringBuilder
Inheritance: IDisposable
Mostra file Open project: arktronic/sevenauth Class Usage Examples

Public Properties

Property Type Description
TEXT_CAPACITY int
bBuffer byte[]
iBufPos int
sText string

Public Methods

Method Description
Append ( char cChar ) : void

Appends proper char with smart handling of Unicode chars

Clear ( ) : void

Resets object to zero length string

Dispose ( ) : void
SetEncoding ( Encoding p_oEnc ) : void

Sets encoding to be used for conversion of binary data into string

Private Methods

Method Description
Dispose ( bool bDisposing ) : void
DynaString ( string sString ) : System

Constructor

SetToString ( ) : string

Creates string from buffer using set encoder

SetToStringASCII ( ) : string

Creates string from buffer using default encoder

Method Details

Append() public method

Appends proper char with smart handling of Unicode chars
public Append ( char cChar ) : void
cChar char Char to append
return void

Clear() public method

Resets object to zero length string
public Clear ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

SetEncoding() public method

Sets encoding to be used for conversion of binary data into string
public SetEncoding ( Encoding p_oEnc ) : void
p_oEnc System.Text.Encoding Encoding object
return void

Property Details

TEXT_CAPACITY public_oe static_oe property

CRITICAL: that much capacity will be allocated (once) for this object -- for performance reasons we do NOT have range checks because we make reasonably safe assumption that accumulated string will fit into the buffer. If you have very abnormal strings then you should increase buffer accordingly.
public static int TEXT_CAPACITY
return int

bBuffer public_oe property

public byte[] bBuffer
return byte[]

iBufPos public_oe property

public int iBufPos
return int

sText public_oe property

Finalised text will be available in this string
public string sText
return string