Differences From Artifact [728f213f2d]:
- File
src/OFDate.h
— part of check-in
[2f4e0df8be]
at
2017-10-17 00:33:37
on branch trunk
— Do not use implicit method return types
Instead, explicitly declare them, as OF_ASSUME_NONNULL_{BEGIN,END} does
not apply to implicit return types. This means that after this commit,
all init methods have a nonnull return type, as they should have. (user: js, size: 9465) [annotate] [blame] [check-ins using]
To Artifact [c8a7ef20f0]:
- File
src/OFDate.h
— part of check-in
[f3ccf14461]
at
2017-10-29 21:58:14
on branch trunk
— Convert methods to properties where appropriate
This improves Swift compatibility. (user: js, size: 8851) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
28 29 30 31 32 33 34 35 36 37 38 39 40 41 | * @brief A class for storing, accessing and comparing dates. */ @interface OFDate: OFObject <OFCopying, OFComparing, OFSerialization> { of_time_interval_t _seconds; } /*! * @brief Creates a new OFDate with the current date and time. * * @return A new, autoreleased OFDate with the current date and time */ + (instancetype)date; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | * @brief A class for storing, accessing and comparing dates. */ @interface OFDate: OFObject <OFCopying, OFComparing, OFSerialization> { of_time_interval_t _seconds; } /*! * The microsecond of the date. */ @property (readonly, nonatomic) uint32_t microsecond; /*! * The second of the date. */ @property (readonly, nonatomic) uint8_t second; /*! * The minute of the date. */ @property (readonly, nonatomic) uint8_t minute; /*! * The minute of the date in local time. */ @property (readonly, nonatomic) uint8_t localMinute; /*! * The hour of the date. */ @property (readonly, nonatomic) uint8_t hour; /*! * The hour of the date in local time. */ @property (readonly, nonatomic) uint8_t localHour; /*! * The day of the month of the date. */ @property (readonly, nonatomic) uint8_t dayOfMonth; /*! * The day of the month of the date in local time. */ @property (readonly, nonatomic) uint8_t localDayOfMonth; /*! * The month of the year of the date. */ @property (readonly, nonatomic) uint8_t monthOfYear; /*! * The month of the year of the date in local time. */ @property (readonly, nonatomic) uint8_t localMonthOfYear; /*! * The year of the date. */ @property (readonly, nonatomic) uint16_t year; /*! * The year of the date in local time. */ @property (readonly, nonatomic) uint16_t localYear; /*! * The day of the week of the date. */ @property (readonly, nonatomic) uint8_t dayOfWeek; /*! * The day of the week of the date in local time. */ @property (readonly, nonatomic) uint8_t localDayOfWeek; /*! * The day of the year of the date. */ @property (readonly, nonatomic) uint16_t dayOfYear; /*! * The day of the year of the date in local time. */ @property (readonly, nonatomic) uint16_t localDayOfYear; /*! * The seconds since 1970-01-01T00:00:00Z. */ @property (readonly, nonatomic) of_time_interval_t timeIntervalSince1970; /*! * The seconds the date is in the future. */ @property (readonly, nonatomic) of_time_interval_t timeIntervalSinceNow; /*! * @brief Creates a new OFDate with the current date and time. * * @return A new, autoreleased OFDate with the current date and time */ + (instancetype)date; |
︙ | ︙ | |||
163 164 165 166 167 168 169 | * @param string The string describing the date * @param format The format of the string describing the date * @return An initialized OFDate with the specified date and time */ - (instancetype)initWithLocalDateString: (OFString *)string format: (OFString *)format; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | * @param string The string describing the date * @param format The format of the string describing the date * @return An initialized OFDate with the specified date and time */ - (instancetype)initWithLocalDateString: (OFString *)string format: (OFString *)format; /*! * @brief Creates a string of the date with the specified format. * * See the man page for `strftime` for information on the format. * * @param format The format for the date string * @return A new, autoreleased OFString |
︙ | ︙ | |||
315 316 317 318 319 320 321 | * If the argument is `nil`, it returns the receiver. * * @param otherDate Another date * @return The later date of the two dates */ - (OFDate *)laterDate: (nullable OFDate *)otherDate; | < < < < < < < < < < < < < < | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | * If the argument is `nil`, it returns the receiver. * * @param otherDate Another date * @return The later date of the two dates */ - (OFDate *)laterDate: (nullable OFDate *)otherDate; /*! * @brief Returns the seconds the receiver is after the date. * * @param otherDate Date date to generate the difference with receiver * @return The seconds the receiver is after the date. */ - (of_time_interval_t)timeIntervalSinceDate: (OFDate *)otherDate; /*! * @brief Creates a new date with the specified time interval added. * * @param seconds The seconds after the date * @return A new, autoreleased OFDate */ - (OFDate *)dateByAddingTimeInterval: (of_time_interval_t)seconds; @end OF_ASSUME_NONNULL_END |