2 * Copyright 2010-2011, Oliver Tappe, zooey@hirschkaefer.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef _ICU_CTYPE_DATA_H
6 #define _ICU_CTYPE_DATA_H
9 #include "ICUCategoryData.h"
10 #include "LocaleBackend.h"
17 class ICUCtypeData
: public ICUCategoryData
{
18 typedef ICUCategoryData inherited
;
20 ICUCtypeData(pthread_key_t tlsKey
);
21 virtual ~ICUCtypeData();
23 void Initialize(LocaleCtypeDataBridge
* dataBridge
);
25 virtual status_t
SetTo(const Locale
& locale
,
26 const char* posixLocaleName
);
27 virtual status_t
SetToPosix();
29 int IsWCType(wint_t wc
, wctype_t charClass
);
30 status_t
ToWCTrans(wint_t wc
, wctrans_t transition
,
33 status_t
MultibyteToWchar(wchar_t* wcOut
, const char* mb
,
34 size_t mbLength
, mbstate_t* mbState
,
36 status_t
MultibyteStringToWchar(wchar_t* wcDest
,
37 size_t wcDestLength
, const char** mbSource
,
38 size_t mbSourceLength
, mbstate_t* mbState
,
40 status_t
WcharToMultibyte(char* mbOut
, wchar_t wc
,
41 mbstate_t* mbState
, size_t& lengthOut
);
42 status_t
WcharStringToMultibyte(char* mbDest
,
44 const wchar_t** wcSource
,
45 size_t wcSourceLength
, mbstate_t* mbState
,
48 const char* GetLanginfo(int index
);
51 status_t
_GetConverterForMbState(mbstate_t* mbState
,
52 UConverter
*& converterOut
);
54 status_t
_DropConverterFromMbState(mbstate_t* mbState
);
57 * The following arrays have 384 elements where the elements at
58 * index -128..-2 mirror the elements at index 128..255 (to protect
59 * against invocations of ctype macros with negative character
61 * The element at index -1 is a dummy element containing the
62 * neutral/identity value used when the array is accessed as in
63 * 'isblank(EOF)' (i.e. with index -1).
65 unsigned short fClassInfo
[384];
69 LocaleCtypeDataBridge
* fDataBridge
;
73 } // namespace Libroot
74 } // namespace BPrivate
77 #endif // _ICU_CTYPE_DATA_H