2010-07-24 03:13:00 +04:00
|
|
|
/*
|
2011-11-23 22:55:34 +04:00
|
|
|
* Copyright 2010-2011, Oliver Tappe, zooey@hirschkaefer.de.
|
2010-07-24 03:13:00 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _ICU_TIME_DATA_H
|
|
|
|
#define _ICU_TIME_DATA_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "ICUCategoryData.h"
|
|
|
|
#include "LocaleBackend.h"
|
|
|
|
|
|
|
|
#include <unicode/datefmt.h>
|
|
|
|
|
|
|
|
#include <timelocal.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace BPrivate {
|
2010-11-22 16:06:36 +03:00
|
|
|
namespace Libroot {
|
2010-07-24 03:13:00 +04:00
|
|
|
|
|
|
|
|
2012-02-24 00:46:14 +04:00
|
|
|
class ICUMessagesData;
|
|
|
|
|
|
|
|
|
2010-07-24 03:13:00 +04:00
|
|
|
class ICUTimeData : public ICUCategoryData {
|
|
|
|
typedef ICUCategoryData inherited;
|
|
|
|
public:
|
2011-11-22 20:17:18 +04:00
|
|
|
ICUTimeData(pthread_key_t tlsKey,
|
2012-02-24 00:46:14 +04:00
|
|
|
struct lc_time_t& lcTimeInfo,
|
|
|
|
const ICUMessagesData& messagesData);
|
2010-08-17 01:14:23 +04:00
|
|
|
~ICUTimeData();
|
2010-07-24 03:13:00 +04:00
|
|
|
|
|
|
|
void Initialize(LocaleTimeDataBridge* dataBridge);
|
|
|
|
|
2020-08-02 12:53:25 +03:00
|
|
|
virtual status_t SetTo(const U_NAMESPACE_QUALIFIER Locale&
|
|
|
|
locale,
|
2010-07-24 03:13:00 +04:00
|
|
|
const char* posixLocaleName);
|
|
|
|
virtual status_t SetToPosix();
|
|
|
|
|
|
|
|
const char* GetLanginfo(int index);
|
|
|
|
|
2020-08-02 12:53:25 +03:00
|
|
|
const U_NAMESPACE_QUALIFIER Locale& ICULocaleForStrings() const;
|
2012-02-24 02:02:45 +04:00
|
|
|
|
2010-07-24 03:13:00 +04:00
|
|
|
private:
|
2020-08-02 12:53:25 +03:00
|
|
|
status_t _SetLCTimeEntries(const U_NAMESPACE_QUALIFIER
|
|
|
|
UnicodeString* strings,
|
2010-07-24 03:13:00 +04:00
|
|
|
char* destination, int entrySize,
|
|
|
|
int count, int maxCount);
|
2020-08-02 12:53:25 +03:00
|
|
|
status_t _SetLCTimePattern(U_NAMESPACE_QUALIFIER
|
|
|
|
DateFormat* format,
|
2010-07-24 03:13:00 +04:00
|
|
|
char* destination, int destinationSize);
|
|
|
|
|
|
|
|
char fMon[12][24];
|
|
|
|
char fMonth[12][64];
|
|
|
|
char fWday[7][24];
|
|
|
|
char fWeekday[7][64];
|
|
|
|
char fTimeFormat[24];
|
|
|
|
char fDateFormat[24];
|
|
|
|
char fDateTimeFormat[32];
|
|
|
|
char fAm[24];
|
|
|
|
char fPm[24];
|
|
|
|
char fDateTimeZoneFormat[32];
|
|
|
|
char fAltMonth[12][64];
|
|
|
|
char fMonthDayOrder[4];
|
|
|
|
char fAmPmFormat[32];
|
|
|
|
|
|
|
|
struct lc_time_t& fLCTimeInfo;
|
2010-08-17 01:14:23 +04:00
|
|
|
|
|
|
|
LocaleTimeDataBridge* fDataBridge;
|
2012-02-24 00:46:14 +04:00
|
|
|
|
|
|
|
const ICUMessagesData& fMessagesData;
|
2010-07-24 03:13:00 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-11-22 16:06:36 +03:00
|
|
|
} // namespace Libroot
|
2010-07-24 03:13:00 +04:00
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _ICU_TIME_DATA_H
|