blob: c5a45214ad13f419b205bd3ce04d24c3665ab17b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
132
133
134
135
136
137
138
139
140
141
142
|
// SDLDateTime.m
//
#import "SDLDateTime.h"
#import "NSMutableDictionary+Store.h"
#import "SDLRPCParameterNames.h"
@implementation SDLDateTime
- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute {
self = [self init];
if (!self) {
return nil;
}
self.hour = @(hour);
self.minute = @(minute);
return self;
}
- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute second:(UInt8)second millisecond:(UInt16)millisecond {
self = [self initWithHour:hour minute:minute];
if (!self) {
return nil;
}
self.second = @(second);
self.millisecond = @(millisecond);
return self;
}
- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute second:(UInt8)second millisecond:(UInt16)millisecond day:(UInt8)day month:(UInt8)month year:(UInt16)year {
self = [self initWithHour:hour minute:minute second:second millisecond:millisecond];
if (!self) {
return nil;
}
self.day = @(day);
self.month = @(month);
self.year = @(year);
return self;
}
- (instancetype)initWithHour:(UInt8)hour minute:(UInt8)minute second:(UInt8)second millisecond:(UInt16)millisecond day:(UInt8)day month:(UInt8)month year:(UInt16)year timezoneMinuteOffset:(UInt8)timezoneMinuteOffset timezoneHourOffset:(int)timezoneHourOffset {
self = [self initWithHour:hour minute:minute second:second millisecond:millisecond day:day month:month year:year];
if (!self) {
return nil;
}
self.timezoneMinuteOffset = @(timezoneMinuteOffset);
self.timezoneHourOffset = @(timezoneHourOffset);
return self;
}
- (void)setMillisecond:(NSNumber<SDLInt> *)millisecond {
[self.store sdl_setObject:millisecond forName:SDLRPCParameterNameMillisecond];
}
- (NSNumber<SDLInt> *)millisecond {
NSError *error = nil;
return [self.store sdl_objectForName:SDLRPCParameterNameMillisecond ofClass:NSNumber.class error:&error];
}
- (void)setSecond:(NSNumber<SDLInt> *)second {
[self.store sdl_setObject:second forName:SDLRPCParameterNameSecond];
}
- (NSNumber<SDLInt> *)second {
NSError *error = nil;
return [self.store sdl_objectForName:SDLRPCParameterNameSecond ofClass:NSNumber.class error:&error];
}
- (void)setMinute:(NSNumber<SDLInt> *)minute {
[self.store sdl_setObject:minute forName:SDLRPCParameterNameMinute];
}
- (NSNumber<SDLInt> *)minute {
NSError *error = nil;
return [self.store sdl_objectForName:SDLRPCParameterNameMinute ofClass:NSNumber.class error:&error];
}
- (void)setHour:(NSNumber<SDLInt> *)hour {
[self.store sdl_setObject:hour forName:SDLRPCParameterNameHour];
}
- (NSNumber<SDLInt> *)hour {
NSError *error = nil;
return [self.store sdl_objectForName:SDLRPCParameterNameHour ofClass:NSNumber.class error:&error];
}
- (void)setDay:(NSNumber<SDLInt> *)day {
[self.store sdl_setObject:day forName:SDLRPCParameterNameDay];
}
- (NSNumber<SDLInt> *)day {
NSError *error = nil;
return [self.store sdl_objectForName:SDLRPCParameterNameDay ofClass:NSNumber.class error:&error];
}
- (void)setMonth:(NSNumber<SDLInt> *)month {
[self.store sdl_setObject:month forName:SDLRPCParameterNameMonth];
}
- (NSNumber<SDLInt> *)month {
NSError *error = nil;
return [self.store sdl_objectForName:SDLRPCParameterNameMonth ofClass:NSNumber.class error:&error];
}
- (void)setYear:(NSNumber<SDLInt> *)year {
[self.store sdl_setObject:year forName:SDLRPCParameterNameYear];
}
- (NSNumber<SDLInt> *)year {
NSError *error = nil;
return [self.store sdl_objectForName:SDLRPCParameterNameYear ofClass:NSNumber.class error:&error];
}
- (void)setTimezoneMinuteOffset:(NSNumber<SDLInt> *)timezoneMinuteOffset {
[self.store sdl_setObject:timezoneMinuteOffset forName:SDLRPCParameterNameTimezoneMinuteOffset];
}
- (NSNumber<SDLInt> *)timezoneMinuteOffset {
NSError *error = nil;
return [self.store sdl_objectForName:SDLRPCParameterNameTimezoneMinuteOffset ofClass:NSNumber.class error:&error];
}
- (void)setTimezoneHourOffset:(NSNumber<SDLInt> *)timezoneHourOffset {
[self.store sdl_setObject:timezoneHourOffset forName:SDLRPCParameterNameTimezoneHourOffset];
}
- (NSNumber<SDLInt> *)timezoneHourOffset {
NSError *error = nil;
return [self.store sdl_objectForName:SDLRPCParameterNameTimezoneHourOffset ofClass:NSNumber.class error:&error];
}
@end
|