String Class Reference

Class defining a string. More...

Functions

 String ()
 Default constructor. More...
 
 ~String ()
 Default destructor. More...
 
 String (const String &str)
 Copy constructor. More...
 
 String (const char *data)
 Constructor. More...
 
void set (const char *data)
 Sets the value of the sl::String. More...
 
const char * get () const
 Returns the value of the sl::String. More...
 
bool empty () const
 Checks if the sl::String is empty. More...
 
Stringoperator= (const String &str1)
 Copy the value of another sl::String. More...
 
Stringoperator= (const char *data)
 Copy the value of a char*. More...
 
 operator const char * ()
 Convert the sl::String into a char*. More...
 
const char * c_str () const
 Returns the sl::String as a char*. More...
 
size_t size ()
 Returns the size of the sl::String. More...
 
void clear ()
 Empties the sl::String. More...
 
bool operator== (const String &s) const
 Checks that the value of the current sl::String is equal to the value of another sl::String. More...
 
bool operator!= (const String &s) const
 Checks that the value of the current sl::String is different to the value of another sl::String. More...
 
bool operator< (const String &s) const
 Checks if the value of the current sl::String is lexicographically less than the value of another sl::String. More...
 

Detailed Description

Class defining a string.

Constructor and Destructor

◆ String() [1/3]

String ( )

Default constructor.

◆ ~String()

~String ( )

Default destructor.

◆ String() [2/3]

String ( const String str)

Copy constructor.

◆ String() [3/3]

String ( const char *  data)

Constructor.

Functions

◆ set()

void set ( const char *  data)

Sets the value of the sl::String.

◆ get()

const char* get ( ) const

Returns the value of the sl::String.

◆ empty()

bool empty ( ) const

Checks if the sl::String is empty.

◆ operator=() [1/2]

String& operator= ( const String str1)

Copy the value of another sl::String.

◆ operator=() [2/2]

String& operator= ( const char *  data)

Copy the value of a char*.

◆ operator const char *()

operator const char * ( )
inline

Convert the sl::String into a char*.

◆ c_str()

const char* c_str ( ) const

Returns the sl::String as a char*.

Referenced by sl::operator<<().

◆ size()

size_t size ( )

Returns the size of the sl::String.

◆ clear()

void clear ( )

Empties the sl::String.

◆ operator==()

bool operator== ( const String s) const

Checks that the value of the current sl::String is equal to the value of another sl::String.

◆ operator!=()

bool operator!= ( const String s) const

Checks that the value of the current sl::String is different to the value of another sl::String.

◆ operator<()

bool operator< ( const String s) const

Checks if the value of the current sl::String is lexicographically less than the value of another sl::String.

Parameters
otherThe sl::String to compare with the current sl::String.
Returns
true if the current sl::String is lexicographically less than the other sl::String, otherwise false.