2010-08-17 01:14:23 +04:00
|
|
|
/*
|
2011-11-23 22:55:34 +04:00
|
|
|
* Copyright 2010-2011, Oliver Tappe, zooey@hirschkaefer.de.
|
2010-08-17 01:14:23 +04:00
|
|
|
* 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);
|
|
|
|
|
2021-02-21 14:10:47 +03:00
|
|
|
status_t Timegm(struct tm* inOutTm, time_t& timeOut);
|
|
|
|
|
2010-08-17 01:14:23 +04:00
|
|
|
private:
|
2020-08-02 12:53:25 +03:00
|
|
|
status_t _FillTmValues(const U_NAMESPACE_QUALIFIER
|
|
|
|
TimeZone* icuTimeZone,
|
2010-08-17 01:14:23 +04:00
|
|
|
const time_t* inTime, struct tm* tmOut);
|
|
|
|
|
2021-02-21 14:10:47 +03:00
|
|
|
status_t _Mktime(const U_NAMESPACE_QUALIFIER
|
|
|
|
TimeZone* icuTimeZone,
|
|
|
|
struct tm* inOutTm, time_t& timeOut);
|
|
|
|
|
2010-08-17 01:14:23 +04:00
|
|
|
const ICUTimeData& fTimeData;
|
|
|
|
|
|
|
|
TimeConversionDataBridge* fDataBridge;
|
|
|
|
|
2020-08-02 12:53:25 +03:00
|
|
|
U_NAMESPACE_QUALIFIER 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
|