2 *******************************************************************************
3 * Copyright (C) 2009-2010, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
10 * \brief C API: Time zone transition classes
13 #include "unicode/utypes.h"
15 #if !UCONFIG_NO_FORMATTING
17 #include "unicode/uobject.h"
19 #include "unicode/tztrans.h"
21 #include "unicode/ustring.h"
22 #include "unicode/parsepos.h"
26 U_CAPI ZTrans
* U_EXPORT2
27 ztrans_open(UDate time
, const void* from
, const void* to
){
28 return (ZTrans
*) new TimeZoneTransition(time
,*(TimeZoneRule
*)from
,*(TimeZoneRule
*)to
);
31 U_CAPI ZTrans
* U_EXPORT2
33 return (ZTrans
*) new TimeZoneTransition();
37 ztrans_close(ZTrans
*trans
) {
38 delete (TimeZoneTransition
*)trans
;
41 U_CAPI ZTrans
* U_EXPORT2
42 ztrans_clone(ZTrans
*trans
) {
43 return (ZTrans
*) (((TimeZoneTransition
*)trans
)->TimeZoneTransition::clone());
46 U_CAPI UBool U_EXPORT2
47 ztrans_equals(const ZTrans
* trans1
, const ZTrans
* trans2
){
48 return *(const TimeZoneTransition
*)trans1
== *(const TimeZoneTransition
*)trans2
;
51 U_CAPI UDate U_EXPORT2
52 ztrans_getTime(ZTrans
* trans
) {
53 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::getTime();
57 ztrans_setTime(ZTrans
* trans
, UDate time
) {
58 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::setTime(time
);
61 U_CAPI
void* U_EXPORT2
62 ztrans_getFrom(ZTrans
* & trans
) {
63 return (void*) (((TimeZoneTransition
*)trans
)->TimeZoneTransition::getFrom());
67 ztrans_setFrom(ZTrans
* trans
, const void* from
) {
68 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::setFrom(*(TimeZoneRule
*)from
);
72 ztrans_adoptFrom(ZTrans
* trans
, void* from
) {
73 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::adoptFrom((TimeZoneRule
*)from
);
76 U_CAPI
void* U_EXPORT2
77 ztrans_getTo(ZTrans
* trans
){
78 return (void*) (((TimeZoneTransition
*)trans
)->TimeZoneTransition::getTo());
82 ztrans_setTo(ZTrans
* trans
, const void* to
) {
83 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::setTo(*(TimeZoneRule
*)to
);
87 ztrans_adoptTo(ZTrans
* trans
, void* to
) {
88 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::adoptTo((TimeZoneRule
*)to
);
91 U_CAPI UClassID U_EXPORT2
92 ztrans_getStaticClassID(ZTrans
* trans
) {
93 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::getStaticClassID();
96 U_CAPI UClassID U_EXPORT2
97 ztrans_getDynamicClassID(ZTrans
* trans
){
98 return ((TimeZoneTransition
*)trans
)->TimeZoneTransition::getDynamicClassID();