Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
| 6 | |
| 7 #ifndef FPDFSDK_INCLUDE_CPDFSDK_DATETIME_H_ | |
| 8 #define FPDFSDK_INCLUDE_CPDFSDK_DATETIME_H_ | |
| 9 | |
| 10 #if _FX_OS_ == _FX_ANDROID_ | |
| 11 #include "time.h" | |
| 12 #else | |
| 13 #include <ctime> | |
| 14 #endif | |
| 15 | |
| 16 #include "fpdfsdk/cfx_systemhandler.h" | |
| 17 | |
| 18 class CPDFSDK_DateTime { | |
| 19 public: | |
| 20 CPDFSDK_DateTime(); | |
| 21 explicit CPDFSDK_DateTime(const CFX_ByteString& dtStr); | |
| 22 explicit CPDFSDK_DateTime(const FX_SYSTEMTIME& st); | |
| 23 CPDFSDK_DateTime(const CPDFSDK_DateTime& datetime); | |
| 24 | |
| 25 CPDFSDK_DateTime& operator=(const CPDFSDK_DateTime& datetime); | |
| 26 CPDFSDK_DateTime& operator=(const FX_SYSTEMTIME& st); | |
| 27 bool operator==(const CPDFSDK_DateTime& datetime) const; | |
| 28 bool operator!=(const CPDFSDK_DateTime& datetime) const; | |
| 29 | |
| 30 CPDFSDK_DateTime& FromPDFDateTimeString(const CFX_ByteString& dtStr); | |
| 31 CFX_ByteString ToCommonDateTimeString(); | |
| 32 CFX_ByteString ToPDFDateTimeString(); | |
| 33 void ToSystemTime(FX_SYSTEMTIME& st); | |
| 34 time_t ToTime_t() const; | |
| 35 CPDFSDK_DateTime ToGMT() const; | |
| 36 CPDFSDK_DateTime& AddDays(short days); | |
| 37 CPDFSDK_DateTime& AddSeconds(int seconds); | |
| 38 | |
| 39 void ResetDateTime(); | |
| 40 | |
| 41 struct FX_DATETIME { | |
| 42 int16_t year; | |
| 43 uint8_t month; | |
| 44 uint8_t day; | |
| 45 uint8_t hour; | |
| 46 uint8_t minute; | |
| 47 uint8_t second; | |
| 48 int8_t tzHour; | |
| 49 uint8_t tzMinute; | |
| 50 } dt; | |
|
dsinclair
2016/08/11 14:01:04
Can dt be made private?
jaepark
2016/08/11 18:09:50
Done.
| |
| 51 }; | |
| 52 | |
| 53 #endif // FPDFSDK_INCLUDE_CPDFSDK_DATETIME_H_ | |
| OLD | NEW |