32 #ifndef __AnsiBasedTypes__ 33 #include "AnsiBasedTypes.h" 36 #include "K2TypeTraits.h" 38 #if defined MACINTOSH || defined WINDOWS 49 typedef uchar *PString;
50 typedef const uchar *ConstPString;
56 typedef char *CString;
57 typedef const char *ConstCString;
62 typedef uchar16 *WString;
63 typedef const uchar16 *ConstWString;
69 #define __SCHAR_MAX__ 127 72 const int8 kMinInt8 = (int8)SCHAR_MIN;
73 const int8 kMaxInt8 = (int8)SCHAR_MAX;
74 const int16 kMinInt16 = (int16)SHRT_MIN;
75 const int16 kMaxInt16 = (int16)SHRT_MAX;
77 const uint8 kMaxUInt8 = (uint8)UCHAR_MAX;
78 const uint16 kMaxUInt16 = (uint16)USHRT_MAX;
80 #if MACINTOSH && __LP64__ 81 const int32 kMinInt32 = (int32)INT_MIN;
82 const int32 kMaxInt32 = (int32)INT_MAX;
84 const uint32 kMaxUInt32 = (uint32)UINT_MAX;
86 const int32 kMinInt32 = (int32)LONG_MIN;
87 const int32 kMaxInt32 = (int32)LONG_MAX;
89 const uint32 kMaxUInt32 = (uint32)ULONG_MAX;
93 const int64 kMinInt64 = (int64)_I64_MIN;
94 const int64 kMaxInt64 = (int64)_I64_MAX;
96 const uint64 kMaxUInt64 = (uint64)_UI64_MAX;
98 const int64 kMinInt64 = (int64)LONG_LONG_MIN;
99 const int64 kMaxInt64 = (int64)LONG_LONG_MAX;
101 const uint64 kMaxUInt64 = (uint64)ULONG_LONG_MAX;
110 typedef int32 TextIndex;
113 typedef uchar16 textchar;
116 typedef uchar16 UTF16TextChar;
143 : fCharacterValue((hi - 0xD800) * 0x400 + (low - 0xDC00) + 0x10000)
154 inline uint32
GetValue()
const {
return fCharacterValue; }
159 inline UTF16TextChar
CalcHighSurrogate()
const {
return (fCharacterValue > 0xFFFF ? static_cast<UTF16TextChar>((fCharacterValue - 0x10000) / 0x400 + 0xd800) : static_cast<UTF16TextChar>(fCharacterValue)); }
164 inline UTF16TextChar
CalcLowSurrogate()
const {
return (fCharacterValue > 0xFFFF ? static_cast<UTF16TextChar>((fCharacterValue - 0x10000) % 0x400 + 0xdc00) : static_cast<UTF16TextChar>(fCharacterValue)); }
170 inline void ToUTF16(UTF16TextChar * buf, int32 * len)
const 173 if (fCharacterValue > 0xFFFF && *len >= 2)
235 uint32 fCharacterValue;
245 const TextIndex kInvalidTextIndex = -1;
249 typedef int32 ErrorCode;
269 #if defined(MACINTOSH) && !defined(__POWERPC__) 270 #define RESOURCE_ENDIAN_SWAPPING 1 272 #define RESOURCE_ENDIAN_SWAPPING 0 275 #define RESOURCE_ENDIAN_SWAPPING 0 283 uint32 EE (uint32 value)
const 285 #if RESOURCE_ENDIAN_SWAPPING 286 return ((value >> 24) & 0x000000ff) |
287 ((value >> 8) & 0x0000ff00) |
288 ((value << 8) & 0x00ff0000) |
289 ((value << 24) & 0xff000000);
299 fContent = EE ((uint32) value);
304 return T (EE (fContent));
323 uint16 EE (uint16 value)
const 325 #if RESOURCE_ENDIAN_SWAPPING 326 return ((value >> 8) & 0x00ff) |
327 ((value << 8) & 0xff00);
337 fContent = EE ((uint16) value);
342 return T (EE (fContent));
356 #if defined(MACINTOSH) && defined(__POWERPC__) 357 #define IS_BIG_ENDIAN_ARCH 1 358 #define IS_LITTLE_ENDIAN_ARCH 0 360 #define IS_BIG_ENDIAN_ARCH 0 361 #define IS_LITTLE_ENDIAN_ARCH 1 383 #endif // __BASETYPE__