ZenLib::Ztring class Reference

Main Page Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members File Members

# ZenLib::Ztring Class Reference

String manipulation (based on std::(w)string). More...

`#include <Ztring.h>`

List of all members.

## Public Member Functions

| Ztring ()
| Ztring (const tstring &S, size_type Pos=0, size_type n=npos)
| Ztring (const tstring *S, size_type Pos=0, size_type n=npos)
| Ztring (const Char *S)
| Ztring (const Char *S, size_type n)
| Ztring (size_type n, const Char S)
Char & | operator() (size_type Pos)
| Same as [], but resize the string if Pos doesn't exist yet.
Ztring & | From_Unicode (const std::wstring &S)
| convert an Unicode encoded string into Ztring
Ztring & | From_Unicode (const wchar_t *S)
| convert an Unicode encoded string into Ztring
Ztring & | From_Unicode (const wchar_t *S, size_type Start, size_type Length)
| convert an Unicode encoded string into Ztring
Ztring & | From_Unicode (const wchar_t *S, size_type Length)
| convert an Unicode encoded string into Ztring
Ztring & | From_UTF8 (const std::string &S)
| convert an UTF-8 encoded string into Ztring
Ztring & | From_UTF8 (const char *S)
| convert an UTF-8 encoded string into Ztring
Ztring & | From_UTF8 (const char *S, size_type Start, size_type Length)
| convert an UTF-8 encoded string into Ztring
Ztring & | From_UTF8 (const char *S, size_type Length)
| convert an UTF-8 encoded string into Ztring
Ztring & | From_Local (const std::string &S)
| convert an Locael encoded string into Ztring
Ztring & | From_Local (const char *S)
| convert an Local encoded string into Ztring
Ztring & | From_Local (const char *S, size_type Start, size_type Length)
| convert an Local encoded string into Ztring
Ztring & | From_Local (const char *S, size_type Length)
| convert an Local encoded string into Ztring
Ztring & | From_Number (const int8s, intu Radix=10)
| convert number into Ztring
Ztring & | From_Number (const int8u, intu Radix=10)
| convert number into Ztring
Ztring & | From_Number (const int16s, intu Radix=10)
| convert number into Ztring
Ztring & | From_Number (const int16u, intu Radix=10)
| convert number into Ztring
Ztring & | From_Number (const int32s, intu Radix=10)
| convert number into Ztring
Ztring & | From_Number (const int32u, intu Radix=10)
| convert number into Ztring
Ztring & | From_Number (const float32, intu AfterComma=3, ztring_t Options=Ztring_Nothing)
| convert number into Ztring
Ztring & | From_Number (const float64, intu AfterComma=3, ztring_t Options=Ztring_Nothing)
| convert number into Ztring
Ztring & | From_Number (const float128, intu AfterComma=3, ztring_t Options=Ztring_Nothing)
| convert number into Ztring
Ztring & | Duration_From_Milliseconds (const int64u Milliseconds)
| convert count of milliseconds into a readable and sortable string
Ztring & | Date_From_Seconds (const int32u Seconds)
| convert count of seconds since 1970 into a readable and sortable string
Ztring & | Date_From_String (const char *Date, size_type Value_Size=Error)
| convert a free formated string into a readable and sortable string
std::wstring | To_Unicode ()
| Convert into Unicode chars.
std::string | To_UTF8 ()
| Convert into char* (UTF-8 encoded).
std::string | To_Local ()
| Convert into char* (Local encoded).
int32s | To_int32s (ztring_t Options=Ztring_Rounded) const
| Convert into Int (32 bits).
int32u | To_int32u (ztring_t Options=Ztring_Rounded) const
| Convert into unsigned Int (32 bits).
float32 | To_float32 (ztring_t Options=Ztring_Nothing) const
| Convert into float.
float64 | To_float64 (ztring_t Options=Ztring_Nothing) const
float128 | To_float128 (ztring_t Options=Ztring_Nothing) const
Ztring * | MakeLowerCase ()
| convert into lowercase
Ztring * | MakeUpperCase ()
| convert into uppercase
Ztring * | TrimLeft (Char ToTrim=_T(' '))
| Remove leading whitespaces from a string.
Ztring * | TrimRight (Char ToTrim=_T(' '))
| Remove trailing whitespaces from a string.
Ztring * | Trim (Char ToTrim=_T(' '))
| Remove leading and trailing whitespaces from a string.
Ztring * | Quote (Char ToTrim=_T('\"'))
| Quotes a string.
Ztring | SubString (const tstring &Begin, const tstring &End, size_type Pos=0, ztring_t Options=Ztring_Nothing) const

return a string between two strings

Parameters:

  Begin | First string
  End | Second string
  Pos | Position to begin to scan string
  Options | Options for searching Available : Ztring_CaseSensitive

Returns:
  The substring
  "" if not found

size_type | FindAndReplace (const tstring &ToFind, const tstring &ReplaceBy, size_type Pos=0, ztring_t Options=Ztring_Nothing)

replace a string by another one

Parameters:

  ToFind | string to find
  ToReplace | string wich replace the string found
  Pos | Position to begin to scan string
  Options | Options for searching Available : Ztring_CaseSensitive, Ztring_Recursive

Returns:
  The count of replacements

size_type | Count (const Ztring &ToCount, ztring_t Options=Ztring_Nothing) const

Count the number of occurencies of a string in the string

Parameters:

  ToCount | string to count
  Options | Options for count Available : Ztring_CaseSensitive

Returns:
  the count.

bool | Compare (const Ztring &ToCompare, const Ztring &Comparator=_T("=="), ztring_t Options=Ztring_Nothing) const

compare with another string

Parameters:

  ToCompare | string to compare with
  Options | Options for comaparing Available : Ztring_CaseSensitive

Returns:
  The result of comparasion

## Static Public Member Functions

Ztring | ToZtring (const int8s I, intu Radix=10)
Ztring | ToZtring (const int8u I, intu Radix=10)
Ztring | ToZtring (const int16s I, intu Radix=10)
Ztring | ToZtring (const int16u I, intu Radix=10)
Ztring | ToZtring (const int32s I, intu Radix=10)
Ztring | ToZtring (const int32u I, intu Radix=10)
Ztring | ToZtring (const float32 F, intu AfterComma=3)
Ztring | ToZtring (const float64 F, intu AfterComma=3)
Ztring | ToZtring (const float128 F, intu AfterComma=3)

## Detailed Description

String manipulation (based on std::(w)string).

## Constructor & Destructor Documentation

ZenLib::Ztring::Ztring | ( |  | ) | `[inline]`

ZenLib::Ztring::Ztring | ( | const tstring & | S,
|  | size_type | Pos = 0,
|  | size_type | n = npos
| ) | `[inline]`

ZenLib::Ztring::Ztring | ( | const tstring * | S,
|  | size_type | Pos = 0,
|  | size_type | n = npos
| ) | `[inline]`

ZenLib::Ztring::Ztring | ( | const Char * | S | ) | `[inline]`

ZenLib::Ztring::Ztring | ( | const Char * | S,
|  | size_type | n
| ) | `[inline]`

ZenLib::Ztring::Ztring | ( | size_type | n,
|  | const Char | S
| ) | `[inline]`

## Member Function Documentation

bool ZenLib::Ztring::Compare | ( | const Ztring & | ToCompare,
|  | const Ztring & | Comparator = _T("=="),
|  | ztring_t | Options = Ztring_Nothing
| ) | const

compare with another string

Parameters:

  ToCompare | string to compare with
  Options | Options for comaparing Available : Ztring_CaseSensitive

Returns:
  The result of comparasion

size_type ZenLib::Ztring::Count | ( | const Ztring & | ToCount,
|  | ztring_t | Options = Ztring_Nothing
| ) | const

Count the number of occurencies of a string in the string

Parameters:

  ToCount | string to count
  Options | Options for count Available : Ztring_CaseSensitive

Returns:
  the count.

Ztring& ZenLib::Ztring::Date_From_Seconds | ( | const int32u | Seconds | ) |

| convert count of seconds since 1970 into a readable and sortable string

Ztring& ZenLib::Ztring::Date_From_String | ( | const char * | Date,
|  | size_type | Value_Size = Error
| ) |

| convert a free formated string into a readable and sortable string

Ztring& ZenLib::Ztring::Duration_From_Milliseconds | ( | const int64u | Milliseconds | ) |

| convert count of milliseconds into a readable and sortable string

size_type ZenLib::Ztring::FindAndReplace | ( | const tstring & | ToFind,
|  | const tstring & | ReplaceBy,
|  | size_type | Pos = 0,
|  | ztring_t | Options = Ztring_Nothing
| ) |

replace a string by another one

Parameters:

  ToFind | string to find
  ToReplace | string wich replace the string found
  Pos | Position to begin to scan string
  Options | Options for searching Available : Ztring_CaseSensitive, Ztring_Recursive

Returns:
  The count of replacements

Ztring& ZenLib::Ztring::From_Local | ( | const char * | S,
|  | size_type | Length
| ) | `[inline]`

| convert an Local encoded string into Ztring

Ztring& ZenLib::Ztring::From_Local | ( | const char * | S,
|  | size_type | Start,
|  | size_type | Length
| ) |

| convert an Local encoded string into Ztring

Ztring& ZenLib::Ztring::From_Local | ( | const char * | S | ) |

| convert an Local encoded string into Ztring

Ztring& ZenLib::Ztring::From_Local | ( | const std::string & | S | ) | `[inline]`

| convert an Locael encoded string into Ztring

Ztring& ZenLib::Ztring::From_Number | ( | const | float128,
|  | intu | AfterComma = 3,
|  | ztring_t | Options = Ztring_Nothing
| ) |

| convert number into Ztring

Ztring& ZenLib::Ztring::From_Number | ( | const | float64,
|  | intu | AfterComma = 3,
|  | ztring_t | Options = Ztring_Nothing
| ) |

| convert number into Ztring

Ztring& ZenLib::Ztring::From_Number | ( | const | float32,
|  | intu | AfterComma = 3,
|  | ztring_t | Options = Ztring_Nothing
| ) |

| convert number into Ztring

Ztring& ZenLib::Ztring::From_Number | ( | const | int32u,
|  | intu | Radix = 10
| ) |

| convert number into Ztring

Ztring& ZenLib::Ztring::From_Number | ( | const | int32s,
|  | intu | Radix = 10
| ) |

| convert number into Ztring

Ztring& ZenLib::Ztring::From_Number | ( | const | int16u,
|  | intu | Radix = 10
| ) |

| convert number into Ztring

Ztring& ZenLib::Ztring::From_Number | ( | const | int16s,
|  | intu | Radix = 10
| ) |

| convert number into Ztring

Ztring& ZenLib::Ztring::From_Number | ( | const | int8u,
|  | intu | Radix = 10
| ) |

| convert number into Ztring

Ztring& ZenLib::Ztring::From_Number | ( | const | int8s,
|  | intu | Radix = 10
| ) |

| convert number into Ztring

Ztring& ZenLib::Ztring::From_Unicode | ( | const wchar_t * | S,
|  | size_type | Length
| ) | `[inline]`

| convert an Unicode encoded string into Ztring

Ztring& ZenLib::Ztring::From_Unicode | ( | const wchar_t * | S,
|  | size_type | Start,
|  | size_type | Length
| ) |

| convert an Unicode encoded string into Ztring

Ztring& ZenLib::Ztring::From_Unicode | ( | const wchar_t * | S | ) |

| convert an Unicode encoded string into Ztring

Ztring& ZenLib::Ztring::From_Unicode | ( | const std::wstring & | S | ) | `[inline]`

| convert an Unicode encoded string into Ztring

Ztring& ZenLib::Ztring::From_UTF8 | ( | const char * | S,
|  | size_type | Length
| ) | `[inline]`

| convert an UTF-8 encoded string into Ztring

Ztring& ZenLib::Ztring::From_UTF8 | ( | const char * | S,
|  | size_type | Start,
|  | size_type | Length
| ) |

| convert an UTF-8 encoded string into Ztring

Ztring& ZenLib::Ztring::From_UTF8 | ( | const char * | S | ) |

| convert an UTF-8 encoded string into Ztring

Ztring& ZenLib::Ztring::From_UTF8 | ( | const std::string & | S | ) | `[inline]`

| convert an UTF-8 encoded string into Ztring

Ztring* ZenLib::Ztring::MakeLowerCase | ( |  | ) |

| convert into lowercase

Ztring* ZenLib::Ztring::MakeUpperCase | ( |  | ) |

| convert into uppercase

Char& ZenLib::Ztring::operator() | ( | size_type | Pos | ) |

| Same as [], but resize the string if Pos doesn't exist yet.

Ztring* ZenLib::Ztring::Quote | ( | Char | ToTrim = _T('\"') | ) |

| Quotes a string.

Ztring ZenLib::Ztring::SubString | ( | const tstring & | Begin,
|  | const tstring & | End,
|  | size_type | Pos = 0,
|  | ztring_t | Options = Ztring_Nothing
| ) | const

return a string between two strings

Parameters:

  Begin | First string
  End | Second string
  Pos | Position to begin to scan string
  Options | Options for searching Available : Ztring_CaseSensitive

Returns:
  The substring
  "" if not found

float128 ZenLib::Ztring::To_float128 | ( | ztring_t | Options = Ztring_Nothing | ) | const

float32 ZenLib::Ztring::To_float32 | ( | ztring_t | Options = Ztring_Nothing | ) | const

Convert into float.

Returns:
  the value corresponding
  0 if there is a problem

float64 ZenLib::Ztring::To_float64 | ( | ztring_t | Options = Ztring_Nothing | ) | const

int32s ZenLib::Ztring::To_int32s | ( | ztring_t | Options = Ztring_Rounded | ) | const

Convert into Int (32 bits).

Returns:
  the value corresponding
  0 if there is a problem

int32u ZenLib::Ztring::To_int32u | ( | ztring_t | Options = Ztring_Rounded | ) | const

Convert into unsigned Int (32 bits).

Returns:
  the value corresponding 0 if there is a problem

std::string ZenLib::Ztring::To_Local | ( |  | ) |

Convert into char* (Local encoded).

Returns:
  the string corresponding

std::wstring ZenLib::Ztring::To_Unicode | ( |  | ) |

Convert into Unicode chars.

Returns:
  the string corresponding

std::string ZenLib::Ztring::To_UTF8 | ( |  | ) |

Convert into char* (UTF-8 encoded).

Returns:
  the string corresponding

Ztring ZenLib::Ztring::ToZtring | ( | const float128 | F,
|  | intu | AfterComma = 3
| ) | `[inline, static]`

Ztring ZenLib::Ztring::ToZtring | ( | const float64 | F,
|  | intu | AfterComma = 3
| ) | `[inline, static]`

Ztring ZenLib::Ztring::ToZtring | ( | const float32 | F,
|  | intu | AfterComma = 3
| ) | `[inline, static]`

Ztring ZenLib::Ztring::ToZtring | ( | const int32u | I,
|  | intu | Radix = 10
| ) | `[inline, static]`

Ztring ZenLib::Ztring::ToZtring | ( | const int32s | I,
|  | intu | Radix = 10
| ) | `[inline, static]`

Ztring ZenLib::Ztring::ToZtring | ( | const int16u | I,
|  | intu | Radix = 10
| ) | `[inline, static]`

Ztring ZenLib::Ztring::ToZtring | ( | const int16s | I,
|  | intu | Radix = 10
| ) | `[inline, static]`

Ztring ZenLib::Ztring::ToZtring | ( | const int8u | I,
|  | intu | Radix = 10
| ) | `[inline, static]`

Ztring ZenLib::Ztring::ToZtring | ( | const int8s | I,
|  | intu | Radix = 10
| ) | `[inline, static]`

Ztring* ZenLib::Ztring::Trim | ( | Char | ToTrim = _T(' ') | ) |

| Remove leading and trailing whitespaces from a string.

Ztring* ZenLib::Ztring::TrimLeft | ( | Char | ToTrim = _T(' ') | ) |

| Remove leading whitespaces from a string.

Ztring* ZenLib::Ztring::TrimRight | ( | Char | ToTrim = _T(' ') | ) |

| Remove trailing whitespaces from a string.

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

- Ztring.h