Line data Source code
1 : // © 2016 and later: Unicode, Inc. and others.
2 : // License & terms of use: http://www.unicode.org/copyright.html
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 :
26 : U_NAMESPACE_USE
27 :
28 : U_CAPI ZTrans* U_EXPORT2
29 0 : ztrans_open(UDate time, const void* from, const void* to){
30 0 : return (ZTrans*) new TimeZoneTransition(time,*(TimeZoneRule*)from,*(TimeZoneRule*)to);
31 : }
32 :
33 : U_CAPI ZTrans* U_EXPORT2
34 0 : ztrans_openEmpty() {
35 0 : return (ZTrans*) new TimeZoneTransition();
36 : }
37 :
38 : U_CAPI void U_EXPORT2
39 0 : ztrans_close(ZTrans *trans) {
40 0 : delete (TimeZoneTransition*)trans;
41 0 : }
42 :
43 : U_CAPI ZTrans* U_EXPORT2
44 0 : ztrans_clone(ZTrans *trans) {
45 0 : return (ZTrans*) (((TimeZoneTransition*)trans)->TimeZoneTransition::clone());
46 : }
47 :
48 : U_CAPI UBool U_EXPORT2
49 0 : ztrans_equals(const ZTrans* trans1, const ZTrans* trans2){
50 0 : return *(const TimeZoneTransition*)trans1 == *(const TimeZoneTransition*)trans2;
51 : }
52 :
53 : U_CAPI UDate U_EXPORT2
54 0 : ztrans_getTime(ZTrans* trans) {
55 0 : return ((TimeZoneTransition*)trans)->TimeZoneTransition::getTime();
56 : }
57 :
58 : U_CAPI void U_EXPORT2
59 0 : ztrans_setTime(ZTrans* trans, UDate time) {
60 0 : return ((TimeZoneTransition*)trans)->TimeZoneTransition::setTime(time);
61 : }
62 :
63 : U_CAPI void* U_EXPORT2
64 0 : ztrans_getFrom(ZTrans* & trans) {
65 0 : return (void*) (((TimeZoneTransition*)trans)->TimeZoneTransition::getFrom());
66 : }
67 :
68 : U_CAPI void U_EXPORT2
69 0 : ztrans_setFrom(ZTrans* trans, const void* from) {
70 0 : return ((TimeZoneTransition*)trans)->TimeZoneTransition::setFrom(*(TimeZoneRule*)from);
71 : }
72 :
73 : U_CAPI void U_EXPORT2
74 0 : ztrans_adoptFrom(ZTrans* trans, void* from) {
75 0 : return ((TimeZoneTransition*)trans)->TimeZoneTransition::adoptFrom((TimeZoneRule*)from);
76 : }
77 :
78 : U_CAPI void* U_EXPORT2
79 0 : ztrans_getTo(ZTrans* trans){
80 0 : return (void*) (((TimeZoneTransition*)trans)->TimeZoneTransition::getTo());
81 : }
82 :
83 : U_CAPI void U_EXPORT2
84 0 : ztrans_setTo(ZTrans* trans, const void* to) {
85 0 : return ((TimeZoneTransition*)trans)->TimeZoneTransition::setTo(*(TimeZoneRule*)to);
86 : }
87 :
88 : U_CAPI void U_EXPORT2
89 0 : ztrans_adoptTo(ZTrans* trans, void* to) {
90 0 : return ((TimeZoneTransition*)trans)->TimeZoneTransition::adoptTo((TimeZoneRule*)to);
91 : }
92 :
93 : U_CAPI UClassID U_EXPORT2
94 0 : ztrans_getStaticClassID(ZTrans* trans) {
95 0 : return ((TimeZoneTransition*)trans)->TimeZoneTransition::getStaticClassID();
96 : }
97 :
98 : U_CAPI UClassID U_EXPORT2
99 0 : ztrans_getDynamicClassID(ZTrans* trans){
100 0 : return ((TimeZoneTransition*)trans)->TimeZoneTransition::getDynamicClassID();
101 : }
102 :
103 : #endif
|