2010-08-17 01:14:23 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _ICU_TIME_CONVERSION_H
|
|
|
|
#define _ICU_TIME_CONVERSION_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
|
2010-08-17 02:01:28 +04:00
|
|
|
#include <StorageDefs.h>
|
|
|
|
|
2010-08-17 01:14:23 +04:00
|
|
|
#include "ICUTimeData.h"
|
|
|
|
#include "LocaleBackend.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace BPrivate {
|
2010-11-22 16:06:36 +03:00
|
|
|
namespace Libroot {
|
2010-08-17 01:14:23 +04:00
|
|
|
|
|
|
|
|
|
|
|
class ICUTimeConversion {
|
|
|
|
public:
|
|
|
|
ICUTimeConversion(const ICUTimeData& timeData);
|
|
|
|
virtual ~ICUTimeConversion();
|
|
|
|
|
|
|
|
virtual void Initialize(
|
|
|
|
TimeConversionDataBridge* dataBridge);
|
|
|
|
|
2010-11-13 04:13:38 +03:00
|
|
|
status_t TZSet(const char* timeZoneID, const char* tz);
|
2010-08-17 01:14:23 +04:00
|
|
|
|
|
|
|
status_t Localtime(const time_t* inTime,
|
|
|
|
struct tm* tmOut);
|
|
|
|
status_t Gmtime(const time_t* inTime, struct tm* tmOut);
|
|
|
|
|
|
|
|
status_t Mktime(struct tm* inOutTm, time_t& timeOut);
|
|
|
|
|
|
|
|
private:
|
|
|
|
status_t _FillTmValues(const TimeZone* icuTimeZone,
|
|
|
|
const time_t* inTime, struct tm* tmOut);
|
|
|
|
|
|
|
|
const ICUTimeData& fTimeData;
|
|
|
|
|
|
|
|
TimeConversionDataBridge* fDataBridge;
|
|
|
|
|
2011-03-03 03:34:51 +03:00
|
|
|
TimeZone* fTimeZone;
|
2010-08-17 02:01:28 +04:00
|
|
|
char fTimeZoneID[B_FILE_NAME_LENGTH];
|
2010-08-17 01:14:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-11-22 16:06:36 +03:00
|
|
|
} // namespace Libroot
|
2010-08-17 01:14:23 +04:00
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _ICU_TIME_BACKEND_H
|