1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/i18n/ztrans.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,101 @@ 1.4 +/* 1.5 +******************************************************************************* 1.6 +* Copyright (C) 2009-2010, International Business Machines Corporation and * 1.7 +* others. All Rights Reserved. * 1.8 +******************************************************************************* 1.9 +*/ 1.10 + 1.11 +/** 1.12 + * \file 1.13 + * \brief C API: Time zone transition classes 1.14 + */ 1.15 + 1.16 +#include "unicode/utypes.h" 1.17 + 1.18 +#if !UCONFIG_NO_FORMATTING 1.19 + 1.20 +#include "unicode/uobject.h" 1.21 +#include "ztrans.h" 1.22 +#include "unicode/tztrans.h" 1.23 +#include "cmemory.h" 1.24 +#include "unicode/ustring.h" 1.25 +#include "unicode/parsepos.h" 1.26 + 1.27 +U_NAMESPACE_USE 1.28 + 1.29 +U_CAPI ZTrans* U_EXPORT2 1.30 +ztrans_open(UDate time, const void* from, const void* to){ 1.31 + return (ZTrans*) new TimeZoneTransition(time,*(TimeZoneRule*)from,*(TimeZoneRule*)to); 1.32 +} 1.33 + 1.34 +U_CAPI ZTrans* U_EXPORT2 1.35 +ztrans_openEmpty() { 1.36 + return (ZTrans*) new TimeZoneTransition(); 1.37 +} 1.38 + 1.39 +U_CAPI void U_EXPORT2 1.40 +ztrans_close(ZTrans *trans) { 1.41 + delete (TimeZoneTransition*)trans; 1.42 +} 1.43 + 1.44 +U_CAPI ZTrans* U_EXPORT2 1.45 +ztrans_clone(ZTrans *trans) { 1.46 + return (ZTrans*) (((TimeZoneTransition*)trans)->TimeZoneTransition::clone()); 1.47 +} 1.48 + 1.49 +U_CAPI UBool U_EXPORT2 1.50 +ztrans_equals(const ZTrans* trans1, const ZTrans* trans2){ 1.51 + return *(const TimeZoneTransition*)trans1 == *(const TimeZoneTransition*)trans2; 1.52 +} 1.53 + 1.54 +U_CAPI UDate U_EXPORT2 1.55 +ztrans_getTime(ZTrans* trans) { 1.56 + return ((TimeZoneTransition*)trans)->TimeZoneTransition::getTime(); 1.57 +} 1.58 + 1.59 +U_CAPI void U_EXPORT2 1.60 +ztrans_setTime(ZTrans* trans, UDate time) { 1.61 + return ((TimeZoneTransition*)trans)->TimeZoneTransition::setTime(time); 1.62 +} 1.63 + 1.64 +U_CAPI void* U_EXPORT2 1.65 +ztrans_getFrom(ZTrans* & trans) { 1.66 + return (void*) (((TimeZoneTransition*)trans)->TimeZoneTransition::getFrom()); 1.67 +} 1.68 + 1.69 +U_CAPI void U_EXPORT2 1.70 +ztrans_setFrom(ZTrans* trans, const void* from) { 1.71 + return ((TimeZoneTransition*)trans)->TimeZoneTransition::setFrom(*(TimeZoneRule*)from); 1.72 +} 1.73 + 1.74 +U_CAPI void U_EXPORT2 1.75 +ztrans_adoptFrom(ZTrans* trans, void* from) { 1.76 + return ((TimeZoneTransition*)trans)->TimeZoneTransition::adoptFrom((TimeZoneRule*)from); 1.77 +} 1.78 + 1.79 +U_CAPI void* U_EXPORT2 1.80 +ztrans_getTo(ZTrans* trans){ 1.81 + return (void*) (((TimeZoneTransition*)trans)->TimeZoneTransition::getTo()); 1.82 +} 1.83 + 1.84 +U_CAPI void U_EXPORT2 1.85 +ztrans_setTo(ZTrans* trans, const void* to) { 1.86 + return ((TimeZoneTransition*)trans)->TimeZoneTransition::setTo(*(TimeZoneRule*)to); 1.87 +} 1.88 + 1.89 +U_CAPI void U_EXPORT2 1.90 +ztrans_adoptTo(ZTrans* trans, void* to) { 1.91 + return ((TimeZoneTransition*)trans)->TimeZoneTransition::adoptTo((TimeZoneRule*)to); 1.92 +} 1.93 + 1.94 +U_CAPI UClassID U_EXPORT2 1.95 +ztrans_getStaticClassID(ZTrans* trans) { 1.96 + return ((TimeZoneTransition*)trans)->TimeZoneTransition::getStaticClassID(); 1.97 +} 1.98 + 1.99 +U_CAPI UClassID U_EXPORT2 1.100 +ztrans_getDynamicClassID(ZTrans* trans){ 1.101 + return ((TimeZoneTransition*)trans)->TimeZoneTransition::getDynamicClassID(); 1.102 +} 1.103 + 1.104 +#endif