xref: /haiku/headers/private/libroot/locale/ICUCollateData.h (revision 9f66f05b58e3a033984f1271ac986a2c99226103)
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 
33 private:
34 			status_t			_ToUnicodeString(const char* in,
35 									UnicodeString& out);
36 
37 			Collator*			fCollator;
38 };
39 
40 
41 }	// namespace Libroot
42 }	// namespace BPrivate
43 
44 
45 #endif	// _ICU_COLLATE_DATA_H
46