xref: /haiku/headers/private/libroot/locale/ICUCollateData.h (revision 3e1163d6af87e9dda609143fb563fe4e6b363748)
1a3f66598SOliver Tappe /*
2c894d186SOliver Tappe  * Copyright 2010-2011, Oliver Tappe, zooey@hirschkaefer.de.
3a3f66598SOliver Tappe  * Distributed under the terms of the MIT License.
4a3f66598SOliver Tappe  */
5a3f66598SOliver Tappe #ifndef _ICU_COLLATE_DATA_H
6a3f66598SOliver Tappe #define _ICU_COLLATE_DATA_H
7a3f66598SOliver Tappe 
8a3f66598SOliver Tappe 
9a3f66598SOliver Tappe #include "ICUCategoryData.h"
10a3f66598SOliver Tappe 
11a3f66598SOliver Tappe #include <unicode/coll.h>
12a3f66598SOliver Tappe 
13a3f66598SOliver Tappe 
14a3f66598SOliver Tappe namespace BPrivate {
1525dc253dSIngo Weinhold namespace Libroot {
16a3f66598SOliver Tappe 
17a3f66598SOliver Tappe 
18a3f66598SOliver Tappe class ICUCollateData : public ICUCategoryData {
19a3f66598SOliver Tappe 	typedef	ICUCategoryData		inherited;
20a3f66598SOliver Tappe 
21a3f66598SOliver Tappe public:
22bf5ff480SOliver Tappe 								ICUCollateData(pthread_key_t tlsKey);
23a3f66598SOliver Tappe 	virtual						~ICUCollateData();
24a3f66598SOliver Tappe 
251bad1ff3SAdrien Destugues 	virtual	status_t			SetTo(const U_NAMESPACE_QUALIFIER Locale&
261bad1ff3SAdrien Destugues 										locale,
27a3f66598SOliver Tappe 									const char* posixLocaleName);
28a3f66598SOliver Tappe 	virtual	status_t			SetToPosix();
29a3f66598SOliver Tappe 
30a3f66598SOliver Tappe 			status_t			Strcoll(const char* a, const char* b, int& out);
31*3e1163d6SAugustin Cavalier 			status_t			Strxfrm(char* out, const char* in,
32*3e1163d6SAugustin Cavalier 									size_t outSize, size_t& requiredSize);
33bd55dcbeSOliver Tappe 			status_t			Wcscoll(const wchar_t* a, const wchar_t* b,
34bd55dcbeSOliver Tappe 									int& out);
35bd55dcbeSOliver Tappe 			status_t			Wcsxfrm(wchar_t* out, const wchar_t* in,
3621860419SAugustin Cavalier 									size_t outSize, size_t& requiredSize);
37a3f66598SOliver Tappe 
38a3f66598SOliver Tappe private:
39a3f66598SOliver Tappe 			status_t			_ToUnicodeString(const char* in,
401bad1ff3SAdrien Destugues 									U_NAMESPACE_QUALIFIER UnicodeString& out);
41a3f66598SOliver Tappe 
421bad1ff3SAdrien Destugues 			U_NAMESPACE_QUALIFIER Collator*	fCollator;
43a3f66598SOliver Tappe };
44a3f66598SOliver Tappe 
45a3f66598SOliver Tappe 
4625dc253dSIngo Weinhold }	// namespace Libroot
47a3f66598SOliver Tappe }	// namespace BPrivate
48a3f66598SOliver Tappe 
49a3f66598SOliver Tappe 
50a3f66598SOliver Tappe #endif	// _ICU_COLLATE_DATA_H
51