]> git.saurik.com Git - apple/security.git/blob - keychain/ot/proto/generated_source/OTSupportSOSMessage.m
Security-59754.80.3.tar.gz
[apple/security.git] / keychain / ot / proto / generated_source / OTSupportSOSMessage.m
1 // This file was automatically generated by protocompiler
2 // DO NOT EDIT!
3 // Compiled from OTPairingMessage.proto
4
5 #import "OTSupportSOSMessage.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
9
10 #if !__has_feature(objc_arc)
11 # 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.
12 #endif
13
14 @implementation OTSupportSOSMessage
15
16 @synthesize supported = _supported;
17 - (OTSupportType)supported
18 {
19 return _has.supported ? _supported : OTSupportType_unknown;
20 }
21 - (void)setSupported:(OTSupportType)v
22 {
23 _has.supported = YES;
24 _supported = v;
25 }
26 - (void)setHasSupported:(BOOL)f
27 {
28 _has.supported = f;
29 }
30 - (BOOL)hasSupported
31 {
32 return _has.supported != 0;
33 }
34 - (NSString *)supportedAsString:(OTSupportType)value
35 {
36 return OTSupportTypeAsString(value);
37 }
38 - (OTSupportType)StringAsSupported:(NSString *)str
39 {
40 return StringAsOTSupportType(str);
41 }
42
43 - (NSString *)description
44 {
45 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
46 }
47
48 - (NSDictionary *)dictionaryRepresentation
49 {
50 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
51 if (self->_has.supported)
52 {
53 [dict setObject:OTSupportTypeAsString(self->_supported) forKey:@"supported"];
54 }
55 return dict;
56 }
57
58 BOOL OTSupportSOSMessageReadFrom(__unsafe_unretained OTSupportSOSMessage *self, __unsafe_unretained PBDataReader *reader) {
59 while (PBReaderHasMoreData(reader)) {
60 uint32_t tag = 0;
61 uint8_t aType = 0;
62
63 PBReaderReadTag32AndType(reader, &tag, &aType);
64
65 if (PBReaderHasError(reader))
66 break;
67
68 if (aType == TYPE_END_GROUP) {
69 break;
70 }
71
72 switch (tag) {
73
74 case 1 /* supported */:
75 {
76 self->_has.supported = YES;
77 self->_supported = PBReaderReadInt32(reader);
78 }
79 break;
80 default:
81 if (!PBReaderSkipValueWithTag(reader, tag, aType))
82 return NO;
83 break;
84 }
85 }
86 return !PBReaderHasError(reader);
87 }
88
89 - (BOOL)readFrom:(PBDataReader *)reader
90 {
91 return OTSupportSOSMessageReadFrom(self, reader);
92 }
93 - (void)writeTo:(PBDataWriter *)writer
94 {
95 /* supported */
96 {
97 if (self->_has.supported)
98 {
99 PBDataWriterWriteInt32Field(writer, self->_supported, 1);
100 }
101 }
102 }
103
104 - (void)copyTo:(OTSupportSOSMessage *)other
105 {
106 if (self->_has.supported)
107 {
108 other->_supported = _supported;
109 other->_has.supported = YES;
110 }
111 }
112
113 - (id)copyWithZone:(NSZone *)zone
114 {
115 OTSupportSOSMessage *copy = [[[self class] allocWithZone:zone] init];
116 if (self->_has.supported)
117 {
118 copy->_supported = _supported;
119 copy->_has.supported = YES;
120 }
121 return copy;
122 }
123
124 - (BOOL)isEqual:(id)object
125 {
126 OTSupportSOSMessage *other = (OTSupportSOSMessage *)object;
127 return [other isMemberOfClass:[self class]]
128 &&
129 ((self->_has.supported && other->_has.supported && self->_supported == other->_supported) || (!self->_has.supported && !other->_has.supported))
130 ;
131 }
132
133 - (NSUInteger)hash
134 {
135 return 0
136 ^
137 (self->_has.supported ? PBHashInt((NSUInteger)self->_supported) : 0)
138 ;
139 }
140
141 - (void)mergeFrom:(OTSupportSOSMessage *)other
142 {
143 if (other->_has.supported)
144 {
145 self->_supported = other->_supported;
146 self->_has.supported = YES;
147 }
148 }
149
150 @end
151