Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* |
michael@0 | 2 | ******************************************************************************* |
michael@0 | 3 | * Copyright (C) 2009-2010, International Business Machines Corporation and * |
michael@0 | 4 | * others. All Rights Reserved. * |
michael@0 | 5 | ******************************************************************************* |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | /** |
michael@0 | 9 | * \file |
michael@0 | 10 | * \brief C API: Time zone transition classes |
michael@0 | 11 | */ |
michael@0 | 12 | |
michael@0 | 13 | #include "unicode/utypes.h" |
michael@0 | 14 | |
michael@0 | 15 | #if !UCONFIG_NO_FORMATTING |
michael@0 | 16 | |
michael@0 | 17 | #include "unicode/uobject.h" |
michael@0 | 18 | #include "ztrans.h" |
michael@0 | 19 | #include "unicode/tztrans.h" |
michael@0 | 20 | #include "cmemory.h" |
michael@0 | 21 | #include "unicode/ustring.h" |
michael@0 | 22 | #include "unicode/parsepos.h" |
michael@0 | 23 | |
michael@0 | 24 | U_NAMESPACE_USE |
michael@0 | 25 | |
michael@0 | 26 | U_CAPI ZTrans* U_EXPORT2 |
michael@0 | 27 | ztrans_open(UDate time, const void* from, const void* to){ |
michael@0 | 28 | return (ZTrans*) new TimeZoneTransition(time,*(TimeZoneRule*)from,*(TimeZoneRule*)to); |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | U_CAPI ZTrans* U_EXPORT2 |
michael@0 | 32 | ztrans_openEmpty() { |
michael@0 | 33 | return (ZTrans*) new TimeZoneTransition(); |
michael@0 | 34 | } |
michael@0 | 35 | |
michael@0 | 36 | U_CAPI void U_EXPORT2 |
michael@0 | 37 | ztrans_close(ZTrans *trans) { |
michael@0 | 38 | delete (TimeZoneTransition*)trans; |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | U_CAPI ZTrans* U_EXPORT2 |
michael@0 | 42 | ztrans_clone(ZTrans *trans) { |
michael@0 | 43 | return (ZTrans*) (((TimeZoneTransition*)trans)->TimeZoneTransition::clone()); |
michael@0 | 44 | } |
michael@0 | 45 | |
michael@0 | 46 | U_CAPI UBool U_EXPORT2 |
michael@0 | 47 | ztrans_equals(const ZTrans* trans1, const ZTrans* trans2){ |
michael@0 | 48 | return *(const TimeZoneTransition*)trans1 == *(const TimeZoneTransition*)trans2; |
michael@0 | 49 | } |
michael@0 | 50 | |
michael@0 | 51 | U_CAPI UDate U_EXPORT2 |
michael@0 | 52 | ztrans_getTime(ZTrans* trans) { |
michael@0 | 53 | return ((TimeZoneTransition*)trans)->TimeZoneTransition::getTime(); |
michael@0 | 54 | } |
michael@0 | 55 | |
michael@0 | 56 | U_CAPI void U_EXPORT2 |
michael@0 | 57 | ztrans_setTime(ZTrans* trans, UDate time) { |
michael@0 | 58 | return ((TimeZoneTransition*)trans)->TimeZoneTransition::setTime(time); |
michael@0 | 59 | } |
michael@0 | 60 | |
michael@0 | 61 | U_CAPI void* U_EXPORT2 |
michael@0 | 62 | ztrans_getFrom(ZTrans* & trans) { |
michael@0 | 63 | return (void*) (((TimeZoneTransition*)trans)->TimeZoneTransition::getFrom()); |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | U_CAPI void U_EXPORT2 |
michael@0 | 67 | ztrans_setFrom(ZTrans* trans, const void* from) { |
michael@0 | 68 | return ((TimeZoneTransition*)trans)->TimeZoneTransition::setFrom(*(TimeZoneRule*)from); |
michael@0 | 69 | } |
michael@0 | 70 | |
michael@0 | 71 | U_CAPI void U_EXPORT2 |
michael@0 | 72 | ztrans_adoptFrom(ZTrans* trans, void* from) { |
michael@0 | 73 | return ((TimeZoneTransition*)trans)->TimeZoneTransition::adoptFrom((TimeZoneRule*)from); |
michael@0 | 74 | } |
michael@0 | 75 | |
michael@0 | 76 | U_CAPI void* U_EXPORT2 |
michael@0 | 77 | ztrans_getTo(ZTrans* trans){ |
michael@0 | 78 | return (void*) (((TimeZoneTransition*)trans)->TimeZoneTransition::getTo()); |
michael@0 | 79 | } |
michael@0 | 80 | |
michael@0 | 81 | U_CAPI void U_EXPORT2 |
michael@0 | 82 | ztrans_setTo(ZTrans* trans, const void* to) { |
michael@0 | 83 | return ((TimeZoneTransition*)trans)->TimeZoneTransition::setTo(*(TimeZoneRule*)to); |
michael@0 | 84 | } |
michael@0 | 85 | |
michael@0 | 86 | U_CAPI void U_EXPORT2 |
michael@0 | 87 | ztrans_adoptTo(ZTrans* trans, void* to) { |
michael@0 | 88 | return ((TimeZoneTransition*)trans)->TimeZoneTransition::adoptTo((TimeZoneRule*)to); |
michael@0 | 89 | } |
michael@0 | 90 | |
michael@0 | 91 | U_CAPI UClassID U_EXPORT2 |
michael@0 | 92 | ztrans_getStaticClassID(ZTrans* trans) { |
michael@0 | 93 | return ((TimeZoneTransition*)trans)->TimeZoneTransition::getStaticClassID(); |
michael@0 | 94 | } |
michael@0 | 95 | |
michael@0 | 96 | U_CAPI UClassID U_EXPORT2 |
michael@0 | 97 | ztrans_getDynamicClassID(ZTrans* trans){ |
michael@0 | 98 | return ((TimeZoneTransition*)trans)->TimeZoneTransition::getDynamicClassID(); |
michael@0 | 99 | } |
michael@0 | 100 | |
michael@0 | 101 | #endif |