Rudiments
Static Public Member Functions | List of all members
ucs2charstring Class Reference

Static Public Member Functions

static size_t getLength (const ucs2_t *string)
 
static size_t getSize (const ucs2_t *string)
 
static bool isNullOrEmpty (const ucs2_t *string)
 
static bool isYes (const ucs2_t *string)
 
static bool isNo (const ucs2_t *string)
 
static void zero (ucs2_t *str, size_t len)
 
static ucs2_t * append (ucs2_t *dest, const ucs2_t *source)
 
static ucs2_t * append (ucs2_t *dest, const ucs2_t *source, size_t len)
 
static ucs2_t * append (ucs2_t *dest, int64_t number)
 
static ucs2_t * append (ucs2_t *dest, uint64_t number)
 
static ucs2_t * append (ucs2_t *dest, double number)
 
static ucs2_t * append (ucs2_t *dest, double number, uint16_t scale)
 
static ucs2_t * append (ucs2_t *dest, double number, uint16_t precision, uint16_t scale)
 
static ucs2_t * copy (ucs2_t *dest, const ucs2_t *source)
 
static ucs2_t * copy (ucs2_t *dest, const ucs2_t *source, size_t len)
 
static ucs2_t * copy (ucs2_t *dest, size_t location, const ucs2_t *source)
 
static ucs2_t * copy (ucs2_t *dest, size_t location, const ucs2_t *source, size_t len)
 
static ucs2_t * safeCopy (ucs2_t *dest, size_t destlen, const ucs2_t *source)
 
static ucs2_t * safeCopy (ucs2_t *dest, size_t destlen, const ucs2_t *source, size_t sourcelen)
 
static int32_t compare (const ucs2_t *str1, const ucs2_t *str2)
 
static int32_t compare (const ucs2_t *str1, const ucs2_t *str2, size_t length)
 
static int32_t compareIgnoringCase (const ucs2_t *str1, const ucs2_t *str2)
 
static int32_t compareIgnoringCase (const ucs2_t *str1, const ucs2_t *str2, size_t len)
 
static int32_t compareNatural (const ucs2_t *str1, const ucs2_t *str2)
 
static int32_t compareNatural (const ucs2_t *str1, const ucs2_t *str2, const ucs2_t *delimiters)
 
static int32_t compareVersions (const ucs2_t *str1, const ucs2_t *str2)
 
static int32_t compareVersions (const ucs2_t *str1, const ucs2_t *str2, const ucs2_t *delimiters)
 
static bool compareWithWildcards (const ucs2_t *string, size_t stringlength, const ucs2_t *pattern, size_t patternlength, ucs2_t singlewildcard, ucs2_t multiwildcard)
 
static bool compareWithWildcards (const ucs2_t *string, const ucs2_t *pattern, size_t patternlength, ucs2_t singlewildcard, ucs2_t multiwildcard)
 
static bool compareWithWildcards (const ucs2_t *string, size_t stringlength, const ucs2_t *pattern, ucs2_t singlewildcard, ucs2_t multiwildcard)
 
static bool compareWithWildcards (const ucs2_t *string, const ucs2_t *pattern, ucs2_t singlewildcard, ucs2_t multiwildcard)
 
static bool isInSet (const ucs2_t *str, const ucs2_t *const *set)
 
static bool isInSetIgnoringCase (const ucs2_t *str, const ucs2_t *const *set)
 
static bool contains (const ucs2_t *haystack, const ucs2_t *needle)
 
static bool containsIgnoringCase (const ucs2_t *haystack, const ucs2_t *needle)
 
static bool contains (const ucs2_t *haystack, ucs2_t needle)
 
static bool containsIgnoringCase (const ucs2_t *haystack, ucs2_t needle)
 
static bool startsWith (const ucs2_t *haystack, const ucs2_t *needle)
 
static bool endsWith (const ucs2_t *haystack, const ucs2_t *needle)
 
static const ucs2_t * findFirst (const ucs2_t *haystack, const ucs2_t *needle)
 
static const ucs2_t * findFirstIgnoringCase (const ucs2_t *haystack, const ucs2_t *needle)
 
static const ucs2_t * findFirst (const ucs2_t *haystack, ucs2_t needle)
 
static const ucs2_t * findFirstIgnoringCase (const ucs2_t *haystack, ucs2_t needle)
 
static const ucs2_t * findFirstOrEnd (const ucs2_t *haystack, const ucs2_t *needle)
 
static const ucs2_t * findFirstOrEndIgnoringCase (const ucs2_t *haystack, const ucs2_t *needle)
 
static const ucs2_t * findFirstOrEnd (const ucs2_t *haystack, ucs2_t needle)
 
static const ucs2_t * findFirstOrEndIgnoringCase (const ucs2_t *haystack, ucs2_t needle)
 
static const ucs2_t * findLast (const ucs2_t *haystack, const ucs2_t *needle)
 
static const ucs2_t * findLastIgnoringCase (const ucs2_t *haystack, const ucs2_t *needle)
 
static const ucs2_t * findLast (const ucs2_t *haystack, ucs2_t needle)
 
static const ucs2_t * findLastIgnoringCase (const ucs2_t *haystack, ucs2_t needle)
 
static ucs2_t * findFirst (ucs2_t *haystack, const ucs2_t *needle)
 
static ucs2_t * findFirstIgnoringCase (ucs2_t *haystack, const ucs2_t *needle)
 
static ucs2_t * findFirst (ucs2_t *haystack, ucs2_t needle)
 
static ucs2_t * findFirstIgnoringCase (ucs2_t *haystack, ucs2_t needle)
 
static ucs2_t * findFirstOrEnd (ucs2_t *haystack, const ucs2_t *needle)
 
static ucs2_t * findFirstOrEndIgnoringCase (ucs2_t *haystack, const ucs2_t *needle)
 
static ucs2_t * findLast (ucs2_t *haystack, const ucs2_t *needle)
 
static ucs2_t * findLastIgnoringCase (ucs2_t *haystack, const ucs2_t *needle)
 
static ucs2_t * findLast (ucs2_t *haystack, ucs2_t needle)
 
static ucs2_t * findLastIgnoringCase (ucs2_t *haystack, ucs2_t needle)
 
static const ucs2_t * findFirstOfSet (const ucs2_t *haystack, const ucs2_t *set)
 
static ucs2_t * findFirstOfSet (ucs2_t *haystack, const ucs2_t *set)
 
static const ucs2_t * findFirstOfSetOrEnd (const ucs2_t *haystack, const ucs2_t *set)
 
static ucs2_t * findFirstOfSetOrEnd (ucs2_t *haystack, const ucs2_t *set)
 
static const ucs2_t * findLastOfSet (const ucs2_t *haystack, const ucs2_t *set)
 
static ucs2_t * findLastOfSet (ucs2_t *haystack, const ucs2_t *set)
 
static const ucs2_t * findLastOfSetOrEnd (const ucs2_t *haystack, const ucs2_t *set)
 
static ucs2_t * findLastOfSetOrEnd (ucs2_t *haystack, const ucs2_t *set)
 
static ucs2_t * isBefore (const ucs2_t *str, const ucs2_t *delimiter)
 
static ucs2_t * isBetween (const ucs2_t *str, const ucs2_t *start, const ucs2_t *end)
 
static ucs2_t * isAfter (const ucs2_t *str, const ucs2_t *delimiter)
 
static size_t getLengthContainingSet (const ucs2_t *haystack, const ucs2_t *set)
 
static size_t getLengthNotContainingSet (const ucs2_t *haystack, const ucs2_t *set)
 
static ucs2_t * duplicate (const char *str)
 
static ucs2_t * duplicate (const char *str, size_t len)
 
static ucs2_t * duplicate (const char *str, bool bigendian)
 
static ucs2_t * duplicate (const char *str, size_t len, bool bigendian)
 
static ucs2_t * duplicate (const ucs2_t *str)
 
static ucs2_t * duplicate (const ucs2_t *str, size_t len)
 
static ucs2_t * duplicate (const wchar_t *str)
 
static ucs2_t * duplicate (const wchar_t *str, size_t len)
 
static ucs2_t * duplicate (const wchar_t *str, bool bigendian)
 
static ucs2_t * duplicate (const wchar_t *str, size_t len, bool bigendian)
 
static ucs2_t * duplicate (const wchar_t *str, ucs2_t replacement)
 
static ucs2_t * duplicate (const wchar_t *str, size_t len, ucs2_t replacement)
 
static ucs2_t * duplicate (const wchar_t *str, ucs2_t replacement, bool bigendian)
 
static ucs2_t * duplicate (const wchar_t *str, size_t len, ucs2_t replacement, bool bigendian)
 
static void upper (ucs2_t *str)
 
static void lower (ucs2_t *str)
 
static void capitalize (ucs2_t *str)
 
static void rightTrim (ucs2_t *str)
 
static void rightTrim (ucs2_t *str, ucs2_t character)
 
static void leftTrim (ucs2_t *str)
 
static void leftTrim (ucs2_t *str, ucs2_t character)
 
static void bothTrim (ucs2_t *str)
 
static void bothTrim (ucs2_t *str, ucs2_t character)
 
static bool strip (ucs2_t *str, ucs2_t character)
 
static bool strip (ucs2_t *str1, const ucs2_t *str2)
 
static bool stripSet (ucs2_t *str1, const ucs2_t *set)
 
static void replace (ucs2_t *str, ucs2_t oldchar, ucs2_t newchar)
 
static void replace (ucs2_t *str, const ucs2_t *oldchars, ucs2_t newchar)
 
static ucs2_t * replace (const ucs2_t *str, const ucs2_t *oldstr, const ucs2_t *newstr)
 
static ucs2_t * replace (const ucs2_t *str, const ucs2_t *const *oldstrset, const ucs2_t *const *newstrset)
 
static ucs2_t * replace (const ucs2_t *str, const ucs2_t *const *oldstrset, size_t *oldstrlen, const ucs2_t *const *newstrset)
 
static uint16_t getIntegerLength (int16_t number)
 
static uint16_t getIntegerLength (int32_t number)
 
static uint16_t getIntegerLength (int64_t number)
 
static uint16_t getIntegerLength (uint16_t number)
 
static uint16_t getIntegerLength (uint32_t number)
 
static uint16_t getIntegerLength (uint64_t number)
 
static bool isInteger (const ucs2_t *val)
 
static bool isInteger (const ucs2_t *val, int32_t len)
 
static bool isNumber (const ucs2_t *val)
 
static bool isNumber (const ucs2_t *val, int32_t len)
 
static ucs2_t * parseNumber (int16_t number)
 
static ucs2_t * parseNumber (uint16_t number)
 
static ucs2_t * parseNumber (int16_t number, uint16_t zeropadding)
 
static ucs2_t * parseNumber (uint16_t number, uint16_t zeropadding)
 
static ucs2_t * parseNumber (int32_t number)
 
static ucs2_t * parseNumber (uint32_t number)
 
static ucs2_t * parseNumber (int32_t number, uint16_t zeropadding)
 
static ucs2_t * parseNumber (uint32_t number, uint16_t zeropadding)
 
static ucs2_t * parseNumber (int64_t number)
 
static ucs2_t * parseNumber (uint64_t number)
 
static ucs2_t * parseNumber (int64_t number, uint16_t zeropadding)
 
static ucs2_t * parseNumber (uint64_t number, uint16_t zeropadding)
 
static ucs2_t * parseNumber (float number)
 
static ucs2_t * parseNumber (float number, uint16_t scale)
 
static ucs2_t * parseNumber (float number, uint16_t precision, uint16_t scale)
 
static ucs2_t * parseNumber (double number)
 
static ucs2_t * parseNumber (double number, uint16_t scale)
 
static ucs2_t * parseNumber (double number, uint16_t precision, uint16_t scale)
 
static ucs2_t * parseNumber (long double number)
 
static ucs2_t * parseNumber (long double number, uint16_t scale)
 
static ucs2_t * parseNumber (long double number, uint16_t precision, uint16_t scale)
 
static int64_t convertToInteger (const ucs2_t *string)
 
static int64_t convertToInteger (const ucs2_t *string, const ucs2_t **endptr)
 
static int64_t convertToInteger (const ucs2_t *string, int32_t base)
 
static int64_t convertToInteger (const ucs2_t *string, const ucs2_t **endptr, int32_t base)
 
static uint64_t convertToUnsignedInteger (const ucs2_t *string)
 
static uint64_t convertToUnsignedInteger (const ucs2_t *string, const ucs2_t **endptr)
 
static uint64_t convertToUnsignedInteger (const ucs2_t *string, int32_t base)
 
static uint64_t convertToUnsignedInteger (const ucs2_t *string, const ucs2_t **endptr, int32_t base)
 
static long double convertToFloat (const ucs2_t *string)
 
static long double convertToFloatC (const ucs2_t *string)
 
static long double convertToFloat (const ucs2_t *string, const ucs2_t **endptr)
 
static int64_t convertAmount (const ucs2_t *amount)
 
static ucs2_t * convertAmount (int64_t amount)
 
static ucs2_t * convertAmount (int64_t amount, uint16_t padding)
 
static ucs2_t * escape (const ucs2_t *input, const ucs2_t *characters)
 
static ucs2_t * unescape (const ucs2_t *input)
 
static void escape (const ucs2_t *input, uint64_t inputlength, ucs2_t **output, uint64_t *outputlength, const ucs2_t *characters)
 
static void unescape (const ucs2_t *input, uint64_t inputlength, ucs2_t **output, uint64_t *outputlength)
 
static void leftJustify (ucs2_t *str, int32_t len)
 
static void rightJustify (ucs2_t *str, int32_t len)
 
static void center (ucs2_t *str, int32_t len)
 
static ucs2_t * pad (const ucs2_t *string, ucs2_t padchar, int16_t direction, uint64_t totallength)
 
static void split (const ucs2_t *string, size_t stringlength, const ucs2_t *delimiter, size_t delimiterlength, bool collapse, ucs2_t ***list, uint64_t *listlength)
 
static void split (const ucs2_t *string, const ucs2_t *delimiter, size_t delimiterlength, bool collapse, ucs2_t ***list, uint64_t *listlength)
 
static void split (const ucs2_t *string, size_t stringlength, const ucs2_t *delimiter, bool collapse, ucs2_t ***list, uint64_t *listlength)
 
static void split (const ucs2_t *string, const ucs2_t *delimiter, bool collapse, ucs2_t ***list, uint64_t *listlength)
 
static ucs2_t * getSubString (const ucs2_t *str, size_t start, size_t end)
 
static ucs2_t * getSubString (const ucs2_t *str, size_t start)
 
static ucs2_t * insertString (const ucs2_t *dest, const ucs2_t *src, uint64_t index)
 
static ucs2_t * getHumanReadable (int64_t number)
 
static ucs2_t * getHumanReadable (int64_t number, bool onethousand)
 
static ucs2_t * getHumanReadable (uint64_t number)
 
static ucs2_t * getHumanReadable (uint64_t number, bool onethousand)
 
static ucs2_t * getHumanReadable (long double number)
 
static ucs2_t * getHumanReadable (long double number, bool onethousand)
 
static bool isByteOrderMark (const ucs2_t *str)
 
static bool isBigEndian (const ucs2_t *str)
 
static ssize_t printf (ucs2_t *buffer, size_t len, const ucs2_t *format,...)
 
static ssize_t printf (ucs2_t *buffer, size_t len, const ucs2_t *format, va_list *argp)
 
static ssize_t printf (ucs2_t **buffer, const ucs2_t *format,...)
 
static ssize_t printf (ucs2_t **buffer, const ucs2_t *format, va_list *argp)
 
static bool supportsPrintf ()
 

Detailed Description

The ucs2charstring class provides static methods for manipulating UCS-2 encoded character strings.

Member Function Documentation

◆ append() [1/7]

static ucs2_t* ucs2charstring::append ( ucs2_t *  dest,
const ucs2_t *  source 
)
static

Appends "source" to "dest". Assumes that there is enough room remaining in "dest" to accommodate the new string. Returns a pointer to "dest".

◆ append() [2/7]

static ucs2_t* ucs2charstring::append ( ucs2_t *  dest,
const ucs2_t *  source,
size_t  len 
)
static

Appends "len" characters of "source" to "dest". Assumes that there is enough room remaining in "dest" to accommodate the new string. Returns a pointer to "dest".

◆ append() [3/7]

static ucs2_t* ucs2charstring::append ( ucs2_t *  dest,
double  number 
)
static

Converts "number" to a string and appends it to "dest". Assumes that there is enough room remaining in "dest" to accommodate the new string. Returns a pointer to "dest".

◆ append() [4/7]

static ucs2_t* ucs2charstring::append ( ucs2_t *  dest,
double  number,
uint16_t  precision,
uint16_t  scale 
)
static

Converts "number" to a string using "precision" and "scale" and appends it to "dest". Assumes that there is enough room remaining in "dest" to accommodate the new string. Returns a pointer to "dest".

◆ append() [5/7]

static ucs2_t* ucs2charstring::append ( ucs2_t *  dest,
double  number,
uint16_t  scale 
)
static

Converts "number" to a string using "scale" and appends it to "dest". Assumes that there is enough room remaining in "dest" to accommodate the new string. Returns a pointer to "dest".

◆ append() [6/7]

static ucs2_t* ucs2charstring::append ( ucs2_t *  dest,
int64_t  number 
)
static

Converts "number" to a string and appends it to "dest". Assumes that there is enough room remaining in "dest" to accommodate the new string. Returns a pointer to "dest".

◆ append() [7/7]

static ucs2_t* ucs2charstring::append ( ucs2_t *  dest,
uint64_t  number 
)
static

Converts "number" to a string and appends it to "dest". Assumes that there is enough room remaining in "dest" to accommodate the new string. Returns a pointer to "dest".

◆ bothTrim() [1/2]

static void ucs2charstring::bothTrim ( ucs2_t *  str)
static

Trims all spaces off of both sides of "str".

◆ bothTrim() [2/2]

static void ucs2charstring::bothTrim ( ucs2_t *  str,
ucs2_t  character 
)
static

Trims all characters off of both sides of "str".

◆ capitalize()

static void ucs2charstring::capitalize ( ucs2_t *  str)
static

Captitalizes "str", converting characters to upper or lower case as necessary.

◆ center()

static void ucs2charstring::center ( ucs2_t *  str,
int32_t  len 
)
static

Centers the text of "str" for "len" characters.

Example: "hello " -> " hello "

◆ compare() [1/2]

static int32_t ucs2charstring::compare ( const ucs2_t *  str1,
const ucs2_t *  str2 
)
static

Returns -1,0 or 1 if "str1" is greater than, equal to or less than "str2".

◆ compare() [2/2]

static int32_t ucs2charstring::compare ( const ucs2_t *  str1,
const ucs2_t *  str2,
size_t  length 
)
static

Returns -1,0 or 1 if "length" characters of "str1" are greater than, equal to or less than "size" bytes of "str2".

◆ compareIgnoringCase() [1/2]

static int32_t ucs2charstring::compareIgnoringCase ( const ucs2_t *  str1,
const ucs2_t *  str2 
)
static

Returns -1,0 or 1 if "str1" is greater than, equal to or less than "str2", ignoring case.

◆ compareIgnoringCase() [2/2]

static int32_t ucs2charstring::compareIgnoringCase ( const ucs2_t *  str1,
const ucs2_t *  str2,
size_t  len 
)
static

Returns -1,0 or 1 if "len" characters of "str1" are greater than, equal to or less than "size" bytes of "str2", ignoring case.

◆ compareNatural() [1/2]

static int32_t ucs2charstring::compareNatural ( const ucs2_t *  str1,
const ucs2_t *  str2 
)
static

Returns -1,0 or 1 if "str1" is greater than, equal to or less than "str2".

Embedded (version) numbers will be interpreted "naturally" (eg. 12 > 8)

◆ compareNatural() [2/2]

static int32_t ucs2charstring::compareNatural ( const ucs2_t *  str1,
const ucs2_t *  str2,
const ucs2_t *  delimiters 
)
static

Returns -1,0 or 1 if "str1" is greater than, equal to or less than "str2".

Embedded (version) numbers will be interpreted "naturally" (eg. 12 > 8)

"delimiters" should be set to the set of characters that will be interpreted as equivalent delimiters. Eg. "._" means that either .'s or _'s may be used to delimit numbers.

◆ compareVersions() [1/2]

static int32_t ucs2charstring::compareVersions ( const ucs2_t *  str1,
const ucs2_t *  str2 
)
static

Returns -1,0 or 1 if "str1" is greater than, equal to or less than "str2", where "str1" and "str2" are version numbers with arbitrary numbers of decimal delimiters.

◆ compareVersions() [2/2]

static int32_t ucs2charstring::compareVersions ( const ucs2_t *  str1,
const ucs2_t *  str2,
const ucs2_t *  delimiters 
)
static

Returns -1,0 or 1 if "str1" is greater than, equal to or less than "str2", where "str1" and "str2" are version numbers with arbitrary numbers of delimiters.

"delimiters" should be set to the set of characters that will be interpreted as equivalent delimiters. Eg. "._" means that either .'s or _'s may be used to delimiters numbers.

◆ compareWithWildcards() [1/4]

static bool ucs2charstring::compareWithWildcards ( const ucs2_t *  string,
const ucs2_t *  pattern,
size_t  patternlength,
ucs2_t  singlewildcard,
ucs2_t  multiwildcard 
)
static

Compares "string" to the first "patternlength" characters of "pattern" which may contain instances of single-character wildcard markers "singlewildcard" or multi-character wildcard markers "multiwildcard".

If either "singlewildcard" or "multiwildcard" are '\0' then they are ignored.

Returns true if a match is found or false otherwise.

◆ compareWithWildcards() [2/4]

static bool ucs2charstring::compareWithWildcards ( const ucs2_t *  string,
const ucs2_t *  pattern,
ucs2_t  singlewildcard,
ucs2_t  multiwildcard 
)
static

Compares "string" to "pattern" which may contain instances of single-character wildcard markers "singlewildcard" or multi-character wildcard markers "multiwildcard".

If either "singlewildcard" or "multiwildcard" are '\0' then they are ignored.

Returns true if a match is found or false otherwise.

◆ compareWithWildcards() [3/4]

static bool ucs2charstring::compareWithWildcards ( const ucs2_t *  string,
size_t  stringlength,
const ucs2_t *  pattern,
size_t  patternlength,
ucs2_t  singlewildcard,
ucs2_t  multiwildcard 
)
static

Compares the first "stringlength" characters of "string" to the first "patternlength" characters of "pattern" which may contain instances of single-character wildcard markers "singlewildcard" or multi-character wildcard markers "multiwildcard".

If either "singlewildcard" or "multiwildcard" are '\0' then they are ignored.

Returns true if a match is found or false otherwise.

◆ compareWithWildcards() [4/4]

static bool ucs2charstring::compareWithWildcards ( const ucs2_t *  string,
size_t  stringlength,
const ucs2_t *  pattern,
ucs2_t  singlewildcard,
ucs2_t  multiwildcard 
)
static

Compares the first "stringlength" characters of "string" to "pattern" which may contain instances of single-character wildcard markers "singlewildcard" or multi-character wildcard markers "multiwildcard".

If either "singlewildcard" or "multiwildcard" are '\0' then they are ignored.

Returns true if a match is found or false otherwise.

◆ contains() [1/2]

static bool ucs2charstring::contains ( const ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns true if "haystack" contains "needle" or false otherwise.

◆ contains() [2/2]

static bool ucs2charstring::contains ( const ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns true if "haystack" contains "needle" or false otherwise.

◆ containsIgnoringCase() [1/2]

static bool ucs2charstring::containsIgnoringCase ( const ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns true if "haystack" contains "needle", ignoring case, or false otherwise.

◆ containsIgnoringCase() [2/2]

static bool ucs2charstring::containsIgnoringCase ( const ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns true if "haystack" contains "needle", ignoring case, or false otherwise.

◆ convertAmount() [1/3]

static int64_t ucs2charstring::convertAmount ( const ucs2_t *  amount)
static

Converts "amount" which is assumed to be a dollar amount into pennies.

◆ convertAmount() [2/3]

static ucs2_t* ucs2charstring::convertAmount ( int64_t  amount)
static

Converts "amount" which is assumed to be a number of pennies into a dollar amount string.

◆ convertAmount() [3/3]

static ucs2_t* ucs2charstring::convertAmount ( int64_t  amount,
uint16_t  padding 
)
static

Converts "amount" which is assumed to be a number of pennies into a dollar amount string where there are "padding" places between the dollar sign and decimal point. These will be space padded if the amount is small enough not to fill them.

◆ convertToFloat() [1/2]

static long double ucs2charstring::convertToFloat ( const ucs2_t *  string)
static

Converts "string" to a floating point number.

◆ convertToFloat() [2/2]

static long double ucs2charstring::convertToFloat ( const ucs2_t *  string,
const ucs2_t **  endptr 
)
static

Converts "string" to a floating point number. If non-NULL, endptr will be set to the first character in the string after the number.

◆ convertToFloatC()

static long double ucs2charstring::convertToFloatC ( const ucs2_t *  string)
static

Converts "string" to a floating point number.

If "string" uses a "." as a decimal point (per the "C" locale) then the "." is first converted to the appropriate decimal-delimiter for the current locale.

(Currently only supported on linux/unix platforms that provide the locale.h header. On other platforms, it just falls through to convertToFloat().)

◆ convertToInteger() [1/4]

static int64_t ucs2charstring::convertToInteger ( const ucs2_t *  string)
static

Converts "string" to a 64-bit integer.

◆ convertToInteger() [2/4]

static int64_t ucs2charstring::convertToInteger ( const ucs2_t *  string,
const ucs2_t **  endptr 
)
static

Converts "string" to a 64-bit integer. If non-NULL, endptr will be set to the first character in the string after the number.

◆ convertToInteger() [3/4]

static int64_t ucs2charstring::convertToInteger ( const ucs2_t *  string,
const ucs2_t **  endptr,
int32_t  base 
)
static

Converts "string" to a 64-bit integer of base "base". If non-NULL, endptr will be set to the first character in the string after the number.

◆ convertToInteger() [4/4]

static int64_t ucs2charstring::convertToInteger ( const ucs2_t *  string,
int32_t  base 
)
static

Converts "string" to a 64-bit integer of base "base".

◆ convertToUnsignedInteger() [1/4]

static uint64_t ucs2charstring::convertToUnsignedInteger ( const ucs2_t *  string)
static

Converts "string" to a 64-bit unsigned integer.

◆ convertToUnsignedInteger() [2/4]

static uint64_t ucs2charstring::convertToUnsignedInteger ( const ucs2_t *  string,
const ucs2_t **  endptr 
)
static

Converts "string" to a 64-bit unsigned integer. If non-NULL, endptr will be set to the first character in the string after the number.

◆ convertToUnsignedInteger() [3/4]

static uint64_t ucs2charstring::convertToUnsignedInteger ( const ucs2_t *  string,
const ucs2_t **  endptr,
int32_t  base 
)
static

Converts "string" to a 64-bit unsigned integer of base "base". If non-NULL, endptr will be set to the first character in the string after the number.

◆ convertToUnsignedInteger() [4/4]

static uint64_t ucs2charstring::convertToUnsignedInteger ( const ucs2_t *  string,
int32_t  base 
)
static

Converts "string" to a 64-bit unsigned integer of base "base".

◆ copy() [1/4]

static ucs2_t* ucs2charstring::copy ( ucs2_t *  dest,
const ucs2_t *  source 
)
static

Replaces "dest" with "source". Assumes that there is enough room in "dest" to accommodate "source". Returns a pointer to "dest".

◆ copy() [2/4]

static ucs2_t* ucs2charstring::copy ( ucs2_t *  dest,
const ucs2_t *  source,
size_t  len 
)
static

Replaces the first "length" characters of "dest" with "source". Assumes that "dest" is at least "size" bytes long. Returns a pointer to "dest".

◆ copy() [3/4]

static ucs2_t* ucs2charstring::copy ( ucs2_t *  dest,
size_t  location,
const ucs2_t *  source 
)
static

Replaces "dest" with "source", starting "location" bytes into "dest". Assumes that there is enough room in "dest" (after "location" bytes) to accommodate "source". Returns a pointer to "dest".

◆ copy() [4/4]

static ucs2_t* ucs2charstring::copy ( ucs2_t *  dest,
size_t  location,
const ucs2_t *  source,
size_t  len 
)
static

Replaces "len" characters of "dest" with "source", starting "location" bytes into "dest". Assumes that there are "size" bytes in "dest" (after "location" bytes). Returns a pointer to "dest".

◆ duplicate() [1/14]

static ucs2_t* ucs2charstring::duplicate ( const char *  str)
static

Creates a duplicate of "str" and returns a pointer to it.

The return value will be in the byte-order of the system.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [2/14]

static ucs2_t* ucs2charstring::duplicate ( const char *  str,
bool  bigendian 
)
static

Creates a duplicate of "str" and returns a pointer to it.

If "bigendian" is true then the return value will be in big endian byte-order. If "bigendian" is false then the return value will be in little endian byte-order.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [3/14]

static ucs2_t* ucs2charstring::duplicate ( const char *  str,
size_t  len 
)
static

Creates a duplicate of the first "len" characters of "str" and returns a pointer to it.

The return value will be in the byte-order of the system.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [4/14]

static ucs2_t* ucs2charstring::duplicate ( const char *  str,
size_t  len,
bool  bigendian 
)
static

Creates a duplicate of the first "len" characters of "str" and returns a pointer to it.

If "bigendian" is true then the return value will be in big endian byte-order. If "bigendian" is false then the return value will be in little endian byte-order.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [5/14]

static ucs2_t* ucs2charstring::duplicate ( const ucs2_t *  str)
static

Creates a duplicate of "str" and returns a pointer to it.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [6/14]

static ucs2_t* ucs2charstring::duplicate ( const ucs2_t *  str,
size_t  len 
)
static

Creates a duplicate of the first "len" characters of "str" and returns a pointer to it.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [7/14]

static ucs2_t* ucs2charstring::duplicate ( const wchar_t *  str)
static

Creates a duplicate "str", converting each wide character to a UCS-2 character, replacing characters that can't be represented in UCS-2 with a UCS-2 '?', and returns a pointer to it.

The return value will be in the byte-order of the system.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [8/14]

static ucs2_t* ucs2charstring::duplicate ( const wchar_t *  str,
bool  bigendian 
)
static

Creates a duplicate "str", converting each wide character to a UCS-2 character, replacing characters that can't be represented in UCS-2 with a UCS-2 '?', and returns a pointer to it.

If "bigendian" is true then the return value will be in big endian byte-order. If "bigendian" is false then the return value will be in little endian byte-order.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [9/14]

static ucs2_t* ucs2charstring::duplicate ( const wchar_t *  str,
size_t  len 
)
static

Creates a duplicate of the first "len" wide characters of "str", converting each wide character to a character per the character set of the current locale, replacing characters that can't be represented '?', and returns a pointer to it.

The return value will be in the byte-order of the system.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [10/14]

static ucs2_t* ucs2charstring::duplicate ( const wchar_t *  str,
size_t  len,
bool  bigendian 
)
static

Creates a duplicate of the first "len" wide characters of "str", converting each wide character to a character per the character set of the current locale, replacing characters that can't be represented '?', and returns a pointer to it.

If "bigendian" is true then the return value will be in big endian byte-order. If "bigendian" is false then the return value will be in little endian byte-order.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [11/14]

static ucs2_t* ucs2charstring::duplicate ( const wchar_t *  str,
size_t  len,
ucs2_t  replacement 
)
static

Creates a duplicate of the first "len" wide characters of "str", converting each wide character to a character per the character set of the current locale, replacing characters that can't be represented with "replacement", and returns a pointer to it.

The return value will be in the byte-order of the system.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [12/14]

static ucs2_t* ucs2charstring::duplicate ( const wchar_t *  str,
size_t  len,
ucs2_t  replacement,
bool  bigendian 
)
static

Creates a duplicate of the first "len" wide characters of "str", converting each wide character to a character per the character set of the current locale, replacing characters that can't be represented with "replacement", and returns a pointer to it.

If "bigendian" is true then the return value will be in big endian byte-order. If "bigendian" is false then the return value will be in little endian byte-order.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [13/14]

static ucs2_t* ucs2charstring::duplicate ( const wchar_t *  str,
ucs2_t  replacement 
)
static

Creates a duplicate of "str", converting each wide character to a character per the character set of the current locale, replacing characters that can't be represented with "replacement", and returns a pointer to it.

The return value will be in the byte-order of the system.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ duplicate() [14/14]

static ucs2_t* ucs2charstring::duplicate ( const wchar_t *  str,
ucs2_t  replacement,
bool  bigendian 
)
static

Creates a duplicate of "str", converting each wide character to a character per the character set of the current locale, replacing characters that can't be represented with "replacement", and returns a pointer to it.

If "bigendian" is true then the return value will be in big endian byte-order. If "bigendian" is false then the return value will be in little endian byte-order.

Note that this method allocates a buffer for the duplicate string internally and returns it. The calling program must deallocate this buffer.

◆ endsWith()

static bool ucs2charstring::endsWith ( const ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns true if "haystack" ends with "needle" or false otherwise.

◆ escape() [1/2]

static ucs2_t* ucs2charstring::escape ( const ucs2_t *  input,
const ucs2_t *  characters 
)
static

escapes all characters in "characters" found in "input" using \'s and returns it in a buffer allocated inside the function. This buffer must be deleted by the calling program.

◆ escape() [2/2]

static void ucs2charstring::escape ( const ucs2_t *  input,
uint64_t  inputlength,
ucs2_t **  output,
uint64_t *  outputlength,
const ucs2_t *  characters 
)
static

similar to escape() above, but takes an "inputlength" parameter and returns the result in "output" and "outputlength" rather than in a return value

◆ findFirst() [1/4]

static const ucs2_t* ucs2charstring::findFirst ( const ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack" or NULL if not found.

◆ findFirst() [2/4]

static const ucs2_t* ucs2charstring::findFirst ( const ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack" or NULL if not found.

◆ findFirst() [3/4]

static ucs2_t* ucs2charstring::findFirst ( ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack" or NULL if not found.

◆ findFirst() [4/4]

static ucs2_t* ucs2charstring::findFirst ( ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack" or NULL if not found.

◆ findFirstIgnoringCase() [1/4]

static const ucs2_t* ucs2charstring::findFirstIgnoringCase ( const ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack", ignoring case, or NULL if not found.

◆ findFirstIgnoringCase() [2/4]

static const ucs2_t* ucs2charstring::findFirstIgnoringCase ( const ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack", ignoring case, or NULL if not found.

◆ findFirstIgnoringCase() [3/4]

static ucs2_t* ucs2charstring::findFirstIgnoringCase ( ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack", ignoring case, or NULL if not found.

◆ findFirstIgnoringCase() [4/4]

static ucs2_t* ucs2charstring::findFirstIgnoringCase ( ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack", ignoring case, or NULL if not found.

◆ findFirstOfSet() [1/2]

static const ucs2_t* ucs2charstring::findFirstOfSet ( const ucs2_t *  haystack,
const ucs2_t *  set 
)
static

Returns a pointer to the first occurence in "haystack" of any of the characters in "set" or NULL if not found.

◆ findFirstOfSet() [2/2]

static ucs2_t* ucs2charstring::findFirstOfSet ( ucs2_t *  haystack,
const ucs2_t *  set 
)
static

Returns a pointer to the first occurence in "haystack" of any of the characters in "set" or NULL if not found.

◆ findFirstOfSetOrEnd() [1/2]

static const ucs2_t* ucs2charstring::findFirstOfSetOrEnd ( const ucs2_t *  haystack,
const ucs2_t *  set 
)
static

Returns a pointer to the first occurence in "haystack" of any of the characters in "set" or a pointer to the NULL terminator at the end of the string if not found.

◆ findFirstOfSetOrEnd() [2/2]

static ucs2_t* ucs2charstring::findFirstOfSetOrEnd ( ucs2_t *  haystack,
const ucs2_t *  set 
)
static

Returns a pointer to the first occurence in "haystack" of any of the characters in "set". or a pointer to the NULL terminator at the end of the string if not found.

◆ findFirstOrEnd() [1/3]

static const ucs2_t* ucs2charstring::findFirstOrEnd ( const ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack" or a pointer to the NULL terminator at the end of the string if not found.

◆ findFirstOrEnd() [2/3]

static const ucs2_t* ucs2charstring::findFirstOrEnd ( const ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack" or a pointer to the NULL terminator at the end of the string if not found.

◆ findFirstOrEnd() [3/3]

static ucs2_t* ucs2charstring::findFirstOrEnd ( ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack" or a pointer to the NULL terminator at the end of the string if not found.

◆ findFirstOrEndIgnoringCase() [1/3]

static const ucs2_t* ucs2charstring::findFirstOrEndIgnoringCase ( const ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack", ignoring case, or a pointer to the NULL terminator at the end of the string if not found.

◆ findFirstOrEndIgnoringCase() [2/3]

static const ucs2_t* ucs2charstring::findFirstOrEndIgnoringCase ( const ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack", ignoring case, or a pointer to the NULL terminator at the end of the string if not found.

◆ findFirstOrEndIgnoringCase() [3/3]

static ucs2_t* ucs2charstring::findFirstOrEndIgnoringCase ( ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the first occurrance of "needle" in "haystack", ignoring case, or a pointer to the NULL terminator at the end of the string if not found.

◆ findLast() [1/4]

static const ucs2_t* ucs2charstring::findLast ( const ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the last occurrance of "needle" in "haystack" or NULL if not found.

◆ findLast() [2/4]

static const ucs2_t* ucs2charstring::findLast ( const ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns a pointer to the last occurrance of "needle" in "haystack" or NULL if not found.

◆ findLast() [3/4]

static ucs2_t* ucs2charstring::findLast ( ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the last occurrance of "needle" in "haystack" or NULL if not found.

◆ findLast() [4/4]

static ucs2_t* ucs2charstring::findLast ( ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns a pointer to the last occurrance of "needle" in "haystack" or NULL if not found.

◆ findLastIgnoringCase() [1/4]

static const ucs2_t* ucs2charstring::findLastIgnoringCase ( const ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the last occurrance of "needle" in "haystack", ignoring case, or NULL if not found.

◆ findLastIgnoringCase() [2/4]

static const ucs2_t* ucs2charstring::findLastIgnoringCase ( const ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns a pointer to the last occurrance of "needle" in "haystack", ignoring case, or NULL if not found.

◆ findLastIgnoringCase() [3/4]

static ucs2_t* ucs2charstring::findLastIgnoringCase ( ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns a pointer to the last occurrance of "needle" in "haystack", ignoring case, or NULL if not found.

◆ findLastIgnoringCase() [4/4]

static ucs2_t* ucs2charstring::findLastIgnoringCase ( ucs2_t *  haystack,
ucs2_t  needle 
)
static

Returns a pointer to the last occurrance of "needle" in "haystack", ignoring case, or NULL if not found.

◆ findLastOfSet() [1/2]

static const ucs2_t* ucs2charstring::findLastOfSet ( const ucs2_t *  haystack,
const ucs2_t *  set 
)
static

Returns a pointer to the last occurence in "haystack" of any of the characters in "set" or NULL if not found.

◆ findLastOfSet() [2/2]

static ucs2_t* ucs2charstring::findLastOfSet ( ucs2_t *  haystack,
const ucs2_t *  set 
)
static

Returns a pointer to the last occurence in "haystack" of any of the characters in "set" or NULL if not found.

◆ findLastOfSetOrEnd() [1/2]

static const ucs2_t* ucs2charstring::findLastOfSetOrEnd ( const ucs2_t *  haystack,
const ucs2_t *  set 
)
static

Returns a pointer to the last occurence in "haystack" of any of the characters in "set" or a pointer to the NULL terminator at the end of the string if not found.

◆ findLastOfSetOrEnd() [2/2]

static ucs2_t* ucs2charstring::findLastOfSetOrEnd ( ucs2_t *  haystack,
const ucs2_t *  set 
)
static

Returns a pointer to the last occurence in "haystack" of any of the characters in "set". or a pointer to the NULL terminator at the end of the string if not found.

◆ getHumanReadable() [1/6]

static ucs2_t* ucs2charstring::getHumanReadable ( int64_t  number)
static

Returns a human-readable version of the number.

Eg. 128, 1.2K, 2.4M, 3.5G, 4.6T, etc.

Where 1K = 1024.

◆ getHumanReadable() [2/6]

static ucs2_t* ucs2charstring::getHumanReadable ( int64_t  number,
bool  onethousand 
)
static

Returns a human-readable version of the number.

Eg. 128, 1.2K, 2.4M, 3.5G, 4.6T, etc.

If "onethousand" = true then 1K = 1000, otherwise 1K = 1024.

◆ getHumanReadable() [3/6]

static ucs2_t* ucs2charstring::getHumanReadable ( long double  number)
static

Returns a human-readable version of the number.

Eg. 128, 1.2K, 2.4M, 3.5G, 4.6T, etc.

◆ getHumanReadable() [4/6]

static ucs2_t* ucs2charstring::getHumanReadable ( long double  number,
bool  onethousand 
)
static

Returns a human-readable version of the number.

Eg. 128, 1.2K, 2.4M, 3.5G, 4.6T, etc.

If "onethousand" = true then 1K = 1000, otherwise 1K = 1024.

◆ getHumanReadable() [5/6]

static ucs2_t* ucs2charstring::getHumanReadable ( uint64_t  number)
static

Returns a human-readable version of the number.

Eg. 128, 1.2K, 2.4M, 3.5G, 4.6T, etc.

◆ getHumanReadable() [6/6]

static ucs2_t* ucs2charstring::getHumanReadable ( uint64_t  number,
bool  onethousand 
)
static

Returns a human-readable version of the number.

Eg. 128, 1.2K, 2.4M, 3.5G, 4.6T, etc.

If "onethousand" = true then 1K = 1000, otherwise 1K = 1024.

◆ getIntegerLength() [1/6]

static uint16_t ucs2charstring::getIntegerLength ( int16_t  number)
static

Returns the number of characters needed to represent "number" as a string.

◆ getIntegerLength() [2/6]

static uint16_t ucs2charstring::getIntegerLength ( int32_t  number)
static

Returns the number of characters needed to represent "number" as a string.

◆ getIntegerLength() [3/6]

static uint16_t ucs2charstring::getIntegerLength ( int64_t  number)
static

Returns the number of characters needed to represent "number" as a string.

◆ getIntegerLength() [4/6]

static uint16_t ucs2charstring::getIntegerLength ( uint16_t  number)
static

Returns the number of characters needed to represent "number" as a string.

◆ getIntegerLength() [5/6]

static uint16_t ucs2charstring::getIntegerLength ( uint32_t  number)
static

Returns the number of characters needed to represent "number" as a string.

◆ getIntegerLength() [6/6]

static uint16_t ucs2charstring::getIntegerLength ( uint64_t  number)
static

Returns the number of characters needed to represent "number" as a string.

◆ getLength()

static size_t ucs2charstring::getLength ( const ucs2_t *  string)
static

Returns the number of characters in "string".

◆ getLengthContainingSet()

static size_t ucs2charstring::getLengthContainingSet ( const ucs2_t *  haystack,
const ucs2_t *  set 
)
static

Returns the number of characters, starting at the beginning of "haystack" which consists entirely of characters in "set".

◆ getLengthNotContainingSet()

static size_t ucs2charstring::getLengthNotContainingSet ( const ucs2_t *  haystack,
const ucs2_t *  set 
)
static

Returns the number of characters, starting at the beginning of "haystack" which consists entirely of characters not in "set".

◆ getSize()

static size_t ucs2charstring::getSize ( const ucs2_t *  string)
static

Returns the number of bytes in "string", including the null terminator.

◆ getSubString() [1/2]

static ucs2_t* ucs2charstring::getSubString ( const ucs2_t *  str,
size_t  start 
)
static

Returns a copy of the segment of "str" between string index "start" and the end of the string, inclusive.

◆ getSubString() [2/2]

static ucs2_t* ucs2charstring::getSubString ( const ucs2_t *  str,
size_t  start,
size_t  end 
)
static

Returns a copy of the segment of "str" between string indices "start" and "end", inclusive.

◆ insertString()

static ucs2_t* ucs2charstring::insertString ( const ucs2_t *  dest,
const ucs2_t *  src,
uint64_t  index 
)
static

Creates a new string with "src" inserted into "dest" at "index".

◆ isAfter()

static ucs2_t* ucs2charstring::isAfter ( const ucs2_t *  str,
const ucs2_t *  delimiter 
)
static

Returns the string from the "delimiter" until the end of the string. Note that this method allocates a buffer for the return value internally and returns it. The calling program must deallocate this buffer.

◆ isBefore()

static ucs2_t* ucs2charstring::isBefore ( const ucs2_t *  str,
const ucs2_t *  delimiter 
)
static

Returns the string from the beginning of "str" until Note that this method allocates a buffer for the return value internally and returns it. The calling program must deallocate this buffer.

◆ isBetween()

static ucs2_t* ucs2charstring::isBetween ( const ucs2_t *  str,
const ucs2_t *  start,
const ucs2_t *  end 
)
static

Returns the string between "start" and "end". Note that this method allocates a buffer for the return value internally and returns it. The calling program must deallocate this buffer.

◆ isBigEndian()

static bool ucs2charstring::isBigEndian ( const ucs2_t *  str)
static

Returns true if the current character in "str" is a bigendian byte-order mark and false otherwise.

◆ isByteOrderMark()

static bool ucs2charstring::isByteOrderMark ( const ucs2_t *  str)
static

Returns true if the current character in "str" is the byte order mark and false otherwise.

◆ isInSet()

static bool ucs2charstring::isInSet ( const ucs2_t *  str,
const ucs2_t *const *  set 
)
static

Returns true if "str" is found among the values in the NULL-terminated array "set". Also returns true if "str" is NULL and set is NULL or contains only a NULL-terminator. Otherwise returns false.

◆ isInSetIgnoringCase()

static bool ucs2charstring::isInSetIgnoringCase ( const ucs2_t *  str,
const ucs2_t *const *  set 
)
static

Returns true if "str" is found among the values in the NULL-terminated array "set", ignoring case. Also returns true if "str" is NULL and set is NULL or contains only a NULL-terminator. Otherwise returns false.

◆ isInteger() [1/2]

static bool ucs2charstring::isInteger ( const ucs2_t *  val)
static

Returns true if the string "val" is an integer and false if it is not an integer.

◆ isInteger() [2/2]

static bool ucs2charstring::isInteger ( const ucs2_t *  val,
int32_t  len 
)
static

Returns true if the string "val" is an integer and false if it is not an integer.

◆ isNo()

static bool ucs2charstring::isNo ( const ucs2_t *  string)
static

Returns true if "string" starts with the standalone word: "No" (case-insensitive), "False" (case-insensitive), or "0" and false otherwise.

(Eg. returns true for "No,", "False ", and "0 1 2" but returns false for "Nothing", "Falsest", and "012")

◆ isNullOrEmpty()

static bool ucs2charstring::isNullOrEmpty ( const ucs2_t *  string)
static

Returns true if "string" is NULL or the empty string.

◆ isNumber() [1/2]

static bool ucs2charstring::isNumber ( const ucs2_t *  val)
static

Returns true the string "val" is a number and false if it is not a number

◆ isNumber() [2/2]

static bool ucs2charstring::isNumber ( const ucs2_t *  val,
int32_t  len 
)
static

Returns true the string "val" is a number and false if it is not a number

◆ isYes()

static bool ucs2charstring::isYes ( const ucs2_t *  string)
static

Returns true if "string" starts with the standalone "word": "Yes" (case-insensitive), "True" (case-insensitive), "Y" (case-insensitive), "T" (case-insensitive), or "1" and false otherwise.

(Eg. returns true for "Yes,", "True ", and "1 2 3" but returns false for "Yesterday", "Truest", and "123")

◆ leftJustify()

static void ucs2charstring::leftJustify ( ucs2_t *  str,
int32_t  len 
)
static

Moves leading spaces to the end of "str" for "len" characters.

Example: " hello " -> "hello "

◆ leftTrim() [1/2]

static void ucs2charstring::leftTrim ( ucs2_t *  str)
static

Trims all spaces off of the left hand side of "str".

◆ leftTrim() [2/2]

static void ucs2charstring::leftTrim ( ucs2_t *  str,
ucs2_t  character 
)
static

Trims all "character"'s off of the left hand side of "str".

◆ lower()

static void ucs2charstring::lower ( ucs2_t *  str)
static

Converts "str" to lowercase.

◆ pad()

static ucs2_t* ucs2charstring::pad ( const ucs2_t *  string,
ucs2_t  padchar,
int16_t  direction,
uint64_t  totallength 
)
static

Returns a copy of "string", padded with "padchar" to a character length of "totallength". Set "direction" to -1 to left-pad, 0 to center-pad and 1 to right-pad. Note that this method allocates a buffer internally and returns it. The calling program must deallocate this buffer.

◆ parseNumber() [1/21]

static ucs2_t* ucs2charstring::parseNumber ( double  number)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [2/21]

static ucs2_t* ucs2charstring::parseNumber ( double  number,
uint16_t  precision,
uint16_t  scale 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [3/21]

static ucs2_t* ucs2charstring::parseNumber ( double  number,
uint16_t  scale 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [4/21]

static ucs2_t* ucs2charstring::parseNumber ( float  number)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [5/21]

static ucs2_t* ucs2charstring::parseNumber ( float  number,
uint16_t  precision,
uint16_t  scale 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [6/21]

static ucs2_t* ucs2charstring::parseNumber ( float  number,
uint16_t  scale 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [7/21]

static ucs2_t* ucs2charstring::parseNumber ( int16_t  number)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [8/21]

static ucs2_t* ucs2charstring::parseNumber ( int16_t  number,
uint16_t  zeropadding 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [9/21]

static ucs2_t* ucs2charstring::parseNumber ( int32_t  number)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [10/21]

static ucs2_t* ucs2charstring::parseNumber ( int32_t  number,
uint16_t  zeropadding 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [11/21]

static ucs2_t* ucs2charstring::parseNumber ( int64_t  number)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [12/21]

static ucs2_t* ucs2charstring::parseNumber ( int64_t  number,
uint16_t  zeropadding 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [13/21]

static ucs2_t* ucs2charstring::parseNumber ( long double  number)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [14/21]

static ucs2_t* ucs2charstring::parseNumber ( long double  number,
uint16_t  precision,
uint16_t  scale 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [15/21]

static ucs2_t* ucs2charstring::parseNumber ( long double  number,
uint16_t  scale 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [16/21]

static ucs2_t* ucs2charstring::parseNumber ( uint16_t  number)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [17/21]

static ucs2_t* ucs2charstring::parseNumber ( uint16_t  number,
uint16_t  zeropadding 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [18/21]

static ucs2_t* ucs2charstring::parseNumber ( uint32_t  number)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [19/21]

static ucs2_t* ucs2charstring::parseNumber ( uint32_t  number,
uint16_t  zeropadding 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [20/21]

static ucs2_t* ucs2charstring::parseNumber ( uint64_t  number)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ parseNumber() [21/21]

static ucs2_t* ucs2charstring::parseNumber ( uint64_t  number,
uint16_t  zeropadding 
)
static

Returns a string representing "number". The string is allocated inside the function and must be deleted by the calling program.

◆ printf() [1/4]

static ssize_t ucs2charstring::printf ( ucs2_t **  buffer,
const ucs2_t *  format,
va_list *  argp 
)
static

Allocates "buffer" to sufficient size and writes "argp" to it using "format" which should comply with standard printf formatting rules.

Returns the number of characters written to "buffer" excluding the NULL terminator.

If "buffer" is NULL then nothing is written to "buffer" and 0 is returned.

Returns -1 if an error occurred.

NOTE: wide character sequences will be converted to sequences of UCS-2 characters.

◆ printf() [2/4]

static ssize_t ucs2charstring::printf ( ucs2_t **  buffer,
const ucs2_t *  format,
  ... 
)
static

Allocates "buffer" to sufficient size and writes "..." to it using "format" which should comply with standard printf formatting rules.

Returns the number of characters written to "buffer" excluding the NULL terminator.

If "buffer" is NULL then nothing is written to "buffer" and 0 is returned.

Returns -1 if an error occurred.

NOTE: wide character sequences will be converted to sequences of UCS-2 characters.

◆ printf() [3/4]

static ssize_t ucs2charstring::printf ( ucs2_t *  buffer,
size_t  len,
const ucs2_t *  format,
va_list *  argp 
)
static

Appends "argp" to "buffer" of character length "len" using "format" which should comply with standard printf formatting rules.

Note that argp is a pointer to a va_list, not just a va_list.

Returns the number of characters written to "buffer" excluding the NULL terminator. If "buffer" wasn't large enough to accommodate the data then it only writes "len" bytes to "buffer" but still returns the number of characters that would have been written had "buffer" been large enough.

If "buffer" is NULL or "len" is 0 then nothing is written to "buffer" but the number of characters that would have been written had "buffer" been large enough is still returned.

Returns -1 if an error occurred.

NOTE: wide character sequences will be converted to sequences of UCS-2 characters.

◆ printf() [4/4]

static ssize_t ucs2charstring::printf ( ucs2_t *  buffer,
size_t  len,
const ucs2_t *  format,
  ... 
)
static

Appends "..." to "buffer" of character length "len" using "format" which should comply with standard printf formatting rules.

Returns the number of characters written to "buffer" excluding the NULL terminator. If string wasn't large enough to accommodate the data then it only writes "len" bytes to "buffer" but still returns the number of characters that would have been written had "buffer" been large enough.

If "buffer" is NULL or "len" is 0 then nothing is written to "buffer" but the number of characters that would have been written had "buffer" been large enough is still returned.

Returns -1 if an error occurred.

NOTE: wide character sequences will be converted to sequences of UCS-2 characters.

◆ replace() [1/5]

static ucs2_t* ucs2charstring::replace ( const ucs2_t *  str,
const ucs2_t *const *  oldstrset,
const ucs2_t *const *  newstrset 
)
static

Returns a new string which is a copy of "str" in which all instances of strings found in the NULL-terminated array "oldstrset", have been replaced with the commensurate string found in the NULL-terminated array "newstrset", which must have the same number of members as "oldstrset"

◆ replace() [2/5]

static ucs2_t* ucs2charstring::replace ( const ucs2_t *  str,
const ucs2_t *const *  oldstrset,
size_t *  oldstrlen,
const ucs2_t *const *  newstrset 
)
static

Returns a new string which is a copy of "str" in which all instances of strings found in the NULL-terminated array "oldstrset", the number of characters of which are given by the array "oldstrlen", have been replaced with the commensurate string found in the NULL-terminated array "newstrset", which must have the same number of members as "oldstrset"

◆ replace() [3/5]

static ucs2_t* ucs2charstring::replace ( const ucs2_t *  str,
const ucs2_t *  oldstr,
const ucs2_t *  newstr 
)
static

Returns a new string which is a copy of "str" in which all instances of "oldstr" have been replaced with "newstr"

◆ replace() [4/5]

static void ucs2charstring::replace ( ucs2_t *  str,
const ucs2_t *  oldchars,
ucs2_t  newchar 
)
static

Replaces all instances of any of the characters in the set "oldchar" in "str" with "newchar"

◆ replace() [5/5]

static void ucs2charstring::replace ( ucs2_t *  str,
ucs2_t  oldchar,
ucs2_t  newchar 
)
static

Replaces all instances of "oldchar" in "str" with "newchar"

◆ rightJustify()

static void ucs2charstring::rightJustify ( ucs2_t *  str,
int32_t  len 
)
static

Moves trailing spaces to the beginning of "str" for "len" characters.

Example: " hello " -> " hello"

◆ rightTrim() [1/2]

static void ucs2charstring::rightTrim ( ucs2_t *  str)
static

Trims all spaces off of the right hand side of "str".

◆ rightTrim() [2/2]

static void ucs2charstring::rightTrim ( ucs2_t *  str,
ucs2_t  character 
)
static

Trims all "character"'s off of the right hand side of "str".

◆ safeCopy() [1/2]

static ucs2_t* ucs2charstring::safeCopy ( ucs2_t *  dest,
size_t  destlen,
const ucs2_t *  source 
)
static

Replaces "dest" with "source" unless the character length of "source" is greater than "destlen", in which case only "destlen" characters of "dest" will be replaced. Returns a pointer to "dest".

◆ safeCopy() [2/2]

static ucs2_t* ucs2charstring::safeCopy ( ucs2_t *  dest,
size_t  destlen,
const ucs2_t *  source,
size_t  sourcelen 
)
static

Replaces "sourcelen" characters of "dest" with "source" unless "sourcelen" is greater than "destlen", in which case only "destlen" characters of "dest" will be replaced. Returns a pointer to "dest".

◆ split() [1/4]

static void ucs2charstring::split ( const ucs2_t *  string,
const ucs2_t *  delimiter,
bool  collapse,
ucs2_t ***  list,
uint64_t *  listlength 
)
static

Parses NULL-terminated "string" delimited by NULL-terminated "delimiter" and allocates "listlength" elements of "list" to return the parts. If "collapse" is true then multiple instances of the delimiter in a row will be interpreted as one instance of the delimiter. Each member of "list" and "list" itseslf must be deallocated by the calling program.

◆ split() [2/4]

static void ucs2charstring::split ( const ucs2_t *  string,
const ucs2_t *  delimiter,
size_t  delimiterlength,
bool  collapse,
ucs2_t ***  list,
uint64_t *  listlength 
)
static

Parses NULL-terminated "string" delimited by "delimiter" of character length "delimiterlength" and allocates "listlength" elements of "list" to return the parts. If "collapse" is true then multiple instances of the delimiter in a row will be interpreted as one instance of the delimiter. Each member of "list" and "list" itseslf must be deallocated by the calling program.

◆ split() [3/4]

static void ucs2charstring::split ( const ucs2_t *  string,
size_t  stringlength,
const ucs2_t *  delimiter,
bool  collapse,
ucs2_t ***  list,
uint64_t *  listlength 
)
static

Parses "string" of character length "stringlength" delimited by NULL-terminated "delimiter" and allocates "listlength" elements of "list" to return the parts. If "collapse" is true then multiple instances of the delimiter in a row will be interpreted as one instance of the delimiter. Each member of "list" and "list" itseslf must be deallocated by the calling program.

◆ split() [4/4]

static void ucs2charstring::split ( const ucs2_t *  string,
size_t  stringlength,
const ucs2_t *  delimiter,
size_t  delimiterlength,
bool  collapse,
ucs2_t ***  list,
uint64_t *  listlength 
)
static

Parses "string" of character length "stringlength" delimited by "delimiter" of character length "delimiterlength" and allocates "listlength" elements of "list" to return the parts. If "collapse" is true then multiple instances of the delimiter in a row will be interpreted as one instance of the delimiter. Each member of "list" and "list" itseslf must be deallocated by the calling program.

◆ startsWith()

static bool ucs2charstring::startsWith ( const ucs2_t *  haystack,
const ucs2_t *  needle 
)
static

Returns true if "haystack" starts with "needle" or false otherwise.

◆ strip() [1/2]

static bool ucs2charstring::strip ( ucs2_t *  str,
ucs2_t  character 
)
static

Strips all instances of "character" from "str". Returns true if any characters were stripped and false if no characters were stripped.

◆ strip() [2/2]

static bool ucs2charstring::strip ( ucs2_t *  str1,
const ucs2_t *  str2 
)
static

Strips all instances of "str2" from "str1". Returns true if any characters were stripped and false if no characters were stripped.

◆ stripSet()

static bool ucs2charstring::stripSet ( ucs2_t *  str1,
const ucs2_t *  set 
)
static

Strips all instances of any character in "set" from "str1". Returns true if any characters were stripped and false if no characters were stripped.

◆ supportsPrintf()

static bool ucs2charstring::supportsPrintf ( )
static

Returns true if the platform supports printf()ing UCS-2 characters and false otherwise.

◆ unescape() [1/2]

static ucs2_t* ucs2charstring::unescape ( const ucs2_t *  input)
static

unescapes all -escaped characters found in "input" and returns the result in a buffer allocated inside the function. This buffer must be deleted by the calling program.

◆ unescape() [2/2]

static void ucs2charstring::unescape ( const ucs2_t *  input,
uint64_t  inputlength,
ucs2_t **  output,
uint64_t *  outputlength 
)
static

similar to unescape() above, but takes an "inputlength" parameter and returns the result in "output" and "outputlength" rather than in a return value

◆ upper()

static void ucs2charstring::upper ( ucs2_t *  str)
static

Converts "str" to uppercase.

◆ zero()

static void ucs2charstring::zero ( ucs2_t *  str,
size_t  len 
)
static

Sets "len" characters of "str" to NULL.

Note that this method expects to operate on strings encoded using a single-byte encoding, and will give unexpected results for multi-byte-encoded strings.