2 * Copyright 2010-2011, Oliver Tappe, zooey@hirschkaefer.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef _ICU_CATEGORY_DATA_H
6 #define _ICU_CATEGORY_DATA_H
10 #include <unicode/locid.h>
11 #include <unicode/unistr.h>
13 #include <SupportDefs.h>
15 #include "ICUThreadLocalStorageValue.h"
22 class ICUCategoryData
{
24 ICUCategoryData(pthread_key_t tlsKey
);
25 virtual ~ICUCategoryData();
27 virtual status_t
SetTo(const Locale
& locale
,
28 const char* posixLocaleName
);
29 virtual status_t
SetToPosix();
31 const char* PosixLocaleName()
32 { return fPosixLocaleName
; }
34 const Locale
& ICULocale() const;
37 status_t
_ConvertUnicodeStringToLocaleconvEntry(
38 const UnicodeString
& string
,
39 char* destination
, int destinationSize
,
40 const char* defaultValue
= "");
42 status_t
_GetConverter(UConverter
*& converterOut
);
44 static const uint16 skMaxPosixLocaleNameLen
= 128;
45 static const size_t skLCBufSize
= 16;
47 pthread_key_t fThreadLocalStorageKey
;
49 char fPosixLocaleName
[skMaxPosixLocaleNameLen
];
50 char fGivenCharset
[UCNV_MAX_CONVERTER_NAME_LENGTH
];
53 status_t
_SetupConverter();
59 ICUCategoryData::ICULocale() const
65 } // namespace Libroot
66 } // namespace BPrivate
69 #endif // _ICU_CATEGORY_DATA_H