xref: /haiku/headers/private/libroot/locale/ICUCollateData.h (revision 9e25244c5e9051f6cd333820d6332397361abd6c)
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 U_NAMESPACE_QUALIFIER Locale&
26 										locale,
27 									const char* posixLocaleName);
28 	virtual	status_t			SetToPosix();
29 
30 			status_t			Strcoll(const char* a, const char* b, int& out);
31 			status_t			Strxfrm(char* out, const char* in, size_t size,
32 									size_t& outSize);
33 			status_t			Wcscoll(const wchar_t* a, const wchar_t* b,
34 									int& out);
35 			status_t			Wcsxfrm(wchar_t* out, const wchar_t* in,
36 									size_t outSize, size_t& requiredSize);
37 
38 private:
39 			status_t			_ToUnicodeString(const char* in,
40 									U_NAMESPACE_QUALIFIER UnicodeString& out);
41 
42 			U_NAMESPACE_QUALIFIER Collator*	fCollator;
43 };
44 
45 
46 }	// namespace Libroot
47 }	// namespace BPrivate
48 
49 
50 #endif	// _ICU_COLLATE_DATA_H
51