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