1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
5 * Copyright (C) 2009-2010, International Business Machines Corporation and *
6 * others. All Rights Reserved. *
7 *******************************************************************************
12 * \brief C API: Time zone transition classes
15 #include "unicode/utypes.h"
17 #if !UCONFIG_NO_FORMATTING
19 #include "unicode/uobject.h"
21 #include "unicode/tztrans.h"
23 #include "unicode/ustring.h"
24 #include "unicode/parsepos.h"
28 U_CAPI ZTrans
* U_EXPORT2
29 ztrans_open(UDate time
, const void* from
, const void* to
){
30 return (ZTrans
*) new TimeZoneTransition(time
,*(TimeZoneRule
*)from
,*(TimeZoneRule
*)to
);
33 U_CAPI ZTrans
* U_EXPORT2
35 return (ZTrans
*) new TimeZoneTransition();
39 ztrans_close(ZTrans
*trans
) {
40 delete (TimeZoneTransition
*)trans
;
43 U_CAPI ZTrans
* U_EXPORT2
44 ztrans_clone(ZTrans
*trans
) {
45 return (ZTrans
*) (((TimeZoneTransition
*)trans
)->TimeZoneTransition::clone());
48 U_CAPI UBool U_EXPORT2
49 ztrans_equals(const ZTrans
* trans1
, const ZTrans
* trans2
){
50 return *(const TimeZoneTransition
*)trans1
== *(const TimeZoneTransition
*)trans2
;
53 U_CAPI UDate U_EXPORT2
54 ztrans_getTime(ZTrans
* trans
) {
55 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::getTime();
59 ztrans_setTime(ZTrans
* trans
, UDate time
) {
60 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::setTime(time
);
63 U_CAPI
void* U_EXPORT2
64 ztrans_getFrom(ZTrans
* & trans
) {
65 return (void*) (((TimeZoneTransition
*)trans
)->TimeZoneTransition::getFrom());
69 ztrans_setFrom(ZTrans
* trans
, const void* from
) {
70 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::setFrom(*(TimeZoneRule
*)from
);
74 ztrans_adoptFrom(ZTrans
* trans
, void* from
) {
75 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::adoptFrom((TimeZoneRule
*)from
);
78 U_CAPI
void* U_EXPORT2
79 ztrans_getTo(ZTrans
* trans
){
80 return (void*) (((TimeZoneTransition
*)trans
)->TimeZoneTransition::getTo());
84 ztrans_setTo(ZTrans
* trans
, const void* to
) {
85 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::setTo(*(TimeZoneRule
*)to
);
89 ztrans_adoptTo(ZTrans
* trans
, void* to
) {
90 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::adoptTo((TimeZoneRule
*)to
);
93 U_CAPI UClassID U_EXPORT2
94 ztrans_getStaticClassID(ZTrans
* trans
) {
95 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::getStaticClassID();
98 U_CAPI UClassID U_EXPORT2
99 ztrans_getDynamicClassID(ZTrans
* trans
){
100 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::getDynamicClassID();