Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: xfa/fgas/localization/fgas_datetime.h

Issue 1821043003: Remove FX_WORD in favor of uint16_t. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Use stdint.h directly, bitfield minefield. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fgas/layout/fgas_textbreak.cpp ('k') | xfa/fgas/localization/fgas_datetime.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef XFA_FGAS_LOCALIZATION_FGAS_DATETIME_H_ 7 #ifndef XFA_FGAS_LOCALIZATION_FGAS_DATETIME_H_
8 #define XFA_FGAS_LOCALIZATION_FGAS_DATETIME_H_ 8 #define XFA_FGAS_LOCALIZATION_FGAS_DATETIME_H_
9 9
10 #include "core/include/fxcrt/fx_system.h" 10 #include "core/include/fxcrt/fx_system.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return *this; 61 return *this;
62 } 62 }
63 void Now(); 63 void Now();
64 void SetGMTime(); 64 void SetGMTime();
65 void Set(int32_t year, 65 void Set(int32_t year,
66 uint8_t month, 66 uint8_t month,
67 uint8_t day, 67 uint8_t day,
68 uint8_t hour = 0, 68 uint8_t hour = 0,
69 uint8_t minute = 0, 69 uint8_t minute = 0,
70 uint8_t second = 0, 70 uint8_t second = 0,
71 FX_WORD millisecond = 0); 71 uint16_t millisecond = 0);
72 void Set(FX_UNITIME t); 72 void Set(FX_UNITIME t);
73 int32_t GetYear() const; 73 int32_t GetYear() const;
74 uint8_t GetMonth() const; 74 uint8_t GetMonth() const;
75 uint8_t GetDay() const; 75 uint8_t GetDay() const;
76 FX_WEEKDAY GetDayOfWeek() const; 76 FX_WEEKDAY GetDayOfWeek() const;
77 FX_WORD GetDayOfYear() const; 77 uint16_t GetDayOfYear() const;
78 int64_t GetDayOfAD() const; 78 int64_t GetDayOfAD() const;
79 uint8_t GetHour() const; 79 uint8_t GetHour() const;
80 uint8_t GetMinute() const; 80 uint8_t GetMinute() const;
81 uint8_t GetSecond() const; 81 uint8_t GetSecond() const;
82 FX_WORD GetMillisecond() const; 82 uint16_t GetMillisecond() const;
83 FX_BOOL AddYears(int32_t iYears); 83 FX_BOOL AddYears(int32_t iYears);
84 FX_BOOL AddMonths(int32_t iMonths); 84 FX_BOOL AddMonths(int32_t iMonths);
85 FX_BOOL AddDays(int32_t iDays); 85 FX_BOOL AddDays(int32_t iDays);
86 FX_BOOL AddHours(int32_t iHours); 86 FX_BOOL AddHours(int32_t iHours);
87 FX_BOOL AddMinutes(int32_t iMinutes); 87 FX_BOOL AddMinutes(int32_t iMinutes);
88 FX_BOOL AddSeconds(int32_t iSeconds); 88 FX_BOOL AddSeconds(int32_t iSeconds);
89 FX_BOOL AddMilliseconds(int32_t iMilliseconds); 89 FX_BOOL AddMilliseconds(int32_t iMilliseconds);
90 friend CFX_Unitime operator+(const CFX_Unitime& t1, const CFX_Unitime& t2) { 90 friend CFX_Unitime operator+(const CFX_Unitime& t1, const CFX_Unitime& t2) {
91 return CFX_Unitime(t1.m_iUnitime + t2.m_iUnitime); 91 return CFX_Unitime(t1.m_iUnitime + t2.m_iUnitime);
92 } 92 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 struct FX_DATE { 170 struct FX_DATE {
171 int32_t year; 171 int32_t year;
172 uint8_t month; 172 uint8_t month;
173 uint8_t day; 173 uint8_t day;
174 }; 174 };
175 175
176 struct FX_TIME { 176 struct FX_TIME {
177 uint8_t hour; 177 uint8_t hour;
178 uint8_t minute; 178 uint8_t minute;
179 uint8_t second; 179 uint8_t second;
180 FX_WORD millisecond; 180 uint16_t millisecond;
181 }; 181 };
182 182
183 struct FX_TIMEZONE { 183 struct FX_TIMEZONE {
184 int8_t tzHour; 184 int8_t tzHour;
185 uint8_t tzMinute; 185 uint8_t tzMinute;
186 }; 186 };
187 187
188 struct FX_DATETIME { 188 struct FX_DATETIME {
189 union { 189 union {
190 struct { 190 struct {
191 int32_t year; 191 int32_t year;
192 uint8_t month; 192 uint8_t month;
193 uint8_t day; 193 uint8_t day;
194 } sDate; 194 } sDate;
195 FX_DATE aDate; 195 FX_DATE aDate;
196 } Date; 196 } Date;
197 union { 197 union {
198 struct { 198 struct {
199 uint8_t hour; 199 uint8_t hour;
200 uint8_t minute; 200 uint8_t minute;
201 uint8_t second; 201 uint8_t second;
202 FX_WORD millisecond; 202 uint16_t millisecond;
203 } sTime; 203 } sTime;
204 FX_TIME aTime; 204 FX_TIME aTime;
205 } Time; 205 } Time;
206 }; 206 };
207 207
208 struct FX_DATETIMEZONE { 208 struct FX_DATETIMEZONE {
209 union { 209 union {
210 struct { 210 struct {
211 union { 211 union {
212 struct { 212 struct {
213 int32_t year; 213 int32_t year;
214 uint8_t month; 214 uint8_t month;
215 uint8_t day; 215 uint8_t day;
216 }; 216 };
217 FX_DATE date; 217 FX_DATE date;
218 }; 218 };
219 union { 219 union {
220 struct { 220 struct {
221 uint8_t hour; 221 uint8_t hour;
222 uint8_t minute; 222 uint8_t minute;
223 uint8_t second; 223 uint8_t second;
224 FX_WORD millisecond; 224 uint16_t millisecond;
225 }; 225 };
226 FX_TIME time; 226 FX_TIME time;
227 }; 227 };
228 }; 228 };
229 FX_DATETIME dt; 229 FX_DATETIME dt;
230 }; 230 };
231 union { 231 union {
232 struct { 232 struct {
233 int8_t tzHour; 233 int8_t tzHour;
234 uint8_t tzMinute; 234 uint8_t tzMinute;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 CFX_DateTime& operator-=(const FX_DATETIME& dt) { 273 CFX_DateTime& operator-=(const FX_DATETIME& dt) {
274 FromUnitime(ToUnitime() - ((const CFX_DateTime&)dt).ToUnitime()); 274 FromUnitime(ToUnitime() - ((const CFX_DateTime&)dt).ToUnitime());
275 return *this; 275 return *this;
276 } 276 }
277 virtual FX_BOOL Set(int32_t year, 277 virtual FX_BOOL Set(int32_t year,
278 uint8_t month, 278 uint8_t month,
279 uint8_t day, 279 uint8_t day,
280 uint8_t hour = 0, 280 uint8_t hour = 0,
281 uint8_t minute = 0, 281 uint8_t minute = 0,
282 uint8_t second = 0, 282 uint8_t second = 0,
283 FX_WORD millisecond = 0); 283 uint16_t millisecond = 0);
284 virtual FX_BOOL FromUnitime(FX_UNITIME t); 284 virtual FX_BOOL FromUnitime(FX_UNITIME t);
285 virtual FX_UNITIME ToUnitime() const; 285 virtual FX_UNITIME ToUnitime() const;
286 virtual int32_t GetYear() const; 286 virtual int32_t GetYear() const;
287 virtual uint8_t GetMonth() const; 287 virtual uint8_t GetMonth() const;
288 virtual uint8_t GetDay() const; 288 virtual uint8_t GetDay() const;
289 virtual FX_WEEKDAY GetDayOfWeek() const; 289 virtual FX_WEEKDAY GetDayOfWeek() const;
290 virtual FX_WORD GetDayOfYear() const; 290 virtual uint16_t GetDayOfYear() const;
291 virtual int64_t GetDayOfAD() const; 291 virtual int64_t GetDayOfAD() const;
292 virtual uint8_t GetHour() const; 292 virtual uint8_t GetHour() const;
293 virtual uint8_t GetMinute() const; 293 virtual uint8_t GetMinute() const;
294 virtual uint8_t GetSecond() const; 294 virtual uint8_t GetSecond() const;
295 virtual FX_WORD GetMillisecond() const; 295 virtual uint16_t GetMillisecond() const;
296 virtual FX_BOOL AddYears(int32_t iYears); 296 virtual FX_BOOL AddYears(int32_t iYears);
297 virtual FX_BOOL AddMonths(int32_t iMonths); 297 virtual FX_BOOL AddMonths(int32_t iMonths);
298 virtual FX_BOOL AddDays(int32_t iDays); 298 virtual FX_BOOL AddDays(int32_t iDays);
299 virtual FX_BOOL AddHours(int32_t iHours); 299 virtual FX_BOOL AddHours(int32_t iHours);
300 virtual FX_BOOL AddMinutes(int32_t iMinutes); 300 virtual FX_BOOL AddMinutes(int32_t iMinutes);
301 virtual FX_BOOL AddSeconds(int32_t iSeconds); 301 virtual FX_BOOL AddSeconds(int32_t iSeconds);
302 virtual FX_BOOL AddMilliseconds(int32_t iMilliseconds); 302 virtual FX_BOOL AddMilliseconds(int32_t iMilliseconds);
303 friend CFX_DateTime operator+(const CFX_DateTime& dt1, 303 friend CFX_DateTime operator+(const CFX_DateTime& dt1,
304 const CFX_DateTime& dt2) { 304 const CFX_DateTime& dt2) {
305 CFX_DateTime dt; 305 CFX_DateTime dt;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 397 }
398 friend FX_BOOL operator<=(const FX_DATETIME& dt1, const CFX_DateTime& dt2) { 398 friend FX_BOOL operator<=(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
399 return ((const CFX_DateTime&)dt1).ToUnitime() <= dt2.ToUnitime(); 399 return ((const CFX_DateTime&)dt1).ToUnitime() <= dt2.ToUnitime();
400 } 400 }
401 401
402 private: 402 private:
403 FX_DATETIME m_DateTime; 403 FX_DATETIME m_DateTime;
404 }; 404 };
405 405
406 #endif // XFA_FGAS_LOCALIZATION_FGAS_DATETIME_H_ 406 #endif // XFA_FGAS_LOCALIZATION_FGAS_DATETIME_H_
OLDNEW
« no previous file with comments | « xfa/fgas/layout/fgas_textbreak.cpp ('k') | xfa/fgas/localization/fgas_datetime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698