API Guides > ConceptRT 3.x
BaseStaticString Class Reference

Basic static string class that handle fundamental string's functionalities. More...

Detailed Description

Basic static string class that handle fundamental string's functionalities.

+ Inheritance diagram for BaseStaticString:

Public Member Methods

 operator PCChar8 () const
 PCChar8 casting operator. More...
 
Int32 GetLength () const
 Gets the length. More...
 
BaseStaticStringoperator= (const BaseStaticString &right)
 Assignment operator. More...
 
BaseStaticStringoperator= (PCChar8 right)
 Assignment operator. More...
 
BaseStaticStringoperator= (Char8 right)
 Assignment operator. More...
 
BaseStaticStringoperator+= (PCChar8 right)
 Concatenation operator. More...
 
BaseStaticStringoperator+= (Char8 right)
 Concatenation operator. More...
 
Char8 GetAt (int charIndex) const
 Gets character at. More...
 
Char8 operator[] (int charIndex) const
 Array indexer operator. More...
 
Char8 operator[] (Int32 charIndex) const
 Array indexer operator. More...
 
void Left (BaseStaticString &result, Int32 count) const
 Extract the left part. More...
 
void Right (BaseStaticString &result, Int32 count) const
 Extract the right part. More...
 
void Mid (BaseStaticString &result, Int32 first, Int32 count) const
 Extract a string from this. More...
 
String Left (Int32 count) const
 Extract the left part. More...
 
String Right (Int32 count) const
 Extract the right part. More...
 
String Mid (Int32 first, Int32 count) const
 Extract a middle string. More...
 
void MakeUpper ()
 Makes upper. More...
 
void MakeLower ()
 Makes lower. More...
 
void TrimLeft ()
 Trim left. Removes blank characters on the left of the string. More...
 
void TrimRight ()
 Trim right. Removes blank characters on the right of the string. More...
 
void Trim ()
 Trim left and right. Removes blank characters on both side of the string. More...
 
bool Contains (Char8 c) const
 Query if this object contains the given character. More...
 
bool Contains (PCChar8 subString) const
 Query if this object contains the given subString. More...
 
void Replace (Char8 oldValue, Char8 newValue)
 Replaces a charactrer by another. More...
 
Int32 Find (Char8 c, Int32 start=0) const
 Searches for a character in the string. More...
 
Int32 Find (PCChar8 subString, Int32 start=0) const
 Searches for a subString in the string. More...
 
Int32 FindRightToLeft (Char8 c, Int32 start=-1) const
 Searches for a character from the left in the string. More...
 
Int32 FindRightToLeft (PCChar8 subString, Int32 start=-1) const
 Searches for a subString from the left in the string . More...
 
Int32 Compare (PCChar8 text) const
 Compare to the given string. More...
 
bool IsEmpty () const
 Query if the string is empty. More...
 
bool IsBool () const
 Query if this string contains a bool value. More...
 
bool IsInt (Int32 base=DefaultBase) const
 Query if this string contains an integer value. More...
 
bool IsFloat () const
 Query if this string contains a float value.. More...
 
void CheckBool () const
 Check bool. Raise an exception whenever the string doesn't contains a bool value. More...
 
void CheckInt (Int32 base=DefaultBase) const
 Check int. Raise an exception whenever the string doesn't contains an integer value. More...
 
void CheckFloat () const
 Check float. Raise an exception whenever the string doesn't contains a float value. More...
 
bool ValBool () const
 Convert the string in bool value. More...
 
Int32 ValInt (Int32 base=DefaultBase) const
 Convert the string in integer value. More...
 
UInt32 ValUInt (Int32 base=DefaultBase) const
 Convert the string in integer value. More...
 
Int64 ValInt64 () const
 Convert the string in integer value. More...
 
UInt64 ValUInt64 () const
 Convert the string in integer value. More...
 
Float64 ValFloat () const
 Convert the string in float value. More...
 
Int32 GetSize () const
 Gets the string size. More...
 

Methods Documentation

void CheckBool ( ) const

Check bool. Raise an exception whenever the string doesn't contains a bool value.

void CheckFloat ( ) const

Check float. Raise an exception whenever the string doesn't contains a float value.

void CheckInt ( Int32  base = DefaultBase) const

Check int. Raise an exception whenever the string doesn't contains an integer value.

Parameters
base(optional) the base.
Int32 Compare ( PCChar8  text) const

Compare to the given string.

Parameters
textGiven string.
Returns
Returns 0 if the strings are equal. Returns a value less than zero if the first character that does not match has a greater value in the given string than is this. Returns a value greater than zero if it is the opposite.
bool Contains ( Char8  c) const

Query if this object contains the given character.

Parameters
cThe character to test for containment.
Returns
true if the object is in this collection, false if not.
bool Contains ( PCChar8  subString) const

Query if this object contains the given subString.

Parameters
subStringThe subString to test for containment.
Returns
true if the object is in this collection, false if not.
Int32 Find ( Char8  c,
Int32  start = 0 
) const

Searches for a character in the string.

Parameters
cThe character to search.
start(optional) the search start position.
Returns
The position where the character has been found. Returns -1 if not found.
Int32 Find ( PCChar8  subString,
Int32  start = 0 
) const

Searches for a subString in the string.

Parameters
subStringThe subString to search.
start(optional) the search start position.
Returns
The position where the subString has been found. Returns -1 if not found.
Int32 FindRightToLeft ( Char8  c,
Int32  start = -1 
) const

Searches for a character from the left in the string.

Parameters
cThe character to search.
start(optional) the search start position.
Returns
The position where the character has been found. Returns -1 if not found.
Int32 FindRightToLeft ( PCChar8  subString,
Int32  start = -1 
) const

Searches for a subString from the left in the string .

Parameters
subStringThe subString to search.
start(optional) the search start position.
Returns
The position where the subString has been found. Returns -1 if not found.
Char8 GetAt ( int  charIndex) const

Gets character at.

Parameters
charIndexZero-based index of the character.
Returns
The caracter
RT Exceptions:
RT_ERROR_OUT_OF_BOUND_INDEX
Int32 GetLength ( ) const

Gets the length.

Returns
The length.
Int32 GetSize ( ) const
inline

Gets the string size.

Returns
The size.
bool IsBool ( ) const

Query if this string contains a bool value.

Returns
true if bool, false if not.
bool IsEmpty ( ) const

Query if the string is empty.

Returns
true if empty, false if not.
bool IsFloat ( ) const

Query if this string contains a float value..

Returns
true if float, false if not.
bool IsInt ( Int32  base = DefaultBase) const

Query if this string contains an integer value.

Parameters
base(optional) the base.
Returns
true if int, false if not.
void Left ( BaseStaticString result,
Int32  count 
) const

Extract the left part.

Parameters
result[in,out] String result.
countNumber of character.
String Left ( Int32  count) const

Extract the left part.

Parameters
countNumber of character.
Returns
The left part.

String is limited size string.

void MakeLower ( )

Makes lower.

void MakeUpper ( )

Makes upper.

void Mid ( BaseStaticString result,
Int32  first,
Int32  count 
) const

Extract a string from this.

Parameters
result[in,out] String result.
firstFirst character of the extraction.
countNumber of character of the extraction.
String Mid ( Int32  first,
Int32  count 
) const

Extract a middle string.

Parameters
firstFirst position of the extraction.
countNumber of character of the extraction.
Returns
.
operator PCChar8 ( ) const
inline

PCChar8 casting operator.

BaseStaticString& operator+= ( PCChar8  right)

Concatenation operator.

Parameters
rightThe right.
Returns
The result of the operation.
RT Exceptions:
RT_ERROR_UNEXPECTED_NULL_POINTER
BaseStaticString& operator+= ( Char8  right)

Concatenation operator.

Parameters
rightThe right.
Returns
The result of the operation.
RT Exceptions:
RT_ERROR_UNEXPECTED_NULL_POINTER
BaseStaticString& operator= ( const BaseStaticString right)

Assignment operator.

Parameters
rightThe right.
Returns
A shallow copy of this object.
BaseStaticString& operator= ( PCChar8  right)

Assignment operator.

Parameters
rightThe right.
Returns
A shallow copy of this object.
RT Exceptions:
RT_ERROR_UNEXPECTED_NULL_POINTER
BaseStaticString& operator= ( Char8  right)

Assignment operator.

Parameters
rightThe right.
Returns
A shallow copy of this object.
RT Exceptions:
RT_ERROR_UNEXPECTED_NULL_POINTER
Char8 operator[] ( int  charIndex) const

Array indexer operator.

Parameters
charIndexZero-based index of the character.
Returns
The indexed character.
RT Exceptions:
RT_ERROR_OUT_OF_BOUND_INDEX
Char8 operator[] ( Int32  charIndex) const

Array indexer operator.

Parameters
charIndexZero-based index of the character.
Returns
The indexed character.
RT Exceptions:
RT_ERROR_OUT_OF_BOUND_INDEX
void Replace ( Char8  oldValue,
Char8  newValue 
)

Replaces a charactrer by another.

Parameters
oldValueThe old character.
newValueThe new character.
void Right ( BaseStaticString result,
Int32  count 
) const

Extract the right part.

Parameters
result[in,out] String result.
countNumber of character.
String Right ( Int32  count) const

Extract the right part.

Parameters
countNumber of character.
Returns
The right part.

String is limited size string.

void Trim ( )

Trim left and right. Removes blank characters on both side of the string.

void TrimLeft ( )

Trim left. Removes blank characters on the left of the string.

void TrimRight ( )

Trim right. Removes blank characters on the right of the string.

bool ValBool ( ) const

Convert the string in bool value.

Returns
The bool value.
Float64 ValFloat ( ) const

Convert the string in float value.

Returns
The Float64 value.
Int32 ValInt ( Int32  base = DefaultBase) const

Convert the string in integer value.

Parameters
base(optional) the base.
Returns
The Int32 value.
Int64 ValInt64 ( ) const

Convert the string in integer value.

Returns
The Int64 value.
UInt32 ValUInt ( Int32  base = DefaultBase) const

Convert the string in integer value.

Parameters
base(optional) the base.
Returns
The UInt32 value.
UInt64 ValUInt64 ( ) const

Convert the string in integer value.

Returns
The UInt64 value.