xref: /haiku/headers/private/libroot/locale/ICUTimeData.h (revision 675ffabd70492a962f8c0288a32208c22ce5de18)
1 /*
2  * Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _ICU_TIME_DATA_H
6 #define _ICU_TIME_DATA_H
7 
8 
9 #include "ICUCategoryData.h"
10 #include "LocaleBackend.h"
11 
12 #include <unicode/datefmt.h>
13 
14 #include <timelocal.h>
15 
16 
17 namespace BPrivate {
18 
19 
20 class ICUTimeData : public ICUCategoryData {
21 	typedef	ICUCategoryData		inherited;
22 public:
23 								ICUTimeData(struct lc_time_t& lcTimeInfo);
24 								~ICUTimeData();
25 
26 			void				Initialize(LocaleTimeDataBridge* dataBridge);
27 
28 	virtual	status_t			SetTo(const Locale& locale,
29 									const char* posixLocaleName);
30 	virtual	status_t			SetToPosix();
31 
32 			const char*			GetLanginfo(int index);
33 
34 			const Locale&		ICULocale() const;
35 
36 private:
37 			status_t			_SetLCTimeEntries(const UnicodeString* strings,
38 									char* destination, int entrySize,
39 									int count, int maxCount);
40 			status_t			_SetLCTimePattern(DateFormat* format,
41 									char* destination, int destinationSize);
42 
43 			char				fMon[12][24];
44 			char				fMonth[12][64];
45 			char				fWday[7][24];
46 			char				fWeekday[7][64];
47 			char				fTimeFormat[24];
48 			char				fDateFormat[24];
49 			char				fDateTimeFormat[32];
50 			char				fAm[24];
51 			char				fPm[24];
52 			char				fDateTimeZoneFormat[32];
53 			char				fAltMonth[12][64];
54 			char				fMonthDayOrder[4];
55 			char				fAmPmFormat[32];
56 
57 			struct lc_time_t&	fLCTimeInfo;
58 
59 			LocaleTimeDataBridge*	fDataBridge;
60 };
61 
62 
63 }	// namespace BPrivate
64 
65 
66 #endif	// _ICU_TIME_DATA_H
67