]> git.saurik.com Git - apple/icu.git/blame - icuSources/i18n/ztrans.cpp
ICU-59117.0.1.tar.gz
[apple/icu.git] / icuSources / i18n / ztrans.cpp
CommitLineData
f3c0d7a5
A
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
729e4ab9
A
3/*
4*******************************************************************************
5* Copyright (C) 2009-2010, International Business Machines Corporation and *
6* others. All Rights Reserved. *
7*******************************************************************************
8*/
9
10/**
11 * \file
12 * \brief C API: Time zone transition classes
13 */
14
15#include "unicode/utypes.h"
16
17#if !UCONFIG_NO_FORMATTING
18
19#include "unicode/uobject.h"
20#include "ztrans.h"
21#include "unicode/tztrans.h"
22#include "cmemory.h"
23#include "unicode/ustring.h"
24#include "unicode/parsepos.h"
25
26U_NAMESPACE_USE
27
28U_CAPI ZTrans* U_EXPORT2
29ztrans_open(UDate time, const void* from, const void* to){
30 return (ZTrans*) new TimeZoneTransition(time,*(TimeZoneRule*)from,*(TimeZoneRule*)to);
31}
32
33U_CAPI ZTrans* U_EXPORT2
34ztrans_openEmpty() {
35 return (ZTrans*) new TimeZoneTransition();
36}
37
38U_CAPI void U_EXPORT2
39ztrans_close(ZTrans *trans) {
40 delete (TimeZoneTransition*)trans;
41}
42
43U_CAPI ZTrans* U_EXPORT2
44ztrans_clone(ZTrans *trans) {
45 return (ZTrans*) (((TimeZoneTransition*)trans)->TimeZoneTransition::clone());
46}
47
48U_CAPI UBool U_EXPORT2
49ztrans_equals(const ZTrans* trans1, const ZTrans* trans2){
50 return *(const TimeZoneTransition*)trans1 == *(const TimeZoneTransition*)trans2;
51}
52
53U_CAPI UDate U_EXPORT2
54ztrans_getTime(ZTrans* trans) {
55 return ((TimeZoneTransition*)trans)->TimeZoneTransition::getTime();
56}
57
58U_CAPI void U_EXPORT2
59ztrans_setTime(ZTrans* trans, UDate time) {
60 return ((TimeZoneTransition*)trans)->TimeZoneTransition::setTime(time);
61}
62
63U_CAPI void* U_EXPORT2
64ztrans_getFrom(ZTrans* & trans) {
65 return (void*) (((TimeZoneTransition*)trans)->TimeZoneTransition::getFrom());
66}
67
68U_CAPI void U_EXPORT2
69ztrans_setFrom(ZTrans* trans, const void* from) {
70 return ((TimeZoneTransition*)trans)->TimeZoneTransition::setFrom(*(TimeZoneRule*)from);
71}
72
73U_CAPI void U_EXPORT2
74ztrans_adoptFrom(ZTrans* trans, void* from) {
75 return ((TimeZoneTransition*)trans)->TimeZoneTransition::adoptFrom((TimeZoneRule*)from);
76}
77
78U_CAPI void* U_EXPORT2
79ztrans_getTo(ZTrans* trans){
80 return (void*) (((TimeZoneTransition*)trans)->TimeZoneTransition::getTo());
81}
82
83U_CAPI void U_EXPORT2
84ztrans_setTo(ZTrans* trans, const void* to) {
85 return ((TimeZoneTransition*)trans)->TimeZoneTransition::setTo(*(TimeZoneRule*)to);
86}
87
88U_CAPI void U_EXPORT2
89ztrans_adoptTo(ZTrans* trans, void* to) {
90 return ((TimeZoneTransition*)trans)->TimeZoneTransition::adoptTo((TimeZoneRule*)to);
91}
92
93U_CAPI UClassID U_EXPORT2
94ztrans_getStaticClassID(ZTrans* trans) {
95 return ((TimeZoneTransition*)trans)->TimeZoneTransition::getStaticClassID();
96}
97
98U_CAPI UClassID U_EXPORT2
99ztrans_getDynamicClassID(ZTrans* trans){
100 return ((TimeZoneTransition*)trans)->TimeZoneTransition::getDynamicClassID();
101}
102
103#endif