Simple Application Framework  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions
Saf::Text::String Class Reference

#include <String.h>

List of all members.

Public Member Functions

 String ()
 Constructor.
 String (Size count, const Char &c)
 Constructor.
 String (const char *str)
 Constructor.
 String (const String &str)
 Copy constructor.
 ~String ()
 Destructor.
Size CodePoints () const
 Get number of code points in the string.
Size Elements () const
 Get number of code points in the string.
bool IsEmpty () const
 Returns true if the string is empty.
String Left (Size sz) const
 Get left part of the string.
String Lower () const
 Get lowercase version of the string.
String Mid (Size pos, Size sz) const
 Get substring.
String operator+ (const String &str) const
 Concatenation operator.
bool operator< (const String &str) const
 Comparison operator.
Stringoperator= (const String &str)
 Assignment operator.
bool operator== (const String &str) const
 Comparison operator.
Char operator[] (Size n) const
 Return character at given position.
String Pad (const Char &ch, Size left, Size right) const
 Pad the string with given character.
String Reverse () const
 Returns a reversed string.
String Right (Size sz) const
 Get right part of the string.
void Swap (String &s)
 Swap the content of two strings.
String Trim (bool left, bool right) const
 Trim the string.
String Upper () const
 Get uppercase version of the string.

Protected Member Functions

void Free ()
 Free memory occupied by the string.
void Resize (Size sz)
 Resize string.

Detailed Description

Todo:

Non-modifiable.

Nepouzit na ulozeni UTF-16 - Win (StringCompareEx), Mac?, Linux? Nemuselo by se transformovat. [] by vracelo Char a ne Char&

Imutable.

Todo:
Documentation.
        Uses UTF-32 (UCS-4) encoding.

Constructor & Destructor Documentation

Constructor.

Saf::Text::String::String ( Size  count,
const Char c 
)

Constructor.

Saf::Text::String::String ( const char *  str)

Constructor.

Saf::Text::String::String ( const String str) [inline]

Copy constructor.

Destructor.


Member Function Documentation

Size Saf::Text::String::CodePoints ( ) const [inline]

Get number of code points in the string.

Size Saf::Text::String::Elements ( ) const [inline]

Get number of code points in the string.

void Saf::Text::String::Free ( ) [protected]

Free memory occupied by the string.

bool Saf::Text::String::IsEmpty ( ) const [inline]

Returns true if the string is empty.

String Saf::Text::String::Left ( Size  sz) const [inline]

Get left part of the string.

Todo:
Kontrola na sz a Exception.

Get lowercase version of the string.

String Saf::Text::String::Mid ( Size  pos,
Size  sz 
) const

Get substring.

String Saf::Text::String::operator+ ( const String str) const

Concatenation operator.

bool Saf::Text::String::operator< ( const String str) const

Comparison operator.

String & Saf::Text::String::operator= ( const String str)

Assignment operator.

bool Saf::Text::String::operator== ( const String str) const

Comparison operator.

Char Saf::Text::String::operator[] ( Size  n) const [inline]

Return character at given position.

String Saf::Text::String::Pad ( const Char ch,
Size  left,
Size  right 
) const

Pad the string with given character.

void Saf::Text::String::Resize ( Size  sz) [protected]

Resize string.

Returns a reversed string.

String Saf::Text::String::Right ( Size  sz) const [inline]

Get right part of the string.

Todo:
Kontrola na sz a Exception.
void Saf::Text::String::Swap ( String s) [inline]

Swap the content of two strings.

Properties:

  • Worst-case time complexity: $ \mathcal{O}(1) $.
String Saf::Text::String::Trim ( bool  left,
bool  right 
) const

Trim the string.

Get uppercase version of the string.


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