xref: /haiku/headers/private/libroot/locale/ICUTimeData.h (revision e277f0be5755a37e30f098deb6fb7542ac850a47)
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 
25 			void				Initialize(LocaleTimeDataBridge* dataBridge);
26 
27 	virtual	status_t			SetTo(const Locale& locale,
28 									const char* posixLocaleName);
29 	virtual	status_t			SetToPosix();
30 
31 			const char*			GetLanginfo(int index);
32 
33 private:
34 			status_t			_SetLCTimeEntries(const UnicodeString* strings,
35 									char* destination, int entrySize,
36 									int count, int maxCount);
37 			status_t			_SetLCTimePattern(DateFormat* format,
38 									char* destination, int destinationSize);
39 
40 			char				fMon[12][24];
41 			char				fMonth[12][64];
42 			char				fWday[7][24];
43 			char				fWeekday[7][64];
44 			char				fTimeFormat[24];
45 			char				fDateFormat[24];
46 			char				fDateTimeFormat[32];
47 			char				fAm[24];
48 			char				fPm[24];
49 			char				fDateTimeZoneFormat[32];
50 			char				fAltMonth[12][64];
51 			char				fMonthDayOrder[4];
52 			char				fAmPmFormat[32];
53 
54 			struct lc_time_t&	fLCTimeInfo;
55 			const struct lc_time_t* fPosixLCTimeInfo;
56 };
57 
58 
59 }	// namespace BPrivate
60 
61 
62 #endif	// _ICU_TIME_DATA_H
63