]> git.saurik.com Git - apple/security.git/blob - keychain/analytics/awd/AWDKeychainSOSKeychainBackupFailed.m
Security-58286.51.6.tar.gz
[apple/security.git] / keychain / analytics / awd / AWDKeychainSOSKeychainBackupFailed.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 "AWDKeychainSOSKeychainBackupFailed.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 AWDKeychainSOSKeychainBackupFailed
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
34 - (NSString *)description
35 {
36 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
37 }
38
39 - (NSDictionary *)dictionaryRepresentation
40 {
41 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
42 if (self->_has.timestamp)
43 {
44 [dict setObject:[NSNumber numberWithUnsignedLongLong:self->_timestamp] forKey:@"timestamp"];
45 }
46 return dict;
47 }
48
49 BOOL AWDKeychainSOSKeychainBackupFailedReadFrom(__unsafe_unretained AWDKeychainSOSKeychainBackupFailed *self, __unsafe_unretained PBDataReader *reader) {
50 while (PBReaderHasMoreData(reader)) {
51 uint32_t tag = 0;
52 uint8_t aType = 0;
53
54 PBReaderReadTag32AndType(reader, &tag, &aType);
55
56 if (PBReaderHasError(reader))
57 break;
58
59 if (aType == TYPE_END_GROUP) {
60 break;
61 }
62
63 switch (tag) {
64
65 case 1 /* timestamp */:
66 {
67 self->_has.timestamp = YES;
68 self->_timestamp = PBReaderReadUint64(reader);
69 }
70 break;
71 default:
72 if (!PBReaderSkipValueWithTag(reader, tag, aType))
73 return NO;
74 break;
75 }
76 }
77 return !PBReaderHasError(reader);
78 }
79
80 - (BOOL)readFrom:(PBDataReader *)reader
81 {
82 return AWDKeychainSOSKeychainBackupFailedReadFrom(self, reader);
83 }
84 - (void)writeTo:(PBDataWriter *)writer
85 {
86 /* timestamp */
87 {
88 if (self->_has.timestamp)
89 {
90 PBDataWriterWriteUint64Field(writer, self->_timestamp, 1);
91 }
92 }
93 }
94
95 - (void)copyTo:(AWDKeychainSOSKeychainBackupFailed *)other
96 {
97 if (self->_has.timestamp)
98 {
99 other->_timestamp = _timestamp;
100 other->_has.timestamp = YES;
101 }
102 }
103
104 - (id)copyWithZone:(NSZone *)zone
105 {
106 AWDKeychainSOSKeychainBackupFailed *copy = [[[self class] allocWithZone:zone] init];
107 if (self->_has.timestamp)
108 {
109 copy->_timestamp = _timestamp;
110 copy->_has.timestamp = YES;
111 }
112 return copy;
113 }
114
115 - (BOOL)isEqual:(id)object
116 {
117 AWDKeychainSOSKeychainBackupFailed *other = (AWDKeychainSOSKeychainBackupFailed *)object;
118 return [other isMemberOfClass:[self class]]
119 &&
120 ((self->_has.timestamp && other->_has.timestamp && self->_timestamp == other->_timestamp) || (!self->_has.timestamp && !other->_has.timestamp))
121 ;
122 }
123
124 - (NSUInteger)hash
125 {
126 return 0
127 ^
128 (self->_has.timestamp ? PBHashInt((NSUInteger)self->_timestamp) : 0)
129 ;
130 }
131
132 - (void)mergeFrom:(AWDKeychainSOSKeychainBackupFailed *)other
133 {
134 if (other->_has.timestamp)
135 {
136 self->_timestamp = other->_timestamp;
137 self->_has.timestamp = YES;
138 }
139 }
140
141 @end
142 #endif