haiku/headers/private/libroot/locale/ICUTimeConversion.h
Jérôme Duval c1e6e51a05 libroot: implement timegm calling the ICU backend
Change-Id: Ib4de4288e061670acbc2edea3671cee029305d33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3748
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2021-02-24 05:51:44 +00:00

62 lines
1.3 KiB
C++

/*
* Copyright 2010-2011, 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>
#include <StorageDefs.h>
#include "ICUTimeData.h"
#include "LocaleBackend.h"
namespace BPrivate {
namespace Libroot {
class ICUTimeConversion {
public:
ICUTimeConversion(const ICUTimeData& timeData);
virtual ~ICUTimeConversion();
virtual void Initialize(
TimeConversionDataBridge* dataBridge);
status_t TZSet(const char* timeZoneID, const char* tz);
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);
status_t Timegm(struct tm* inOutTm, time_t& timeOut);
private:
status_t _FillTmValues(const U_NAMESPACE_QUALIFIER
TimeZone* icuTimeZone,
const time_t* inTime, struct tm* tmOut);
status_t _Mktime(const U_NAMESPACE_QUALIFIER
TimeZone* icuTimeZone,
struct tm* inOutTm, time_t& timeOut);
const ICUTimeData& fTimeData;
TimeConversionDataBridge* fDataBridge;
U_NAMESPACE_QUALIFIER TimeZone* fTimeZone;
char fTimeZoneID[B_FILE_NAME_LENGTH];
};
} // namespace Libroot
} // namespace BPrivate
#endif // _ICU_TIME_BACKEND_H