haiku/headers/private/libroot/locale/ICUTimeConversion.h
Oliver Tappe de2e54ace0 Adjust tzset() implementation to better follow the POSIX specs and
make some more perl tests happy.
* no longer expect a ICU timezone ID in the TZ environment variable,
  but only expect this format if the TZ-value is starting with ':'
* accept "standard" TZ-values like "EST5" (of which only "EST" is
  relevant to us) - if such a value is specified, we hardcode the
  timezone name to the given value, no matter how ICU calls it
* adjust tests accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39415 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-13 01:13:38 +00:00

52 lines
1.0 KiB
C++

/*
* 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>
#include <StorageDefs.h>
#include "ICUTimeData.h"
#include "LocaleBackend.h"
namespace BPrivate {
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);
private:
status_t _FillTmValues(const TimeZone* icuTimeZone,
const time_t* inTime, struct tm* tmOut);
const ICUTimeData& fTimeData;
TimeConversionDataBridge* fDataBridge;
char fTimeZoneID[B_FILE_NAME_LENGTH];
};
} // namespace BPrivate
#endif // _ICU_TIME_BACKEND_H