vfs: check userland buffers before reading them.
[haiku.git] / headers / private / libroot / locale / ICUTimeData.h
blobaa1cbf315a45165ee0720c56b8105446b576a823
1 /*
2 * Copyright 2010-2011, 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
9 #include "ICUCategoryData.h"
10 #include "LocaleBackend.h"
12 #include <unicode/datefmt.h>
14 #include <timelocal.h>
17 namespace BPrivate {
18 namespace Libroot {
21 class ICUMessagesData;
24 class ICUTimeData : public ICUCategoryData {
25 typedef ICUCategoryData inherited;
26 public:
27 ICUTimeData(pthread_key_t tlsKey,
28 struct lc_time_t& lcTimeInfo,
29 const ICUMessagesData& messagesData);
30 ~ICUTimeData();
32 void Initialize(LocaleTimeDataBridge* dataBridge);
34 virtual status_t SetTo(const Locale& locale,
35 const char* posixLocaleName);
36 virtual status_t SetToPosix();
38 const char* GetLanginfo(int index);
40 const Locale& ICULocaleForStrings() const;
42 private:
43 status_t _SetLCTimeEntries(const UnicodeString* strings,
44 char* destination, int entrySize,
45 int count, int maxCount);
46 status_t _SetLCTimePattern(DateFormat* format,
47 char* destination, int destinationSize);
49 char fMon[12][24];
50 char fMonth[12][64];
51 char fWday[7][24];
52 char fWeekday[7][64];
53 char fTimeFormat[24];
54 char fDateFormat[24];
55 char fDateTimeFormat[32];
56 char fAm[24];
57 char fPm[24];
58 char fDateTimeZoneFormat[32];
59 char fAltMonth[12][64];
60 char fMonthDayOrder[4];
61 char fAmPmFormat[32];
63 struct lc_time_t& fLCTimeInfo;
65 LocaleTimeDataBridge* fDataBridge;
67 const ICUMessagesData& fMessagesData;
71 } // namespace Libroot
72 } // namespace BPrivate
75 #endif // _ICU_TIME_DATA_H