xref: /haiku/headers/private/libroot/locale/ICUCollateData.h (revision 71452e98334eaac603bf542d159e24788a46bebb)
1 /*
2  * Copyright 2010-2011, Oliver Tappe, zooey@hirschkaefer.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _ICU_COLLATE_DATA_H
6 #define _ICU_COLLATE_DATA_H
7 
8 
9 #include "ICUCategoryData.h"
10 
11 #include <unicode/coll.h>
12 
13 
14 namespace BPrivate {
15 namespace Libroot {
16 
17 
18 class ICUCollateData : public ICUCategoryData {
19 	typedef	ICUCategoryData		inherited;
20 
21 public:
22 								ICUCollateData(pthread_key_t tlsKey);
23 	virtual						~ICUCollateData();
24 
25 	virtual	status_t			SetTo(const Locale& locale,
26 										const char* posixLocaleName);
27 	virtual	status_t			SetToPosix();
28 
29 			status_t			Strcoll(const char* a, const char* b, int& out);
30 			status_t			Strxfrm(char* out, const char* in, size_t size,
31 									size_t& outSize);
32 			status_t			Wcscoll(const wchar_t* a, const wchar_t* b,
33 									int& out);
34 			status_t			Wcsxfrm(wchar_t* out, const wchar_t* in,
35 									size_t size, size_t& outSize);
36 
37 private:
38 			status_t			_ToUnicodeString(const char* in,
39 									UnicodeString& out);
40 
41 			Collator*			fCollator;
42 };
43 
44 
45 }	// namespace Libroot
46 }	// namespace BPrivate
47 
48 
49 #endif	// _ICU_COLLATE_DATA_H
50