You.i Engine
CYIStringICU Class Reference

Detailed Description

A container class for functions that require the ICU library.

The functions in this class are string functions that require the ICU library to be present and linked into the final app. Unlike the functions in CYIString, these functions work on all Unicode characters.

See also
CYIString

#include <utility/YiStringICU.h>

Static Public Member Functions

static CYIString ToCYIString (const U_NAMESPACE_QUALIFIER UnicodeString &s, size_t sizeHintBytes=0)
 
static U_NAMESPACE_QUALIFIER UnicodeString ToUnicodeString (CYIStringView value)
 
static CYIString ToNormalizedText (CYIStringView text, bool *pError=nullptr)
 
static CYIString ToUpper (CYIStringView value)
 
static CYIString ToLower (CYIStringView value)
 
static bool ContainsCaseInsensitive (CYIStringView value, CYIStringView substring)
 
static bool StartsWithCaseInsensitive (CYIStringView value, CYIStringView prefix)
 
static bool EndsWithCaseInsensitive (CYIStringView value, CYIStringView suffix)
 
static int32_t CompareCaseInsensitive (CYIStringView first, CYIStringView second)
 
static bool EqualsCaseInsensitive (CYIStringView first, CYIStringView second)
 

Member Function Documentation

◆ CompareCaseInsensitive()

static int32_t CYIStringICU::CompareCaseInsensitive ( CYIStringView  first,
CYIStringView  second 
)
static

Compares first with second, ignoring case. Returns a negative value if first is less than second, zero if the two string viewss are equal and a positive value if first is greater than second.

◆ ContainsCaseInsensitive()

static bool CYIStringICU::ContainsCaseInsensitive ( CYIStringView  value,
CYIStringView  substring 
)
static

Returns true if value contains substring as a sub-string, ignoring case. An empty string will be contained in any other string.

◆ EndsWithCaseInsensitive()

static bool CYIStringICU::EndsWithCaseInsensitive ( CYIStringView  value,
CYIStringView  suffix 
)
static

Returns true if value ends with the sub-string suffix, ignoring case.

Note
Empty strings are 'found' at the end of every string.

◆ EqualsCaseInsensitive()

static bool CYIStringICU::EqualsCaseInsensitive ( CYIStringView  first,
CYIStringView  second 
)
static

Checks if first and second are equal, ignoring case. Returns true if both strings are equal, and false if the strings a different.

Note
Empty strings are considered equal.

◆ StartsWithCaseInsensitive()

static bool CYIStringICU::StartsWithCaseInsensitive ( CYIStringView  value,
CYIStringView  prefix 
)
static

Returns true if value starts with the sub-string prefix, ignoring case.

Note
Empty strings are 'found' at the beginning of every string.

◆ ToCYIString()

static CYIString CYIStringICU::ToCYIString ( const U_NAMESPACE_QUALIFIER UnicodeString &  s,
size_t  sizeHintBytes = 0 
)
static

Constructs a CYIString from an ICU UnicodeString.

The sizeHintBytes parameter can be used to provide a guess as to how big the resulting string will be, in bytes. This parameter is used to avoid multiple reallocations when creating a string from a long UnicodeString object.

◆ ToLower()

static CYIString CYIStringICU::ToLower ( CYIStringView  value)
static

Returns a lowercase version of a string view. Non-ASCII characters are converted appropriately.

Note
The length of the string may change as part of the conversion.

◆ ToNormalizedText()

static CYIString CYIStringICU::ToNormalizedText ( CYIStringView  text,
bool *  pError = nullptr 
)
static

Returns a normalized copy of a string view. A normalized string has had any combining characters composed into the equivalent unicode character(s).

Example: A CYIString containing "e´", ie. unicode {U+0065, U+0341} will result in "é" after normalization.

If any errors occurs, an unmodified copy of this string view is returned. A pointer to a boolean, pError, can optionally be provided – if a conversion error occurs, its pointed-to boolean will be set to true. If no conversion error occurs, the pointed-to boolean will be set to false.

◆ ToUnicodeString()

static U_NAMESPACE_QUALIFIER UnicodeString CYIStringICU::ToUnicodeString ( CYIStringView  value)
static

Returns the ICU UnicodeString representation of value.

◆ ToUpper()

static CYIString CYIStringICU::ToUpper ( CYIStringView  value)
static

Returns an uppercase version of a string view. Non-ASCII characters are converted appropriately.

Note
The length of the string may change as part of the conversion.

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