CL_StringHelp Class Reference
[clanCore Text]

String helper functions. More...

#include <string_help.h>

List of all members.

Operations



enum  BOMType {
  bom_none, bom_utf32_be, bom_utf32_le, bom_utf16_be,
  bom_utf16_le, bom_utf8
}
static std::vector< CL_Stringsplit_text (const CL_StringRef &text, const CL_StringRef &split_string, bool skip_empty=true)
static CL_String8 wchar_to_utf8 (wchar_t value)
 Wide char to utf-8.
static CL_String8 unicode_to_utf8 (unsigned int value)
 unicode char to utf-8
static CL_String trim (const CL_StringRef &text)
 Trim.
static int compare (const CL_StringRef8 &a, const CL_StringRef8 &b, bool case_insensitive=false)
 Compare.
static int compare (const CL_StringRef16 &a, const CL_StringRef16 &b, bool case_insensitive=false)
 Compare.
static CL_String text_to_upper (const CL_StringRef &s)
 Text to upper.
static CL_String8 local8_to_upper (const CL_StringRef8 &s)
 Local8 to upper.
static CL_String16 ucs2_to_upper (const CL_StringRef16 &s)
 Ucs2 to upper.
static CL_String text_to_lower (const CL_StringRef &s)
 Text to lower.
static CL_String8 local8_to_lower (const CL_StringRef8 &s)
 Local8 to lower.
static CL_String16 ucs2_to_lower (const CL_StringRef16 &s)
 Ucs2 to lower.
static CL_String float_to_text (float value, int num_decimal_places=6)
 Float to text.
static CL_String8 float_to_local8 (float value, int num_decimal_places=6)
 Float to local8.
static CL_String16 float_to_ucs2 (float value, int num_decimal_places=6)
 Float to ucs2.
static float text_to_float (const CL_StringRef &value)
 Text to float.
static float local8_to_float (const CL_StringRef8 &value)
 Local8 to float.
static float ucs2_to_float (const CL_StringRef16 &value)
 Ucs2 to float.
static CL_String double_to_text (double value, int num_decimal_places=6)
 Double to text.
static CL_String8 double_to_local8 (double value, int num_decimal_places=6)
 Double to local8.
static CL_String16 double_to_ucs2 (double value, int num_decimal_places=6)
 Double to ucs2.
static double text_to_double (const CL_StringRef &value)
 Text to double.
static double local8_to_double (const CL_StringRef8 &value)
 Local8 to double.
static double ucs2_to_double (const CL_StringRef16 &value)
 Ucs2 to double.
static CL_String int_to_text (int value)
 Int to text.
static CL_String8 int_to_local8 (int value)
 Int to local8.
static CL_String16 int_to_ucs2 (int value)
 Int to ucs2.
static int text_to_int (const CL_StringRef &value, int base=10)
 Text to int.
static int local8_to_int (const CL_StringRef8 &value, int base=10)
 Local8 to int.
static int ucs2_to_int (const CL_StringRef16 &value, int base=10)
 Ucs2 to int.
static CL_String uint_to_text (unsigned int value)
 Uint to text.
static CL_String8 uint_to_local8 (unsigned int value)
 Uint to local8.
static CL_String16 uint_to_ucs2 (unsigned int value)
 Uint to ucs2.
static unsigned int text_to_uint (const CL_StringRef &value, int base=10)
static unsigned int local8_to_uint (const CL_StringRef8 &value, int base=10)
static unsigned int ucs2_to_uint (const CL_StringRef16 &value, int base=10)
static CL_String ll_to_text (long long value)
 Long long to text.
static CL_String8 ll_to_local8 (long long value)
 Long long to local8.
static CL_String16 ll_to_ucs2 (long long value)
 Long long to ucs2.
static long long text_to_ll (const CL_StringRef &value, int base=10)
 Text to long long.
static long long local8_to_ll (const CL_StringRef8 &value, int base=10)
 Local8 to long long.
static long long ucs2_to_ll (const CL_StringRef16 &value, int base=10)
 Ucs2 to long long.
static CL_String ull_to_text (unsigned long long value)
 Unsigned long long to text.
static CL_String8 ull_to_local8 (unsigned long long value)
 Unsigned long long to local8.
static CL_String16 ull_to_ucs2 (unsigned long long value)
 Unsigned long long to ucs2.
static unsigned long long text_to_ull (const CL_StringRef &value, int base=10)
 Text to unsigned long long.
static unsigned long long local8_to_ull (const CL_StringRef8 &value, int base=10)
 Local8 to unsigned long long.
static unsigned long long ucs2_to_ull (const CL_StringRef16 &value, int base=10)
 Ucs2 to unsigned long long.
static CL_String bool_to_text (bool value)
 Bool to text.
static CL_String8 bool_to_local8 (bool value)
 Bool to local8.
static CL_String16 bool_to_ucs2 (bool value)
 Bool to ucs2.
static bool text_to_bool (const CL_StringRef &value)
 Text to bool.
static bool local8_to_bool (const CL_StringRef8 &value)
 Local8 to bool.
static bool ucs2_to_bool (const CL_StringRef16 &value)
 Ucs2 to bool.
static CL_String8 text_to_cp437 (const CL_StringRef &text)
 Text to cp437.
static CL_String8 ucs2_to_cp437 (const CL_StringRef16 &text)
 Ucs2 to cp437.
static CL_String cp437_to_text (const CL_StringRef8 &cp437)
 Cp437 to text.
static CL_String16 cp437_to_ucs2 (const CL_StringRef8 &cp437)
 Cp437 to ucs2.
static CL_String8 text_to_local8 (const CL_StringRef &text)
 Text to local8.
static CL_String8 text_to_utf8 (const CL_StringRef &text)
 Text to utf8.
static CL_String8 ucs2_to_latin1 (const CL_StringRef16 &ucs2)
 Ucs2 to latin1.
static CL_String8 ucs2_to_latin9 (const CL_StringRef16 &ucs2)
 Ucs2 to latin9.
static CL_String8 ucs2_to_local8 (const CL_StringRef16 &ucs2)
 Ucs2 to local8.
static CL_String8 ucs2_to_utf8 (const CL_StringRef16 &ucs2)
 Ucs2 to utf8.
static CL_String local8_to_text (const CL_StringRef8 &local8)
 Local8 to text.
static CL_String ucs2_to_text (const CL_StringRef16 &ucs2)
 Ucs2 to text.
static CL_String16 latin1_to_ucs2 (const CL_StringRef8 &latin1)
 Latin1 to ucs2.
static CL_String16 latin9_to_ucs2 (const CL_StringRef8 &latin9)
 Latin9 to ucs2.
static CL_String16 local8_to_ucs2 (const CL_StringRef8 &local8)
 Local8 to ucs2.
static CL_String16 utf8_to_ucs2 (const CL_StringRef8 &utf8)
 Utf8 to ucs2.
static CL_String utf8_to_text (const CL_StringRef8 &utf8)
 Utf8 to text.
static BOMType detect_bom (const void *data, CL_String::size_type length)
 Detect bom.

Detailed Description

String helper functions.


Member Enumeration Documentation

Enumerator:
bom_none 
bom_utf32_be 
bom_utf32_le 
bom_utf16_be 
bom_utf16_le 
bom_utf8 

Member Function Documentation

static CL_String8 CL_StringHelp::bool_to_local8 ( bool  value  )  [static]

Bool to local8.

Parameters:
value = bool
Returns:
Temp String8
static CL_String CL_StringHelp::bool_to_text ( bool  value  )  [static]

Bool to text.

Parameters:
value = bool
Returns:
Temp String
static CL_String16 CL_StringHelp::bool_to_ucs2 ( bool  value  )  [static]

Bool to ucs2.

Parameters:
value = bool
Returns:
Temp String16
static int CL_StringHelp::compare ( const CL_StringRef8 a,
const CL_StringRef8 b,
bool  case_insensitive = false 
) [static]

Compare.

Parameters:
a = String Ref8
b = String Ref8
case_insensitive = bool
Returns:
int
static int CL_StringHelp::compare ( const CL_StringRef16 a,
const CL_StringRef16 b,
bool  case_insensitive = false 
) [static]

Compare.

Parameters:
a = String Ref16
b = String Ref16
case_insensitive = bool
Returns:
int
static CL_String CL_StringHelp::cp437_to_text ( const CL_StringRef8 cp437  )  [static]

Cp437 to text.

Parameters:
cp437 = String Ref8
Returns:
Temp String
static CL_String16 CL_StringHelp::cp437_to_ucs2 ( const CL_StringRef8 cp437  )  [static]

Cp437 to ucs2.

Parameters:
cp437 = String Ref8
Returns:
Temp String16
static BOMType CL_StringHelp::detect_bom ( const void *  data,
CL_String::size_type  length 
) [static]

Detect bom.

Parameters:
data = void
size_type = String
Returns:
BOMType
static CL_String8 CL_StringHelp::double_to_local8 ( double  value,
int  num_decimal_places = 6 
) [static]

Double to local8.

Parameters:
value = value
num_decimal_places = value
Returns:
Temp String8
static CL_String CL_StringHelp::double_to_text ( double  value,
int  num_decimal_places = 6 
) [static]

Double to text.

Parameters:
value = value
num_decimal_places = value
Returns:
Temp String
static CL_String16 CL_StringHelp::double_to_ucs2 ( double  value,
int  num_decimal_places = 6 
) [static]

Double to ucs2.

Parameters:
value = value
num_decimal_places = value
Returns:
Temp String16
static CL_String8 CL_StringHelp::float_to_local8 ( float  value,
int  num_decimal_places = 6 
) [static]

Float to local8.

Parameters:
value = value
num_decimal_places = value
Returns:
Temp String8
static CL_String CL_StringHelp::float_to_text ( float  value,
int  num_decimal_places = 6 
) [static]

Float to text.

Parameters:
value = value
num_decimal_places = value
Returns:
Temp String

Referenced by CL_CSSBoxLength::to_string().

static CL_String16 CL_StringHelp::float_to_ucs2 ( float  value,
int  num_decimal_places = 6 
) [static]

Float to ucs2.

Parameters:
value = value
num_decimal_places = value
Returns:
Temp String16
static CL_String8 CL_StringHelp::int_to_local8 ( int  value  )  [static]

Int to local8.

Parameters:
value = value
Returns:
Temp String8
static CL_String CL_StringHelp::int_to_text ( int  value  )  [static]

Int to text.

Parameters:
value = value
Returns:
Temp String
static CL_String16 CL_StringHelp::int_to_ucs2 ( int  value  )  [static]

Int to ucs2.

Parameters:
value = value
Returns:
Temp String16
static CL_String16 CL_StringHelp::latin1_to_ucs2 ( const CL_StringRef8 latin1  )  [static]

Latin1 to ucs2.

Parameters:
latin1 = String Ref8
Returns:
Temp String16
static CL_String16 CL_StringHelp::latin9_to_ucs2 ( const CL_StringRef8 latin9  )  [static]

Latin9 to ucs2.

Parameters:
latin9 = String Ref8
Returns:
Temp String16
static CL_String8 CL_StringHelp::ll_to_local8 ( long long  value  )  [static]

Long long to local8.

Parameters:
value = value
Returns:
Temp String8
static CL_String CL_StringHelp::ll_to_text ( long long  value  )  [static]

Long long to text.

Parameters:
value = value
Returns:
Temp String
static CL_String16 CL_StringHelp::ll_to_ucs2 ( long long  value  )  [static]

Long long to ucs2.

Parameters:
value = value
Returns:
Temp String16
static bool CL_StringHelp::local8_to_bool ( const CL_StringRef8 value  )  [static]

Local8 to bool.

Parameters:
value = String Ref8
Returns:
bool
static double CL_StringHelp::local8_to_double ( const CL_StringRef8 value  )  [static]

Local8 to double.

Parameters:
value = String Ref8
Returns:
double
static float CL_StringHelp::local8_to_float ( const CL_StringRef8 value  )  [static]

Local8 to float.

Parameters:
value = String Ref8
Returns:
float
static int CL_StringHelp::local8_to_int ( const CL_StringRef8 value,
int  base = 10 
) [static]

Local8 to int.

Parameters:
value = String Ref8
base = value
Returns:
int
static long long CL_StringHelp::local8_to_ll ( const CL_StringRef8 value,
int  base = 10 
) [static]

Local8 to long long.

Parameters:
value = String Ref8
base = value
Returns:
long long
static CL_String8 CL_StringHelp::local8_to_lower ( const CL_StringRef8 s  )  [static]

Local8 to lower.

Parameters:
s = String Ref8
Returns:
Temp String8
static CL_String CL_StringHelp::local8_to_text ( const CL_StringRef8 local8  )  [static]

Local8 to text.

Parameters:
local8 = String Ref8
Returns:
Temp String
static CL_String16 CL_StringHelp::local8_to_ucs2 ( const CL_StringRef8 local8  )  [static]

Local8 to ucs2.

Parameters:
local8 = String Ref8
Returns:
Temp String16
static unsigned int CL_StringHelp::local8_to_uint ( const CL_StringRef8 value,
int  base = 10 
) [static]
static unsigned long long CL_StringHelp::local8_to_ull ( const CL_StringRef8 value,
int  base = 10 
) [static]

Local8 to unsigned long long.

Parameters:
value = String Ref8
base = value
Returns:
unsigned long long
static CL_String8 CL_StringHelp::local8_to_upper ( const CL_StringRef8 s  )  [static]

Local8 to upper.

Parameters:
s = String Ref8
Returns:
Temp String8
static std::vector<CL_String> CL_StringHelp::split_text ( const CL_StringRef text,
const CL_StringRef split_string,
bool  skip_empty = true 
) [static]
static bool CL_StringHelp::text_to_bool ( const CL_StringRef value  )  [static]

Text to bool.

Parameters:
value = String Ref
Returns:
bool
static CL_String8 CL_StringHelp::text_to_cp437 ( const CL_StringRef text  )  [static]

Text to cp437.

Parameters:
text = String Ref
Returns:
Temp String8
static double CL_StringHelp::text_to_double ( const CL_StringRef value  )  [static]

Text to double.

Parameters:
value = String Ref
Returns:
double
static float CL_StringHelp::text_to_float ( const CL_StringRef value  )  [static]

Text to float.

Parameters:
value = String Ref
Returns:
float
static int CL_StringHelp::text_to_int ( const CL_StringRef value,
int  base = 10 
) [static]

Text to int.

Parameters:
value = String Ref
base = value
Returns:
int
static long long CL_StringHelp::text_to_ll ( const CL_StringRef value,
int  base = 10 
) [static]

Text to long long.

Parameters:
value = String Ref
base = value
Returns:
long long
static CL_String8 CL_StringHelp::text_to_local8 ( const CL_StringRef text  )  [static]

Text to local8.

Parameters:
text = String Ref
Returns:
Temp String8
static CL_String CL_StringHelp::text_to_lower ( const CL_StringRef s  )  [static]

Text to lower.

Parameters:
s = String Ref
Returns:
Temp String
static unsigned int CL_StringHelp::text_to_uint ( const CL_StringRef value,
int  base = 10 
) [static]
static unsigned long long CL_StringHelp::text_to_ull ( const CL_StringRef value,
int  base = 10 
) [static]

Text to unsigned long long.

Parameters:
value = String Ref
base = value
Returns:
unsigned long long
static CL_String CL_StringHelp::text_to_upper ( const CL_StringRef s  )  [static]

Text to upper.

Parameters:
s = String Ref
Returns:
Temp String
static CL_String8 CL_StringHelp::text_to_utf8 ( const CL_StringRef text  )  [static]

Text to utf8.

Parameters:
text = String Ref
Returns:
Temp String8
static CL_String CL_StringHelp::trim ( const CL_StringRef text  )  [static]

Trim.

Parameters:
text = String Ref
Returns:
Temp String
static bool CL_StringHelp::ucs2_to_bool ( const CL_StringRef16 value  )  [static]

Ucs2 to bool.

Parameters:
value = String Ref16
Returns:
bool
static CL_String8 CL_StringHelp::ucs2_to_cp437 ( const CL_StringRef16 text  )  [static]

Ucs2 to cp437.

Parameters:
text = String Ref16
Returns:
Temp String8
static double CL_StringHelp::ucs2_to_double ( const CL_StringRef16 value  )  [static]

Ucs2 to double.

Parameters:
value = String Ref16
Returns:
double
static float CL_StringHelp::ucs2_to_float ( const CL_StringRef16 value  )  [static]

Ucs2 to float.

Parameters:
value = String Ref16
Returns:
float
static int CL_StringHelp::ucs2_to_int ( const CL_StringRef16 value,
int  base = 10 
) [static]

Ucs2 to int.

Parameters:
value = String Ref16
base = value
Returns:
int
static CL_String8 CL_StringHelp::ucs2_to_latin1 ( const CL_StringRef16 ucs2  )  [static]

Ucs2 to latin1.

Parameters:
ucs2 = String Ref16
Returns:
Temp String8
static CL_String8 CL_StringHelp::ucs2_to_latin9 ( const CL_StringRef16 ucs2  )  [static]

Ucs2 to latin9.

Parameters:
ucs2 = String Ref16
Returns:
Temp String8
static long long CL_StringHelp::ucs2_to_ll ( const CL_StringRef16 value,
int  base = 10 
) [static]

Ucs2 to long long.

Parameters:
value = String Ref16
base = value
Returns:
long long
static CL_String8 CL_StringHelp::ucs2_to_local8 ( const CL_StringRef16 ucs2  )  [static]

Ucs2 to local8.

Parameters:
ucs2 = String Ref16
Returns:
Temp String8
static CL_String16 CL_StringHelp::ucs2_to_lower ( const CL_StringRef16 s  )  [static]

Ucs2 to lower.

Parameters:
s = String Ref16
Returns:
Temp String16
static CL_String CL_StringHelp::ucs2_to_text ( const CL_StringRef16 ucs2  )  [static]

Ucs2 to text.

Parameters:
ucs2 = String Ref16
Returns:
Temp String
static unsigned int CL_StringHelp::ucs2_to_uint ( const CL_StringRef16 value,
int  base = 10 
) [static]
static unsigned long long CL_StringHelp::ucs2_to_ull ( const CL_StringRef16 value,
int  base = 10 
) [static]

Ucs2 to unsigned long long.

Parameters:
value = String Ref16
base = value
Returns:
unsigned long long
static CL_String16 CL_StringHelp::ucs2_to_upper ( const CL_StringRef16 s  )  [static]

Ucs2 to upper.

Parameters:
s = String Ref16
Returns:
Temp String16
static CL_String8 CL_StringHelp::ucs2_to_utf8 ( const CL_StringRef16 ucs2  )  [static]

Ucs2 to utf8.

Parameters:
ucs2 = String Ref16
Returns:
Temp String8
static CL_String8 CL_StringHelp::uint_to_local8 ( unsigned int  value  )  [static]

Uint to local8.

Parameters:
value = value
Returns:
Temp String8
static CL_String CL_StringHelp::uint_to_text ( unsigned int  value  )  [static]

Uint to text.

Parameters:
value = value
Returns:
Temp String
static CL_String16 CL_StringHelp::uint_to_ucs2 ( unsigned int  value  )  [static]

Uint to ucs2.

Parameters:
value = value
Returns:
Temp String16
static CL_String8 CL_StringHelp::ull_to_local8 ( unsigned long long  value  )  [static]

Unsigned long long to local8.

Parameters:
value = value
Returns:
Temp String8
static CL_String CL_StringHelp::ull_to_text ( unsigned long long  value  )  [static]

Unsigned long long to text.

Parameters:
value = value
Returns:
Temp String
static CL_String16 CL_StringHelp::ull_to_ucs2 ( unsigned long long  value  )  [static]

Unsigned long long to ucs2.

Parameters:
value = value
Returns:
Temp String16
static CL_String8 CL_StringHelp::unicode_to_utf8 ( unsigned int  value  )  [static]

unicode char to utf-8

Parameters:
value = unicode char value
Returns:
The UTF-8 String
static CL_String CL_StringHelp::utf8_to_text ( const CL_StringRef8 utf8  )  [static]

Utf8 to text.

Parameters:
utf8 = String Ref8
Returns:
Temp String
static CL_String16 CL_StringHelp::utf8_to_ucs2 ( const CL_StringRef8 utf8  )  [static]

Utf8 to ucs2.

Parameters:
utf8 = String Ref8
Returns:
Temp String16
static CL_String8 CL_StringHelp::wchar_to_utf8 ( wchar_t  value  )  [static]

Wide char to utf-8.

Parameters:
value = Wide char value
Returns:
The UTF-8 String

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