rtxUTF8.h File Reference

Utility functions for handling UTF-8 strings. More...

#include "rtxsrc/rtxContext.h"

Go to the source code of this file.

Defines

#define RTUTF8STRCMPL(name, lstr)   rtxUTF8Strcmp(name,(const OSUTF8CHAR*)lstr)
 Compare UTF-8 string to a string literal.

Functions

EXTERNRT long rtxUTF8ToUnicode (OSCTXT *pctxt, const OSUTF8CHAR *inbuf, OSUNICHAR *outbuf, size_t outbufsiz)
 This function converts a UTF-8 string to a Unicode string (UTF-16).
EXTERNRT int rtxValidateUTF8 (OSCTXT *pctxt, const OSUTF8CHAR *inbuf)
 This function will validate a UTF-8 encoded string to ensure that it is encoded correctly.
EXTERNRT size_t rtxUTF8Len (const OSUTF8CHAR *inbuf)
 This function will return the length (in characters) of a null-terminated UTF-8 encoded string.
EXTERNRT size_t rtxUTF8LenBytes (const OSUTF8CHAR *inbuf)
 This function will return the length (in bytes) of a null-terminated UTF-8 encoded string.
EXTERNRT int rtxUTF8CharSize (OS32BITCHAR wc)
 This function will return the number of bytes needed to encode the given 32-bit universal character value as a UTF-8 character.
EXTERNRT int rtxUTF8EncodeChar (OS32BITCHAR wc, OSOCTET *buf, size_t bufsiz)
 This function will convert a wide character into an encoded UTF-8 character byte string.
EXTERNRT int rtxUTF8DecodeChar (OSCTXT *pctxt, const OSUTF8CHAR *pinbuf, int *pInsize)
 This function will convert an encoded UTF-8 character byte string into a wide character value.
EXTERNRT OS32BITCHAR rtxUTF8CharToWC (const OSUTF8CHAR *buf, OSUINT32 *len)
 Thia function will convert a UTF-8 encoded character value into a wide character.
EXTERNRT OSUTF8CHAR * rtxUTF8StrChr (OSUTF8CHAR *utf8str, OS32BITCHAR utf8char)
 This function finds a character in the given UTF-8 character string.
EXTERNRT OSUTF8CHAR * rtxUTF8Strdup (OSCTXT *pctxt, const OSUTF8CHAR *utf8str)
 This function creates a duplicate copy of the given UTF-8 character string.
EXTERNRT OSUTF8CHAR * rtxUTF8Strndup (OSCTXT *pctxt, const OSUTF8CHAR *utf8str, size_t nbytes)
 This function creates a duplicate copy of the given UTF-8 character string.
EXTERNRT OSUTF8CHAR * rtxUTF8StrRefOrDup (OSCTXT *pctxt, const OSUTF8CHAR *utf8str)
 This function check to see if the given UTF8 string pointer exists on the memory heap.
EXTERNRT OSBOOL rtxUTF8StrEqual (const OSUTF8CHAR *utf8str1, const OSUTF8CHAR *utf8str2)
 This function compares two UTF-8 string values for equality.
EXTERNRT OSBOOL rtxUTF8StrnEqual (const OSUTF8CHAR *utf8str1, const OSUTF8CHAR *utf8str2, size_t count)
 This function compares two UTF-8 string values for equality.
EXTERNRT int rtxUTF8Strcmp (const OSUTF8CHAR *utf8str1, const OSUTF8CHAR *utf8str2)
 This function compares two UTF-8 character strings and returns a trinary result (equal, less than, greater than).
EXTERNRT int rtxUTF8Strncmp (const OSUTF8CHAR *utf8str1, const OSUTF8CHAR *utf8str2, size_t count)
 This function compares two UTF-8 character strings and returns a trinary result (equal, less than, greater than).
EXTERNRT OSUTF8CHAR * rtxUTF8Strcpy (OSUTF8CHAR *dest, size_t bufsiz, const OSUTF8CHAR *src)
 This function copies a null-terminated UTF-8 string to a target buffer.
EXTERNRT OSUTF8CHAR * rtxUTF8Strncpy (OSUTF8CHAR *dest, size_t bufsiz, const OSUTF8CHAR *src, size_t nchars)
 This function copies the given number of characters from a UTF-8 string to a target buffer.
EXTERNRT OSUINT32 rtxUTF8StrHash (const OSUTF8CHAR *str)
 This function computes a hash code for the given string value.
EXTERNRT const OSUTF8CHAR * rtxUTF8StrJoin (OSCTXT *pctxt, const OSUTF8CHAR *str1, const OSUTF8CHAR *str2, const OSUTF8CHAR *str3, const OSUTF8CHAR *str4, const OSUTF8CHAR *str5)
 This function concatanates up to five substrings together into a single string.
EXTERNRT int rtxUTF8StrToBool (const OSUTF8CHAR *utf8str, OSBOOL *pvalue)
 This function converts the given null-terminated UTF-8 string to a boolean (true/false) value.
EXTERNRT int rtxUTF8StrnToBool (const OSUTF8CHAR *utf8str, size_t nbytes, OSBOOL *pvalue)
 This function converts the given part of UTF-8 string to a boolean (true/false) value.
EXTERNRT int rtxUTF8StrToDouble (const OSUTF8CHAR *utf8str, OSREAL *pvalue)
 This function converts the given null-terminated UTF-8 string to a floating point (C/C++ double) value.
EXTERNRT int rtxUTF8StrnToDouble (const OSUTF8CHAR *utf8str, size_t nbytes, OSREAL *pvalue)
 This function converts the given part of UTF-8 string to a double value.
EXTERNRT int rtxUTF8StrToInt (const OSUTF8CHAR *utf8str, OSINT32 *pvalue)
 This function converts the given null-terminated UTF-8 string to an integer value.
EXTERNRT int rtxUTF8StrnToInt (const OSUTF8CHAR *utf8str, size_t nbytes, OSINT32 *pvalue)
 This function converts the given part of UTF-8 string to an integer value.
EXTERNRT int rtxUTF8StrToUInt (const OSUTF8CHAR *utf8str, OSUINT32 *pvalue)
 This function converts the given null-terminated UTF-8 string to an unsigned integer value.
EXTERNRT int rtxUTF8StrnToUInt (const OSUTF8CHAR *utf8str, size_t nbytes, OSUINT32 *pvalue)
 This function converts the given part of UTF-8 string to an unsigned integer value.
EXTERNRT int rtxUTF8StrToSize (const OSUTF8CHAR *utf8str, size_t *pvalue)
 This function converts the given null-terminated UTF-8 string to a size value (type size_t).
EXTERNRT int rtxUTF8StrnToSize (const OSUTF8CHAR *utf8str, size_t nbytes, size_t *pvalue)
 This function converts the given part of UTF-8 string to a size value (type size_t).
EXTERNRT int rtxUTF8StrToInt64 (const OSUTF8CHAR *utf8str, OSINT64 *pvalue)
 This function converts the given null-terminated UTF-8 string to a 64-bit integer value.
EXTERNRT int rtxUTF8StrnToInt64 (const OSUTF8CHAR *utf8str, size_t nbytes, OSINT64 *pvalue)
 This function converts the given part of UTF-8 string to a 64-bit integer value.
EXTERNRT int rtxUTF8StrToUInt64 (const OSUTF8CHAR *utf8str, OSUINT64 *pvalue)
 This function converts the given null-terminated UTF-8 string to an unsigned 64-bit integer value.
EXTERNRT int rtxUTF8StrnToUInt64 (const OSUTF8CHAR *utf8str, size_t nbytes, OSUINT64 *pvalue)
 This function converts the given part of UTF-8 string to an unsigned 64-bit integer value.
EXTERNRT int rtxUTF8ToDynUniStr (OSCTXT *pctxt, const OSUTF8CHAR *utf8str, const OSUNICHAR **ppdata, OSUINT32 *pnchars)
 This function converts the given UTF-8 string to a Unicode string.
EXTERNRT int rtxUTF8RemoveWhiteSpace (const OSUTF8CHAR *utf8instr, size_t nbytes, const OSUTF8CHAR **putf8outstr)
 This function removes leading and trailing whitespace from a string.
EXTERNRT int rtxUTF8StrToDynHexStr (OSCTXT *pctxt, const OSUTF8CHAR *utf8str, OSDynOctStr *pvalue)
 This function converts the given null-terminated UTF-8 string to a octet string value.
EXTERNRT int rtxUTF8StrnToDynHexStr (OSCTXT *pctxt, const OSUTF8CHAR *utf8str, size_t nbytes, OSDynOctStr *pvalue)
 This function converts the given part of UTF-8 string to a octet string value.
EXTERNRT int rtxUTF8StrToNamedBits (OSCTXT *pctxt, const OSUTF8CHAR *utf8str, const OSBitMapItem *pBitMap, OSOCTET *pvalue, OSUINT32 *pnbits, OSUINT32 bufsize)
 This function converts the given null-terminated UTF-8 string to named bit items.
EXTERNRT const OSUTF8CHAR * rtxUTF8StrNextTok (OSUTF8CHAR *utf8str, OSUTF8CHAR **ppNext)
 This function returns the next whitespace-separated token from the input string.

Detailed Description

Utility functions for handling UTF-8 strings.

Definition in file rtxUTF8.h.