xref: /haiku/headers/private/libroot/locale/ICUTimeConversion.h (revision e0ef64750f3169cd634bb2f7a001e22488b05231)
1 /*
2  * Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _ICU_TIME_CONVERSION_H
6 #define _ICU_TIME_CONVERSION_H
7 
8 
9 #include <time.h>
10 
11 #include <StorageDefs.h>
12 
13 #include "ICUTimeData.h"
14 #include "LocaleBackend.h"
15 
16 
17 namespace BPrivate {
18 
19 
20 class ICUTimeConversion {
21 public:
22 								ICUTimeConversion(const ICUTimeData& timeData);
23 	virtual						~ICUTimeConversion();
24 
25 	virtual void				Initialize(
26 									TimeConversionDataBridge* dataBridge);
27 
28 			status_t			TZSet(const char* timeZoneID);
29 
30 			status_t			Localtime(const time_t* inTime,
31 									struct tm* tmOut);
32 			status_t			Gmtime(const time_t* inTime, struct tm* tmOut);
33 
34 			status_t			Mktime(struct tm* inOutTm, time_t& timeOut);
35 
36 private:
37 			status_t			_FillTmValues(const TimeZone* icuTimeZone,
38 									const time_t* inTime, struct tm* tmOut);
39 
40 			const ICUTimeData&	fTimeData;
41 
42 			TimeConversionDataBridge*	fDataBridge;
43 
44 			char				fTimeZoneID[B_FILE_NAME_LENGTH];
45 };
46 
47 
48 }	// namespace BPrivate
49 
50 
51 #endif	// _ICU_TIME_BACKEND_H
52