38 #if !defined(OVR_OS_WINCE) && defined(OVR_CC_MSVC) && (OVR_CC_MSVC >= 1400)
39 #define OVR_MSVC_SAFESTRING
49 #if defined(OVR_OS_WIN32)
52 #if defined(OVR_MSVC_SAFESTRING)
53 _itoa_s(val, dest, destsize, radix);
57 return itoa(val, dest, radix);
61 inline char*
OVR_itoa(
int val,
char* dest,
unsigned int len,
int radix)
75 unsigned int sign = 0;
83 while ((val != 0) && (i < (len - 1 - sign)))
111 dest[i] = (char)(
'0' + cur);
117 dest[i] = (char)(
'0' + cur);
127 for (
unsigned int j = 0; j < i / 2; ++j)
130 dest[j] = dest[i - 1 - j];
131 dest[i - 1 - j] = tmp;
150 #if defined(OVR_MSVC_SAFESTRING)
151 strcpy_s(dest, destsize, src);
161 #if defined(OVR_MSVC_SAFESTRING)
162 strncpy_s(dest, destsize, src, count);
166 return strncpy(dest, src, count);
172 #if defined(OVR_MSVC_SAFESTRING)
173 strcat_s(dest, destsize, src);
199 for (
UPInt i=len; i>0; i--)
218 for (
UPInt i=len; i>0; i--)
229 return strtol(
string, tailptr, radix);
234 return strtoul(
string, tailptr, radix);
239 return strncmp(ws1, ws2, size);
244 #if defined(OVR_CC_MSVC) && !defined(OVR_OS_WINCE)
245 return _strtoui64(nptr, endptr, base);
247 return strtoull(nptr, endptr, base);
253 #if defined(OVR_CC_MSVC) && !defined(OVR_OS_WINCE)
254 return _strtoi64(nptr, endptr, base);
256 return strtoll(nptr, endptr, base);
263 #if defined(OVR_CC_MSVC) && !defined(OVR_OS_WINCE)
264 return _atoi64(
string);
266 return atoll(
string);
283 va_start(argList,format);
285 #if defined(OVR_CC_MSVC)
286 #if defined(OVR_MSVC_SAFESTRING)
287 ret = _vsnprintf_s(dest, destsize, _TRUNCATE, format, argList);
291 ret = _vsnprintf(dest, destsize - 1, format, argList);
293 dest[destsize-1] = 0;
297 ret = vsprintf(dest, format, argList);
307 #if defined(OVR_CC_MSVC)
308 #if defined(OVR_MSVC_SAFESTRING)
310 int rv = vsnprintf_s(dest, destsize, _TRUNCATE, format, argList);
313 dest[destsize - 1] =
'\0';
320 int rv = _vsnprintf(dest, destsize - 1, format, argList);
323 dest[destsize-1] = 0;
327 ret = (
UPInt)vsprintf(dest, format, argList);
337 #if defined(OVR_CC_MSVC)
338 ret = (
UPInt) _vscprintf(format, argList);
340 ret = (
UPInt) vsnprintf(
NULL, 0, format, argList);
355 #if defined(OVR_OS_WIN32)
356 #if defined(OVR_CC_MSVC) && (OVR_CC_MSVC >= 1400)
357 return ::_wcsicoll(a, b);
359 return ::wcsicoll(a, b);
369 #if defined(OVR_OS_WIN32) || defined(OVR_OS_LINUX)
370 return wcscoll(a, b);
377 #ifndef OVR_NO_WCTYPE
381 unsigned offset = table[charCode >> 8];
382 if (offset == 0)
return 0;
383 if (offset == 1)
return 1;
384 return (table[offset + ((charCode >> 4) & 15)] & (1 << (charCode & 15))) != 0;
418 #else // OVR_NO_WCTYPE
447 return (
wchar_t)towlower(c);
452 return (
wchar_t)towupper(c);
455 #endif // OVR_NO_WCTYPE
460 return (c >=
'A' && c <=
'Z') ? c -
'A' +
'a' : c;
465 return (c >=
'a' && c <=
'z') ? c -
'a' +
'A' : c;
472 #if defined(OVR_OS_OTHER)
477 if (max > 63) max = 63;
479 for (
UPInt i=0; i < max; i++)
481 c = (
unsigned char)
string[i];
482 buffer[i] = ((c) < 128 ? (
char)c :
'!');
487 return wcstod(
string, tailptr);
493 #if defined(OVR_OS_OTHER)
498 if (max > 63) max = 63;
500 for (
UPInt i=0; i < max; i++)
502 c = (
unsigned char)
string[i];
503 buffer[i] = ((c) < 128 ? (
char)c :
'!');
506 return strtol(buffer, &tp, radix);
508 return wcstol(
string, tailptr, radix);
const UInt16 UnicodeXDigitBits[]
long OVR_CDECL OVR_wcstol(const wchar_t *string, wchar_t **tailptr, int radix)
UPInt OVR_CDECL OVR_vsprintf(char *dest, UPInt destsize, const char *format, va_list argList)
wchar_t *OVR_CDECL OVR_wcsncpy(wchar_t *dest, UPInt destsize, const wchar_t *src, UPInt count)
int OVR_CDECL OVR_tolower(int c)
int OVR_CDECL OVR_towupper(wchar_t charCode)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char * strcpy(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1
UInt64 OVR_CDECL OVR_atouq(const char *string)
int OVR_CDECL OVR_toupper(int c)
int OVR_CDECL OVR_towlower(wchar_t charCode)
__END_NAMESPACE_STD char char __BEGIN_NAMESPACE_STD size_t strlen(const char *__s) __THROW __attribute_pure__ __nonnull((1))
double OVR_CDECL OVR_wcstod(const wchar_t *string, wchar_t **tailptr)
int OVR_CDECL OVR_wcscoll(const wchar_t *a, const wchar_t *b)
int OVR_CDECL OVR_iswdigit(wchar_t charCode)
int OVR_CDECL OVR_iswalnum(wchar_t charCode)
SInt64 OVR_CDECL OVR_atoq(const char *string)
int OVR_CDECL OVR_iswspace(wchar_t charCode)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char * strncpy(char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull((1
char *OVR_CDECL OVR_strcpy(char *dest, UPInt destsize, const char *src)
long OVR_CDECL OVR_strtol(const char *string, char **tailptr, int radix)
SInt64 OVR_CDECL OVR_strtoq(const char *nptr, char **endptr, int base)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char char char int strcmp(const char *__s1, const char *__s2) __THROW __attribute_pure__ __nonnull((1
int OVR_CDECL OVR_wcscmp(const wchar_t *a, const wchar_t *b)
wchar_t *OVR_CDECL OVR_wcscpy(wchar_t *dest, UPInt destsize, const wchar_t *src)
int OVR_CDECL OVR_iswalpha(wchar_t charCode)
__BEGIN_NAMESPACE_STD char * strchr(const char *__s, int __c) __THROW __attribute_pure__ __nonnull((1))
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char char char int int strncmp(const char *__s1, const char *__s2, size_t __n) __THROW __attribute_pure__ __nonnull((1
const UByte *OVR_CDECL OVR_memrchr(const UByte *str, UPInt size, UByte c)
int OVR_CDECL OVR_wcsicoll(const wchar_t *a, const wchar_t *b)
int OVR_CDECL OVR_strncmp(const char *ws1, const char *ws2, UPInt size)
wchar_t *OVR_CDECL OVR_wcscat(wchar_t *dest, UPInt destsize, const wchar_t *src)
int OVR_CDECL UnicodeCharIs(const UInt16 *table, wchar_t charCode)
char * OVR_itoa(int val, char *dest, unsigned int len, int radix)
int OVR_CDECL OVR_stricmp(const char *a, const char *b)
char *OVR_CDECL OVR_strcat(char *dest, UPInt destsize, const char *src)
int OVR_CDECL OVR_strcmp(const char *dest, const char *src)
char *OVR_CDECL OVR_strncpy(char *dest, UPInt destsize, const char *src, UPInt count)
const char * OVR_strrchr(const char *str, char c)
const UInt16 UnicodeAlphaBits[]
const char *OVR_CDECL OVR_strchr(const char *str, char c)
const UInt16 UnicodeSpaceBits[]
int OVR_CDECL OVR_wcsicmp(const wchar_t *a, const wchar_t *b)
int OVR_CDECL OVR_iswxdigit(wchar_t charCode)
UPInt OVR_CDECL OVR_sprintf(char *dest, UPInt destsize, const char *format,...)
UPInt OVR_CDECL OVR_wcslen(const wchar_t *str)
int OVR_CDECL OVR_strnicmp(const char *a, const char *b, UPInt count)
__END_NAMESPACE_STD __BEGIN_NAMESPACE_STD char char char * strcat(char *__restrict __dest, const char *__restrict __src) __THROW __nonnull((1
UPInt OVR_CDECL OVR_vscprintf(const char *format, va_list argList)
UInt64 OVR_CDECL OVR_strtouq(const char *nptr, char **endptr, int base)
double OVR_CDECL OVR_strtod(const char *string, char **tailptr)
UPInt OVR_CDECL OVR_strlen(const char *str)
long OVR_CDECL OVR_strtoul(const char *string, char **tailptr, int radix)
const UInt16 UnicodeAlnumBits[]
const UInt16 UnicodeDigitBits[]