C++ API Library Reference  4.3.2-74-ge1d4cca
Classes | Public Functions | List of all members
StringBuilder Class Reference

The StringBuilder class is used to build strings.

The ToString() method returns a String version of the contents of StringBuffer. This is usually an efficient operation that does not require a copy. If StringBuilder is reused after it has handed over its internal buffer to a String, then it will reallocate a new internal buffer.

Public Functions

void Append (char value, SizeType count=1)
 
void Append (Char16 value, SizeType count=1)
 
void Append (Char32 value, SizeType count=1)
 
void Append (String const &value, SizeType offset=0, SizeType count=Everything)
 
void Append (Utf8Array const &value, SizeType offset=0, SizeType count=Everything)
 
void Append (Utf16Array const &value, SizeType offset=0, SizeType count=Everything)
 
void Append (AsciiArray const &value, SizeType offset=0, SizeType count=Everything)
 
void Append (char const *pszValue, SizeType count=Everything)
 
template<typename T >
void Append (T const &value)
 
void Clear ()
 
bool IsEmpty () const
 
SizeType Length () const
 
Char16 & operator[] (SizeType index)
 
Char16 operator[] (SizeType index) const
 
void RemoveAt (SizeType offset, SizeType count=1)
 
void RemoveEnd (SizeType count)
 
void RemoveStart (SizeType count)
 
String Substring (SizeType start, SizeType count=Everything) const
 
String ToString ()
 
void Trim (String const &chars=String::Empty())
 
void TrimEnd (String const &chars=String::Empty())
 
void TrimStart (String const &chars=String::Empty())
 
Constructors and Destructors
 StringBuilder ()
 
 StringBuilder (char value, SizeType count=1)
 
 StringBuilder (Char16 value, SizeType count=1)
 
 StringBuilder (Char32 value, SizeType count=1)
 
 StringBuilder (String const &value, SizeType offset=0, SizeType count=Everything)
 
 StringBuilder (Utf8Array const &value, SizeType offset=0, SizeType count=Everything)
 
 StringBuilder (Utf16Array const &value, SizeType offset=0, SizeType count=Everything)
 
 StringBuilder (AsciiArray const &value, SizeType offset=0, SizeType count=Everything)
 
 StringBuilder (char const *pszValue, SizeType count=Everything)
 
 ~StringBuilder ()
 

Usage Description

void Append ( char  value,
SizeType  count = 1 
)

Appends the specified value to this instance.

void Append ( Char16  value,
SizeType  count = 1 
)

Appends the specified value to this instance.

void Append ( Char32  value,
SizeType  count = 1 
)

Appends the specified value to this instance.

void Append ( String const &  value,
SizeType  offset = 0,
SizeType  count = Everything 
)

Appends the specified value to this instance.

void Append ( Utf8Array const &  value,
SizeType  offset = 0,
SizeType  count = Everything 
)

Appends the specified value to this instance.

void Append ( Utf16Array const &  value,
SizeType  offset = 0,
SizeType  count = Everything 
)

Appends the specified value to this instance.

void Append ( AsciiArray const &  value,
SizeType  offset = 0,
SizeType  count = Everything 
)

Appends the specified value to this instance.

void Append ( char const *  pszValue,
SizeType  count = Everything 
)

Appends the specified value to this instance.

void Append ( T const &  value)
inline
void Clear ( )

Clears the current instance.

bool IsEmpty ( ) const
inline
SizeType Length ( ) const
inline

Gets length of string, in code units.

Char16& operator[] ( SizeType  index)
Char16 operator[] ( SizeType  index) const
void RemoveAt ( SizeType  offset,
SizeType  count = 1 
)

Removes count code units(s), starting at the character containing the specified code unit offset.

void RemoveEnd ( SizeType  count)

Removes the specified number of code units from the end.

void RemoveStart ( SizeType  count)

Removes the specified number of code units from the start.

String Substring ( SizeType  start,
SizeType  count = Everything 
) const
String ToString ( )

Converts the contents of the builder to a string.

void Trim ( String const &  chars = String::Empty())

Trims the specified chars trimmed from the start and end. If chars is not specified, all whitespace characters are removed.

void TrimEnd ( String const &  chars = String::Empty())

Trims the specified chars trimmed from the end. If chars is not specified, all whitespace characters are removed.

void TrimStart ( String const &  chars = String::Empty())

Trims the specified chars trimmed from the start. If chars is not specified, all whitespace characters are removed.