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 namespace Libroot { 19 20 21 class ICUTimeData : public ICUCategoryData { 22 typedef ICUCategoryData inherited; 23 public: 24 ICUTimeData(struct lc_time_t& lcTimeInfo); 25 ~ICUTimeData(); 26 27 void Initialize(LocaleTimeDataBridge* dataBridge); 28 29 virtual status_t SetTo(const Locale& locale, 30 const char* posixLocaleName); 31 virtual status_t SetToPosix(); 32 33 const char* GetLanginfo(int index); 34 35 const Locale& ICULocale() const; 36 37 private: 38 status_t _SetLCTimeEntries(const UnicodeString* strings, 39 char* destination, int entrySize, 40 int count, int maxCount); 41 status_t _SetLCTimePattern(DateFormat* format, 42 char* destination, int destinationSize); 43 44 char fMon[12][24]; 45 char fMonth[12][64]; 46 char fWday[7][24]; 47 char fWeekday[7][64]; 48 char fTimeFormat[24]; 49 char fDateFormat[24]; 50 char fDateTimeFormat[32]; 51 char fAm[24]; 52 char fPm[24]; 53 char fDateTimeZoneFormat[32]; 54 char fAltMonth[12][64]; 55 char fMonthDayOrder[4]; 56 char fAmPmFormat[32]; 57 58 struct lc_time_t& fLCTimeInfo; 59 60 LocaleTimeDataBridge* fDataBridge; 61 }; 62 63 64 } // namespace Libroot 65 } // namespace BPrivate 66 67 68 #endif // _ICU_TIME_DATA_H 69