CLI  2.9
String Class Reference

CLI classes toolkit. More...

#include <tk_stl.h>

Inheritance diagram for String:

Public Member Functions

 String (const unsigned int UI_MaxLen)
 Constructor. More...
 
 String (const unsigned int UI_MaxLen, const char *const STR_String)
 Initial value constructor. More...
 
 String (const String &TK_String)
 Copy constructor. More...
 
virtual ~String (void)
 Destructor. More...
 
const unsigned int GetLength (void) const
 String length accessor. More...
 
const bool IsEmpty (void) const
 Checks whether the string is empty or not. More...
 
 operator const char *const (void) const
 Conversion operator. More...
 
const char GetChar (const unsigned int UI_Pos) const
 Single character accessor. More...
 
const tk::String SubString (const unsigned int UI_FirstCharacter, const int I_SubStringLength) const
 Sub-string computation. More...
 
const String ToUpper (void) const
 Upper string transformation. More...
 
const String ToLower (void) const
 Lower string transformation. More...
 
const bool Reset (void)
 String resetting. More...
 
const bool Set (const char *const STR_String)
 String setting. More...
 
const bool Append (const char *const STR_String)
 String appending. More...
 
const bool Append (const char C_Character)
 String appending. More...
 
tk::String & operator= (const tk::String &STR_String)
 Assignment operator. More...
 

Static Public Member Functions

static const tk::String Concat (const unsigned int UI_MaxLength, const char *const STR_1, const char *const STR_2)
 Concatenation. More...
 
static const tk::String Concat (const unsigned int UI_MaxLength, const char *const STR_1, const char *const STR_2, const char *const STR_3)
 Concatenation. More...
 
static const tk::String Concat (const unsigned int UI_MaxLength, const char *const STR_1, const char *const STR_2, const char *const STR_3, const char *const STR_4)
 Concatenation. More...
 
static const tk::String Concat (const unsigned int UI_MaxLength, const char *const STR_1, const char *const STR_2, const char *const STR_3, const char *const STR_4, const char *const STR_5)
 Concatenation. More...
 

Detailed Description

CLI classes toolkit.

Basic string object.

Definition at line 51 of file tk_stl.h.

Constructor & Destructor Documentation

◆ String() [1/3]

String::String ( const unsigned int  UI_MaxLen)
inlineexplicit

Constructor.

Parameters
UI_MaxLenMaximum string length.

Definition at line 119 of file tk_stl.h.

References UnusedParameter().

◆ String() [2/3]

String::String ( const unsigned int  UI_MaxLen,
const char *const  STR_String 
)
inlineexplicit

Initial value constructor.

Warning
Maximum length inherits the initial string value. Objects initialized by this constructor might be constants in general.
Parameters
UI_MaxLenMaximum string length.
STR_StringInitial value.

Definition at line 130 of file tk_stl.h.

References UnusedParameter().

◆ String() [3/3]

String::String ( const String TK_String)
inline

Copy constructor.

Parameters
TK_StringSource object.

Definition at line 140 of file tk_stl.h.

◆ ~String()

virtual String::~String ( void  )
inlinevirtual

Destructor.

Definition at line 148 of file tk_stl.h.

Member Function Documentation

◆ Append() [1/2]

const bool String::Append ( const char *const  STR_String)
inline

String appending.

Returns
true when success, false otherwise.
Parameters
STR_StringString to append.

Definition at line 279 of file tk_stl.h.

◆ Append() [2/2]

const bool String::Append ( const char  C_Character)
inline

String appending.

Returns
true when success, false otherwise.
Parameters
C_CharacterCharacter to append.

Definition at line 289 of file tk_stl.h.

◆ Concat() [1/4]

static const tk::String String::Concat ( const unsigned int  UI_MaxLength,
const char *const  STR_1,
const char *const  STR_2 
)
inlinestatic

Concatenation.

Returns
Result string.
Parameters
UI_MaxLengthMaximum length.
STR_1First string.
STR_2Second string.

Definition at line 56 of file tk_stl.h.

◆ Concat() [2/4]

static const tk::String String::Concat ( const unsigned int  UI_MaxLength,
const char *const  STR_1,
const char *const  STR_2,
const char *const  STR_3 
)
inlinestatic

Concatenation.

Returns
Result string.
Parameters
UI_MaxLengthMaximum length.
STR_1First string.
STR_2Second string.
STR_3Third string.

Definition at line 70 of file tk_stl.h.

◆ Concat() [3/4]

static const tk::String String::Concat ( const unsigned int  UI_MaxLength,
const char *const  STR_1,
const char *const  STR_2,
const char *const  STR_3,
const char *const  STR_4 
)
inlinestatic

Concatenation.

Returns
Result string.
Parameters
UI_MaxLengthMaximum length.
STR_1First string.
STR_2Second string.
STR_3Third string.
STR_4Fourth string.

Definition at line 84 of file tk_stl.h.

◆ Concat() [4/4]

static const tk::String String::Concat ( const unsigned int  UI_MaxLength,
const char *const  STR_1,
const char *const  STR_2,
const char *const  STR_3,
const char *const  STR_4,
const char *const  STR_5 
)
inlinestatic

Concatenation.

Returns
Result string.
Parameters
UI_MaxLengthMaximum length.
STR_1First string.
STR_2Second string.
STR_3Third string.
STR_4Fourth string.
STR_5Fifth string.

Definition at line 99 of file tk_stl.h.

◆ GetChar()

const char String::GetChar ( const unsigned int  UI_Pos) const
inline

Single character accessor.

Returns
Character at the given position. Null character when the position is out of bounds.
Parameters
UI_PosCharacter position from the beginning of the string.

Definition at line 175 of file tk_stl.h.

◆ GetLength()

const unsigned int String::GetLength ( void  ) const
inline

String length accessor.

Returns
String length.

Definition at line 155 of file tk_stl.h.

◆ IsEmpty()

const bool String::IsEmpty ( void  ) const
inline

Checks whether the string is empty or not.

Returns
true for an empty string, false otherwise.

Definition at line 162 of file tk_stl.h.

◆ operator const char *const()

String::operator const char *const ( void  ) const
inline

Conversion operator.

Definition at line 168 of file tk_stl.h.

◆ operator=()

tk::String& String::operator= ( const tk::String &  STR_String)
inline

Assignment operator.

Returns
The string just assigned itself.
Warning
Prefer Set() method since this method does not indicate failures.
Parameters
STR_StringSource string used for assignment.

Definition at line 300 of file tk_stl.h.

◆ Reset()

const bool String::Reset ( void  )
inline

String resetting.

Returns
true when success, false otherwise.

Definition at line 261 of file tk_stl.h.

◆ Set()

const bool String::Set ( const char *const  STR_String)
inline

String setting.

Returns
true when success, false otherwise.
Parameters
STR_StringString to set.

Definition at line 269 of file tk_stl.h.

◆ SubString()

const tk::String String::SubString ( const unsigned int  UI_FirstCharacter,
const int  I_SubStringLength 
) const
inline

Sub-string computation.

Returns
Computed sub-string.
Parameters
UI_FirstCharacterFirst character position.
I_SubStringLengthSub-string length. negative values mean 0.

Definition at line 189 of file tk_stl.h.

◆ ToLower()

const String String::ToLower ( void  ) const
inline

Lower string transformation.

Returns
Lower string computed.

Definition at line 236 of file tk_stl.h.

◆ ToUpper()

const String String::ToUpper ( void  ) const
inline

Upper string transformation.

Returns
Upper string computed.

Definition at line 213 of file tk_stl.h.


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