intl/icu/source/i18n/ztrans.cpp

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 /*
     2 *******************************************************************************
     3 * Copyright (C) 2009-2010, International Business Machines Corporation and         *
     4 * others. All Rights Reserved.                                                *
     5 *******************************************************************************
     6 */
     8 /**
     9  * \file 
    10  * \brief C API: Time zone transition classes
    11  */
    13 #include "unicode/utypes.h"
    15 #if !UCONFIG_NO_FORMATTING
    17 #include "unicode/uobject.h"
    18 #include "ztrans.h"
    19 #include "unicode/tztrans.h"
    20 #include "cmemory.h"
    21 #include "unicode/ustring.h"
    22 #include "unicode/parsepos.h"
    24 U_NAMESPACE_USE
    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);
    29 }
    31 U_CAPI ZTrans* U_EXPORT2
    32 ztrans_openEmpty() {
    33     return (ZTrans*) new TimeZoneTransition();
    34 }
    36 U_CAPI void U_EXPORT2
    37 ztrans_close(ZTrans *trans) {
    38     delete (TimeZoneTransition*)trans;
    39 }
    41 U_CAPI ZTrans* U_EXPORT2
    42 ztrans_clone(ZTrans *trans) {
    43     return (ZTrans*) (((TimeZoneTransition*)trans)->TimeZoneTransition::clone());
    44 }
    46 U_CAPI UBool U_EXPORT2
    47 ztrans_equals(const ZTrans* trans1, const ZTrans* trans2){
    48     return *(const TimeZoneTransition*)trans1 == *(const TimeZoneTransition*)trans2;
    49 }
    51 U_CAPI UDate U_EXPORT2
    52 ztrans_getTime(ZTrans* trans) {
    53     return ((TimeZoneTransition*)trans)->TimeZoneTransition::getTime();
    54 }
    56 U_CAPI void U_EXPORT2
    57 ztrans_setTime(ZTrans* trans, UDate time) {
    58     return ((TimeZoneTransition*)trans)->TimeZoneTransition::setTime(time);
    59 }
    61 U_CAPI void* U_EXPORT2
    62 ztrans_getFrom(ZTrans* & trans) {
    63     return (void*) (((TimeZoneTransition*)trans)->TimeZoneTransition::getFrom());
    64 }
    66 U_CAPI void U_EXPORT2
    67 ztrans_setFrom(ZTrans* trans, const void* from) {
    68     return ((TimeZoneTransition*)trans)->TimeZoneTransition::setFrom(*(TimeZoneRule*)from);
    69 }
    71 U_CAPI void U_EXPORT2
    72 ztrans_adoptFrom(ZTrans* trans, void* from) {
    73     return ((TimeZoneTransition*)trans)->TimeZoneTransition::adoptFrom((TimeZoneRule*)from);
    74 }
    76 U_CAPI void* U_EXPORT2
    77 ztrans_getTo(ZTrans* trans){
    78     return (void*) (((TimeZoneTransition*)trans)->TimeZoneTransition::getTo());
    79 }
    81 U_CAPI void U_EXPORT2
    82 ztrans_setTo(ZTrans* trans, const void* to) {
    83     return ((TimeZoneTransition*)trans)->TimeZoneTransition::setTo(*(TimeZoneRule*)to);
    84 }
    86 U_CAPI void U_EXPORT2
    87 ztrans_adoptTo(ZTrans* trans, void* to) {
    88     return ((TimeZoneTransition*)trans)->TimeZoneTransition::adoptTo((TimeZoneRule*)to);
    89 }
    91 U_CAPI UClassID U_EXPORT2
    92 ztrans_getStaticClassID(ZTrans* trans) {
    93     return ((TimeZoneTransition*)trans)->TimeZoneTransition::getStaticClassID();
    94 }
    96 U_CAPI UClassID U_EXPORT2
    97 ztrans_getDynamicClassID(ZTrans* trans){
    98     return ((TimeZoneTransition*)trans)->TimeZoneTransition::getDynamicClassID();
    99 }
   101 #endif

mercurial