xref: /haiku/headers/private/libroot/locale/ICUMonetaryData.h (revision e0ef64750f3169cd634bb2f7a001e22488b05231)
1 /*
2  * Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _ICU_MONETARY_DATA_H
6 #define _ICU_MONETARY_DATA_H
7 
8 
9 #include "ICULocaleconvData.h"
10 #include "LocaleBackend.h"
11 
12 #include <locale.h>
13 
14 
15 namespace BPrivate {
16 
17 
18 class ICUMonetaryData : public ICULocaleconvData {
19 	typedef	ICULocaleconvData	inherited;
20 public:
21 	static	const int32			kParenthesesAroundCurrencyAndValue = 0;
22 	static	const int32			kSignPrecedesCurrencyAndValue      = 1;
23 	static	const int32			kSignSucceedsCurrencyAndValue      = 2;
24 	static	const int32			kSignImmediatelyPrecedesCurrency   = 3;
25 	static	const int32			kSignImmediatelySucceedsCurrency   = 4;
26 
27 								ICUMonetaryData(struct lconv& localeConv);
28 
29 			void				Initialize(
30 									LocaleMonetaryDataBridge* dataBridge);
31 
32 	virtual	status_t			SetTo(const Locale& locale,
33 									const char* posixLocaleName);
34 	virtual	status_t			SetToPosix();
35 
36 			const char*			GetLanginfo(int index);
37 
38 private:
39 	static	const int32			kCsPrecedesFlag = 1 << 0;
40 	static	const int32			kSepBySpaceFlag = 1 << 1;
41 
42 			int32				_DetermineCurrencyPosAndSeparator(
43 									const UnicodeString& prefix,
44 									const UnicodeString& suffix,
45 									const UnicodeString& signSymbol,
46 									const UnicodeString& currencySymbol,
47 									UChar& currencySeparatorChar);
48 			int32				_DetermineSignPos(const UnicodeString& prefix,
49 									const UnicodeString& suffix,
50 									const UnicodeString& signSymbol,
51 									const UnicodeString& currencySymbol);
52 
53 			char				fDecimalPoint[skLCBufSize];
54 			char				fThousandsSep[skLCBufSize];
55 			char				fGrouping[skLCBufSize];
56 			char				fIntCurrSymbol[skLCBufSize];
57 			char				fCurrencySymbol[skLCBufSize];
58 			char				fPositiveSign[skLCBufSize];
59 			char				fNegativeSign[skLCBufSize];
60 
61 			struct lconv&		fLocaleConv;
62 			const struct lconv*	fPosixLocaleConv;
63 };
64 
65 
66 }	// namespace BPrivate
67 
68 
69 #endif	// _ICU_MONETARY_DATA_H
70