OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkTime_DEFINED | 10 #ifndef SkTime_DEFINED |
11 #define SkTime_DEFINED | 11 #define SkTime_DEFINED |
12 | 12 |
13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
14 | 14 |
| 15 class SkString; |
| 16 |
15 /** \class SkTime | 17 /** \class SkTime |
16 Platform-implemented utilities to return time of day, and millisecond counte
r. | 18 Platform-implemented utilities to return time of day, and millisecond counte
r. |
17 */ | 19 */ |
18 class SkTime { | 20 class SkTime { |
19 public: | 21 public: |
20 struct DateTime { | 22 struct DateTime { |
| 23 int16_t fTimeZoneMinutes; // The number of minutes that GetDateTime() |
| 24 // is ahead of or behind UTC. |
21 uint16_t fYear; //!< e.g. 2005 | 25 uint16_t fYear; //!< e.g. 2005 |
22 uint8_t fMonth; //!< 1..12 | 26 uint8_t fMonth; //!< 1..12 |
23 uint8_t fDayOfWeek; //!< 0..6, 0==Sunday | 27 uint8_t fDayOfWeek; //!< 0..6, 0==Sunday |
24 uint8_t fDay; //!< 1..31 | 28 uint8_t fDay; //!< 1..31 |
25 uint8_t fHour; //!< 0..23 | 29 uint8_t fHour; //!< 0..23 |
26 uint8_t fMinute; //!< 0..59 | 30 uint8_t fMinute; //!< 0..59 |
27 uint8_t fSecond; //!< 0..59 | 31 uint8_t fSecond; //!< 0..59 |
| 32 |
| 33 void toISO8601(SkString* dst) const; |
28 }; | 34 }; |
29 static void GetDateTime(DateTime*); | 35 static void GetDateTime(DateTime*); |
30 | 36 |
31 static SkMSec GetMSecs(); | 37 static SkMSec GetMSecs(); |
32 }; | 38 }; |
33 | 39 |
34 #if defined(SK_DEBUG) && defined(SK_BUILD_FOR_WIN32) | 40 #if defined(SK_DEBUG) && defined(SK_BUILD_FOR_WIN32) |
35 extern SkMSec gForceTickCount; | 41 extern SkMSec gForceTickCount; |
36 #endif | 42 #endif |
37 | 43 |
(...skipping 18 matching lines...) Expand all Loading... |
56 } | 62 } |
57 } | 63 } |
58 private: | 64 private: |
59 const char* fLabel; | 65 const char* fLabel; |
60 SkMSec fNow; | 66 SkMSec fNow; |
61 SkMSec fMinToDump; | 67 SkMSec fMinToDump; |
62 }; | 68 }; |
63 #define SkAutoTime(...) SK_REQUIRE_LOCAL_VAR(SkAutoTime) | 69 #define SkAutoTime(...) SK_REQUIRE_LOCAL_VAR(SkAutoTime) |
64 | 70 |
65 #endif | 71 #endif |
OLD | NEW |