w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

vzone.cpp
Go to the documentation of this file.
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-2011, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 *******************************************************************************
8 */
9 
10 /**
11  * \file
12  * \brief C API: VTimeZone classes
13  */
14 
15 #include "unicode/utypes.h"
16 
17 #if !UCONFIG_NO_FORMATTING
18 
19 #include "unicode/uobject.h"
20 #include "vzone.h"
21 #include "unicode/vtzone.h"
22 #include "cmemory.h"
23 #include "unicode/ustring.h"
24 #include "unicode/parsepos.h"
25 
27 
29 vzone_openID(const UChar* ID, int32_t idLength){
30  UnicodeString s(idLength==-1, ID, idLength);
31  return (VZone*) (VTimeZone::createVTimeZoneByID(s));
32 }
33 
35 vzone_openData(const UChar* vtzdata, int32_t vtzdataLength, UErrorCode& status) {
36  UnicodeString s(vtzdataLength==-1, vtzdata, vtzdataLength);
37  return (VZone*) (VTimeZone::createVTimeZone(s,status));
38 }
39 
40 U_CAPI void U_EXPORT2
42  delete (VTimeZone*)zone;
43 }
44 
47  return (VZone*) (((VTimeZone*)zone)->VTimeZone::clone());
48 }
49 
51 vzone_equals(const VZone* zone1, const VZone* zone2) {
52  return *(const VTimeZone*)zone1 == *(const VTimeZone*)zone2;
53 }
54 
56 vzone_getTZURL(VZone* zone, UChar* & url, int32_t & urlLength) {
57  UnicodeString s;
58  UBool b = ((VTimeZone*)zone)->VTimeZone::getTZURL(s);
59 
60  urlLength = s.length();
61  memcpy(url,s.getBuffer(),urlLength);
62 
63  return b;
64 }
65 
66 U_CAPI void U_EXPORT2
67 vzone_setTZURL(VZone* zone, UChar* url, int32_t urlLength) {
68  UnicodeString s(urlLength==-1, url, urlLength);
69  ((VTimeZone*)zone)->VTimeZone::setTZURL(s);
70 }
71 
74  return ((VTimeZone*)zone)->VTimeZone::getLastModified(lastModified);
75 }
76 
77 U_CAPI void U_EXPORT2
79  return ((VTimeZone*)zone)->VTimeZone::setLastModified(lastModified);
80 }
81 
82 U_CAPI void U_EXPORT2
84  UnicodeString s;
85  ((VTimeZone*)zone)->VTimeZone::write(s, status);
86 
87  resultLength = s.length();
88  result = (UChar*)uprv_malloc(resultLength);
89  memcpy(result,s.getBuffer(),resultLength);
90 
91  return;
92 }
93 
94 U_CAPI void U_EXPORT2
96  UnicodeString s;
97  ((VTimeZone*)zone)->VTimeZone::write(start, s, status);
98 
99  resultLength = s.length();
100  result = (UChar*)uprv_malloc(resultLength);
101  memcpy(result,s.getBuffer(),resultLength);
102 
103  return;
104 }
105 
106 U_CAPI void U_EXPORT2
108  UnicodeString s;
109  ((VTimeZone*)zone)->VTimeZone::writeSimple(time, s, status);
110 
111  resultLength = s.length();
112  result = (UChar*)uprv_malloc(resultLength);
113  memcpy(result,s.getBuffer(),resultLength);
114 
115  return;
116 }
117 
120  uint8_t dayOfWeek, int32_t millis, UErrorCode& status) {
121  return ((VTimeZone*)zone)->VTimeZone::getOffset(era, year, month, day, dayOfWeek, millis, status);
122 }
123 
126  uint8_t dayOfWeek, int32_t millis,
127  int32_t monthLength, UErrorCode& status) {
128  return ((VTimeZone*)zone)->VTimeZone::getOffset(era, year, month, day, dayOfWeek, millis, monthLength, status);
129 }
130 
131 U_CAPI void U_EXPORT2
133  int32_t& dstOffset, UErrorCode& ec) {
134  return ((VTimeZone*)zone)->VTimeZone::getOffset(date, local, rawOffset, dstOffset, ec);
135 }
136 
137 U_CAPI void U_EXPORT2
139  return ((VTimeZone*)zone)->VTimeZone::setRawOffset(offsetMillis);
140 }
141 
144  return ((VTimeZone*)zone)->VTimeZone::getRawOffset();
145 }
146 
149  return ((VTimeZone*)zone)->VTimeZone::useDaylightTime();
150 }
151 
154  return ((VTimeZone*)zone)->VTimeZone::inDaylightTime(date, status);
155 }
156 
159  return ((VTimeZone*)zone)->VTimeZone::hasSameRules(*(VTimeZone*)other);
160 }
161 
164  return ((VTimeZone*)zone)->VTimeZone::getNextTransition(base, inclusive, *(TimeZoneTransition*)result);
165 }
166 
169  return ((VTimeZone*)zone)->VTimeZone::getPreviousTransition(base, inclusive, *(TimeZoneTransition*)result);
170 }
171 
174  return ((VTimeZone*)zone)->VTimeZone::countTransitionRules(status);
175 }
176 
177 U_CAPI UClassID U_EXPORT2
179  return ((VTimeZone*)zone)->VTimeZone::getStaticClassID();
180 }
181 
182 U_CAPI UClassID U_EXPORT2
184  return ((VTimeZone*)zone)->VTimeZone::getDynamicClassID();
185 }
186 
187 #endif
#define year
Definition: aptex-macros.h:808
#define day
Definition: aptex-macros.h:806
#define month
Definition: aptex-macros.h:807
#define ID
Definition: chkdvifont.c:76
#define b
Definition: jpegint.h:372
static void date(UDate when, const UChar *tz, UDateFormatStyle style, const char *format, const char *locale, UErrorCode *status)
Definition: date.c:253
#define s
Definition: afcover.h:80
int base
Definition: gsftopk.c:1502
#define ec
Definition: gsftopk.c:502
#define memcpy(d, s, n)
Definition: gsftopk.c:64
unsigned char UChar
Definition: bzip2.c:163
#define local
Definition: zutil.h:30
signed int int32_t
Definition: stdint.h:77
unsigned char uint8_t
Definition: stdint.h:78
#define U_EXPORT2
Definition: platform.h:844
@ other
Definition: mtxline.h:22
time_t time()
#define status
C API: Unicode string handling functions.
Definition: zic.c:110
int8_t UBool
Definition: umachine.h:269
#define U_CAPI
Definition: umachine.h:110
#define vzone_write
Definition: urename.h:1895
#define vzone_getOffset
Definition: urename.h:1880
#define vzone_getDynamicClassID
Definition: urename.h:1877
#define vzone_setTZURL
Definition: urename.h:1893
#define vzone_writeSimple
Definition: urename.h:1897
#define vzone_setLastModified
Definition: urename.h:1891
#define vzone_equals
Definition: urename.h:1876
#define vzone_getStaticClassID
Definition: urename.h:1885
#define vzone_close
Definition: urename.h:1874
#define vzone_openID
Definition: urename.h:1890
#define vzone_getOffset2
Definition: urename.h:1881
#define vzone_writeFromStart
Definition: urename.h:1896
#define vzone_getRawOffset
Definition: urename.h:1884
#define vzone_getLastModified
Definition: urename.h:1878
#define vzone_countTransitionRules
Definition: urename.h:1875
#define vzone_inDaylightTime
Definition: urename.h:1888
#define vzone_setRawOffset
Definition: urename.h:1892
#define vzone_getPreviousTransition
Definition: urename.h:1883
#define uprv_malloc
Definition: urename.h:1435
#define vzone_useDaylightTime
Definition: urename.h:1894
#define vzone_openData
Definition: urename.h:1889
#define vzone_getNextTransition
Definition: urename.h:1879
#define vzone_getOffset3
Definition: urename.h:1882
#define vzone_clone
Definition: urename.h:1873
#define vzone_hasSameRules
Definition: urename.h:1887
#define vzone_getTZURL
Definition: urename.h:1886
@ start
Definition: preamble.c:52
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Definition: utypes.h:431
double UDate
Definition: utypes.h:203
C API: RFC2445 VTIMEZONE support.
struct VZone VZone
Definition: vzone.h:33
struct ZTrans ZTrans
Definition: ztrans.h:30