Home > Support > Documentation

rtxUTF8.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2007 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00028 #ifndef _RTXUTF8_H_
00029 #define _RTXUTF8_H_
00030 
00031 #include "rtxsrc/rtxContext.h"
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 /* UTF-8 string functions */
00060 EXTERNRTX long rtxUTF8ToUnicode (OSCTXT* pctxt, const OSUTF8CHAR* inbuf, 
00061                                  OSUNICHAR* outbuf, size_t outbufsiz);
00062 
00073 EXTERNRTX int rtxValidateUTF8 (OSCTXT* pctxt, const OSUTF8CHAR* inbuf);
00074 
00084 EXTERNRTX size_t rtxUTF8Len (const OSUTF8CHAR* inbuf); 
00085 EXTERNRTX size_t rtxCalcUTF8Len (const OSUTF8CHAR* inbuf, size_t inbufBytes);
00086 
00094 EXTERNRTX size_t rtxUTF8LenBytes (const OSUTF8CHAR* inbuf); 
00095 
00103 EXTERNRTX int rtxUTF8CharSize (OS32BITCHAR wc);
00104 
00116 EXTERNRTX int rtxUTF8EncodeChar (OS32BITCHAR wc, OSOCTET* buf, size_t bufsiz);
00117 
00128 EXTERNRTX int rtxUTF8DecodeChar 
00129 (OSCTXT* pctxt, const OSUTF8CHAR* pinbuf, int* pInsize);
00130 
00140 EXTERNRTX OS32BITCHAR rtxUTF8CharToWC (const OSUTF8CHAR* buf, OSUINT32* len);
00141 
00151 EXTERNRTX OSUTF8CHAR* rtxUTF8StrChr (OSUTF8CHAR* utf8str, 
00152                                      OS32BITCHAR utf8char);
00153 
00163 EXTERNRTX OSUTF8CHAR* rtxUTF8Strdup (OSCTXT* pctxt, const OSUTF8CHAR* utf8str);
00164 
00176 EXTERNRTX OSUTF8CHAR* rtxUTF8Strndup (OSCTXT* pctxt, 
00177                                       const OSUTF8CHAR* utf8str, 
00178                                       size_t nbytes);
00179 
00187 EXTERNRTX OSBOOL rtxUTF8StrEqual (const OSUTF8CHAR* utf8str1, 
00188                                   const OSUTF8CHAR* utf8str2);
00189 
00200 EXTERNRTX OSBOOL rtxUTF8StrnEqual (const OSUTF8CHAR* utf8str1, 
00201                                    const OSUTF8CHAR* utf8str2,
00202                                    size_t count);
00203 
00215 EXTERNRTX int rtxUTF8Strcmp (const OSUTF8CHAR* utf8str1, 
00216                              const OSUTF8CHAR* utf8str2);
00217 
00231 EXTERNRTX int rtxUTF8Strncmp (const OSUTF8CHAR* utf8str1, 
00232                               const OSUTF8CHAR* utf8str2,
00233                               size_t count);
00244 EXTERNRTX OSUTF8CHAR* rtxUTF8Strcpy 
00245 (OSUTF8CHAR* dest, size_t bufsiz, const OSUTF8CHAR* src);
00246 
00259 EXTERNRTX OSUTF8CHAR* rtxUTF8Strncpy 
00260 (OSUTF8CHAR* dest, size_t bufsiz, const OSUTF8CHAR* src, size_t nchars);
00261 
00271 EXTERNRTX int rtxUTF8StrToBool (const OSUTF8CHAR* utf8str, OSBOOL* pvalue);
00272 
00283 EXTERNRTX int rtxUTF8StrnToBool 
00284    (const OSUTF8CHAR* utf8str, size_t nbytes, OSBOOL* pvalue);
00285 
00299 EXTERNRTX int rtxUTF8StrToDouble (const OSUTF8CHAR* utf8str, OSREAL* pvalue);
00300 
00315 EXTERNRTX int rtxUTF8StrnToDouble
00316    (const OSUTF8CHAR* utf8str, size_t nbytes, OSREAL* pvalue);
00317 
00330 EXTERNRTX int rtxUTF8StrToInt (const OSUTF8CHAR* utf8str, OSINT32* pvalue);
00331 
00332 #define rtxUTF8StrToInt32 rtxUTF8StrToInt
00333 
00348 EXTERNRTX int rtxUTF8StrnToInt 
00349    (const OSUTF8CHAR* utf8str, size_t nbytes, OSINT32* pvalue);
00350 
00360 EXTERNRTX int rtxUTF8StrToUInt (const OSUTF8CHAR* utf8str, OSUINT32* pvalue);
00361 
00362 #define rtxUTF8StrToUInt32 rtxUTF8StrToUInt
00363 
00375 EXTERNRTX int rtxUTF8StrnToUInt 
00376    (const OSUTF8CHAR* utf8str, size_t nbytes, OSUINT32* pvalue);
00377 
00378 #ifndef _NO_INT64_SUPPORT
00379 
00388 EXTERNRTX int rtxUTF8StrToInt64 (const OSUTF8CHAR* utf8str, OSINT64* pvalue);
00389 
00401 EXTERNRTX int rtxUTF8StrnToInt64 
00402    (const OSUTF8CHAR* utf8str, size_t nbytes, OSINT64* pvalue);
00403 
00413 EXTERNRTX int rtxUTF8StrToUInt64 (const OSUTF8CHAR* utf8str, OSUINT64* pvalue);
00414 
00426 EXTERNRTX int rtxUTF8StrnToUInt64 
00427    (const OSUTF8CHAR* utf8str, size_t nbytes, OSUINT64* pvalue);
00428 
00429 #endif /* _NO_INT64_SUPPORT */ 
00430 
00443 EXTERNRTX int rtxUTF8ToDynUniStr 
00444    (OSCTXT* pctxt, const OSUTF8CHAR* utf8str, 
00445     const OSUNICHAR** ppdata, OSUINT32* pnchars);
00446 
00457 EXTERNRTX int rtxUTF8RemoveWhiteSpace 
00458 (const OSUTF8CHAR* utf8instr, size_t nbytes, const OSUTF8CHAR** putf8outstr);
00459 
00466 #define RTUTF8STRCMPL(name,lstr) \
00467 rtxUTF8Strcmp(name,(const OSUTF8CHAR*)lstr)
00468 
00483 EXTERNRTX int rtxUTF8StrToDynHexStr 
00484 (OSCTXT* pctxt, const OSUTF8CHAR* utf8str, OSDynOctStr* pvalue);
00485 
00501 EXTERNRTX int rtxUTF8StrnToDynHexStr 
00502 (OSCTXT* pctxt, const OSUTF8CHAR* utf8str, size_t nbytes, OSDynOctStr* pvalue);
00503 
00522 EXTERNRTX const OSUTF8CHAR* rtxUTF8StrNextTok 
00523 (OSUTF8CHAR* utf8str, OSUTF8CHAR** ppNext);
00524 
00528 #ifdef __cplusplus
00529 }
00530 #endif
00531 
00532 #endif