1 // This file was automatically generated by protocompiler
3 // Compiled from SecDbBackupRecoverySet.proto
5 #import "SecDbBackupBagIdentity.h"
6 #import <ProtocolBuffer/PBConstants.h>
7 #import <ProtocolBuffer/PBHashUtil.h>
8 #import <ProtocolBuffer/PBDataReader.h>
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.
14 @implementation SecDbBackupBagIdentity
18 return _baguuid != nil;
20 @synthesize baguuid = _baguuid;
23 return _baghash != nil;
25 @synthesize baghash = _baghash;
27 - (NSString *)description
29 return [NSString stringWithFormat:@"%@ %@", [super description], [self dictionaryRepresentation]];
32 - (NSDictionary *)dictionaryRepresentation
34 NSMutableDictionary *dict = [NSMutableDictionary dictionary];
37 [dict setObject:self->_baguuid forKey:@"baguuid"];
41 [dict setObject:self->_baghash forKey:@"baghash"];
46 BOOL SecDbBackupBagIdentityReadFrom(__unsafe_unretained SecDbBackupBagIdentity *self, __unsafe_unretained PBDataReader *reader) {
47 while (PBReaderHasMoreData(reader)) {
51 PBReaderReadTag32AndType(reader, &tag, &aType);
53 if (PBReaderHasError(reader))
56 if (aType == TYPE_END_GROUP) {
64 NSData *new_baguuid = PBReaderReadData(reader);
65 self->_baguuid = new_baguuid;
70 NSData *new_baghash = PBReaderReadData(reader);
71 self->_baghash = new_baghash;
75 if (!PBReaderSkipValueWithTag(reader, tag, aType))
80 return !PBReaderHasError(reader);
83 - (BOOL)readFrom:(PBDataReader *)reader
85 return SecDbBackupBagIdentityReadFrom(self, reader);
87 - (void)writeTo:(PBDataWriter *)writer
93 PBDataWriterWriteDataField(writer, self->_baguuid, 1);
100 PBDataWriterWriteDataField(writer, self->_baghash, 2);
105 - (void)copyTo:(SecDbBackupBagIdentity *)other
109 other.baguuid = _baguuid;
113 other.baghash = _baghash;
117 - (id)copyWithZone:(NSZone *)zone
119 SecDbBackupBagIdentity *copy = [[[self class] allocWithZone:zone] init];
120 copy->_baguuid = [_baguuid copyWithZone:zone];
121 copy->_baghash = [_baghash copyWithZone:zone];
125 - (BOOL)isEqual:(id)object
127 SecDbBackupBagIdentity *other = (SecDbBackupBagIdentity *)object;
128 return [other isMemberOfClass:[self class]]
130 ((!self->_baguuid && !other->_baguuid) || [self->_baguuid isEqual:other->_baguuid])
132 ((!self->_baghash && !other->_baghash) || [self->_baghash isEqual:other->_baghash])
140 [self->_baguuid hash]
142 [self->_baghash hash]
146 - (void)mergeFrom:(SecDbBackupBagIdentity *)other
150 [self setBaguuid:other->_baguuid];
154 [self setBaghash:other->_baghash];