]> git.saurik.com Git - apple/security.git/blob - keychain/analytics/awd/AWDKeychainSecDbMarkedCorrupt.m
Security-58286.1.32.tar.gz
[apple/security.git] / keychain / analytics / awd / AWDKeychainSecDbMarkedCorrupt.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from stdin
4
5 #import <TargetConditionals.h>
6 #if !TARGET_OS_BRIDGE
7
8 #import "AWDKeychainSecDbMarkedCorrupt.h"
9 #import <ProtocolBuffer/PBConstants.h>
10 #import <ProtocolBuffer/PBHashUtil.h>
11 #import <ProtocolBuffer/PBDataReader.h>
12
13 #if !__has_feature(objc_arc)
14 # error This generated file depends on ARC but it is not enabled; turn on ARC, or use 'objc_use_arc' option to generate non-ARC code.
15 #endif
16
17 @implementation AWDKeychainSecDbMarkedCorrupt
18
19 @synthesize timestamp = _timestamp;
20 - (void)setTimestamp:(uint64_t)v
21 {
22 _has.timestamp = YES;
23 _timestamp = v;
24 }
25 - (void)setHasTimestamp:(BOOL)f
26 {
27 _has.timestamp = f;
28 }
29 - (BOOL)hasTimestamp
30 {
31 return _has.timestamp;
32 }
33 @synthesize reason = _reason;
34 - (void)setReason:(uint32_t)v
35 {
36 _has.reason = YES;
37 _reason = v;
38 }
39 - (void)setHasReason:(BOOL)f
40 {
41 _has.reason = f;
42 }
43 - (BOOL)hasReason
44 {
45 return _has.reason;
46 }
47 @synthesize sqlitecode = _sqlitecode;
48 - (void)setSqlitecode:(uint32_t)v
49 {
50 _has.sqlitecode = YES;
51 _sqlitecode = v;
52 }
53 - (void)setHasSqlitecode:(BOOL)f
54 {
55 _has.sqlitecode = f;
56 }
57 - (BOOL)hasSqlitecode
58 {
59 return _has.sqlitecode;
60 }
61
62 - (NSString *)description
63 {
64 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
65 }
66
67 - (NSDictionary *)dictionaryRepresentation
68 {
69 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
70 if (self->_has.timestamp)
71 {
72 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_timestamp] forKey:@"timestamp"];
73 }
74 if (self->_has.reason)
75 {
76 [dict setObject:[NSNumber numberWithUnsignedInt:self->_reason] forKey:@"reason"];
77 }
78 if (self->_has.sqlitecode)
79 {
80 [dict setObject:[NSNumber numberWithUnsignedInt:self->_sqlitecode] forKey:@"sqlitecode"];
81 }
82 return dict;
83 }
84
85 BOOL AWDKeychainSecDbMarkedCorruptReadFrom(__unsafe_unretained AWDKeychainSecDbMarkedCorrupt *self, __unsafe_unretained PBDataReader *reader) {
86 while (PBReaderHasMoreData(reader)) {
87 uint32_t tag = 0;
88 uint8_t aType = 0;
89
90 PBReaderReadTag32AndType(reader, &tag, &aType);
91
92 if (PBReaderHasError(reader))
93 break;
94
95 if (aType == TYPE_END_GROUP) {
96 break;
97 }
98
99 switch (tag) {
100
101 case 1 /* timestamp */:
102 {
103 self->_has.timestamp = YES;
104 self->_timestamp = PBReaderReadUint64(reader);
105 }
106 break;
107 case 2 /* reason */:
108 {
109 self->_has.reason = YES;
110 self->_reason = PBReaderReadUint32(reader);
111 }
112 break;
113 case 3 /* sqlitecode */:
114 {
115 self->_has.sqlitecode = YES;
116 self->_sqlitecode = PBReaderReadUint32(reader);
117 }
118 break;
119 default:
120 if (!PBReaderSkipValueWithTag(reader, tag, aType))
121 return NO;
122 break;
123 }
124 }
125 return !PBReaderHasError(reader);
126 }
127
128 - (BOOL)readFrom:(PBDataReader *)reader
129 {
130 return AWDKeychainSecDbMarkedCorruptReadFrom(self, reader);
131 }
132 - (void)writeTo:(PBDataWriter *)writer
133 {
134 /* timestamp */
135 {
136 if (self->_has.timestamp)
137 {
138 PBDataWriterWriteUint64Field(writer, self->_timestamp, 1);
139 }
140 }
141 /* reason */
142 {
143 if (self->_has.reason)
144 {
145 PBDataWriterWriteUint32Field(writer, self->_reason, 2);
146 }
147 }
148 /* sqlitecode */
149 {
150 if (self->_has.sqlitecode)
151 {
152 PBDataWriterWriteUint32Field(writer, self->_sqlitecode, 3);
153 }
154 }
155 }
156
157 - (void)copyTo:(AWDKeychainSecDbMarkedCorrupt *)other
158 {
159 if (self->_has.timestamp)
160 {
161 other->_timestamp = _timestamp;
162 other->_has.timestamp = YES;
163 }
164 if (self->_has.reason)
165 {
166 other->_reason = _reason;
167 other->_has.reason = YES;
168 }
169 if (self->_has.sqlitecode)
170 {
171 other->_sqlitecode = _sqlitecode;
172 other->_has.sqlitecode = YES;
173 }
174 }
175
176 - (id)copyWithZone:(NSZone *)zone
177 {
178 AWDKeychainSecDbMarkedCorrupt *copy = [[[self class] allocWithZone:zone] init];
179 if (self->_has.timestamp)
180 {
181 copy->_timestamp = _timestamp;
182 copy->_has.timestamp = YES;
183 }
184 if (self->_has.reason)
185 {
186 copy->_reason = _reason;
187 copy->_has.reason = YES;
188 }
189 if (self->_has.sqlitecode)
190 {
191 copy->_sqlitecode = _sqlitecode;
192 copy->_has.sqlitecode = YES;
193 }
194 return copy;
195 }
196
197 - (BOOL)isEqual:(id)object
198 {
199 AWDKeychainSecDbMarkedCorrupt *other = (AWDKeychainSecDbMarkedCorrupt *)object;
200 return [other isMemberOfClass:[self class]]
201 &&
202 ((self->_has.timestamp && other->_has.timestamp && self->_timestamp == other->_timestamp) || (!self->_has.timestamp && !other->_has.timestamp))
203 &&
204 ((self->_has.reason && other->_has.reason && self->_reason == other->_reason) || (!self->_has.reason && !other->_has.reason))
205 &&
206 ((self->_has.sqlitecode && other->_has.sqlitecode && self->_sqlitecode == other->_sqlitecode) || (!self->_has.sqlitecode && !other->_has.sqlitecode))
207 ;
208 }
209
210 - (NSUInteger)hash
211 {
212 return 0
213 ^
214 (self->_has.timestamp ? PBHashInt((NSUInteger)self->_timestamp) : 0)
215 ^
216 (self->_has.reason ? PBHashInt((NSUInteger)self->_reason) : 0)
217 ^
218 (self->_has.sqlitecode ? PBHashInt((NSUInteger)self->_sqlitecode) : 0)
219 ;
220 }
221
222 - (void)mergeFrom:(AWDKeychainSecDbMarkedCorrupt *)other
223 {
224 if (other->_has.timestamp)
225 {
226 self->_timestamp = other->_timestamp;
227 self->_has.timestamp = YES;
228 }
229 if (other->_has.reason)
230 {
231 self->_reason = other->_reason;
232 self->_has.reason = YES;
233 }
234 if (other->_has.sqlitecode)
235 {
236 self->_sqlitecode = other->_sqlitecode;
237 self->_has.sqlitecode = YES;
238 }
239 }
240
241 @end
242 #endif