ADD: added new version of protobuf

This commit is contained in:
Henry Winkel
2022-12-20 10:09:28 +01:00
parent 4a79559129
commit 1e2b3dda7b
1513 changed files with 123720 additions and 83381 deletions

View File

@@ -47,9 +47,6 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
return (value != kGPBUnrecognizedEnumeratorValue);
}
// Disable clang-format for the macros.
// clang-format off
//%PDDM-DEFINE VALIDATE_RANGE(INDEX, COUNT)
//% if (INDEX >= COUNT) {
//% [NSException raise:NSRangeException
@@ -197,12 +194,12 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
//% return result;
//%}
//%
//%- (void)enumerate##ACCESSOR_NAME##ValuesWithBlock:(void(NS_NOESCAPE ^)(TYPE value, NSUInteger idx, BOOL *stop))block {
//%- (void)enumerate##ACCESSOR_NAME##ValuesWithBlock:(void (NS_NOESCAPE ^)(TYPE value, NSUInteger idx, BOOL *stop))block {
//% [self enumerate##ACCESSOR_NAME##ValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block];
//%}
//%
//%- (void)enumerate##ACCESSOR_NAME##ValuesWithOptions:(NSEnumerationOptions)opts
//% ACCESSOR_NAME$S usingBlock:(void(NS_NOESCAPE ^)(TYPE value, NSUInteger idx, BOOL *stop))block {
//% ACCESSOR_NAME$S usingBlock:(void (NS_NOESCAPE ^)(TYPE value, NSUInteger idx, BOOL *stop))block {
//% // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok).
//% BOOL stop = NO;
//% if ((opts & NSEnumerationReverse) == 0) {
@@ -295,8 +292,10 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
//% _values[idx2] = temp;
//%}
//%
//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(Int32, int32_t, %d)
// This block of code is generated, do not edit it directly.
// clang-format off
#pragma mark - Int32
@@ -407,12 +406,12 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
return result;
}
- (void)enumerateValuesWithBlock:(void(NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block {
- (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block {
[self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block];
}
- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
usingBlock:(void(NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block {
usingBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block {
// NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok).
BOOL stop = NO;
if ((opts & NSEnumerationReverse) == 0) {
@@ -543,8 +542,10 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
@end
// clang-format on
//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(UInt32, uint32_t, %u)
// This block of code is generated, do not edit it directly.
// clang-format off
#pragma mark - UInt32
@@ -655,12 +656,12 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
return result;
}
- (void)enumerateValuesWithBlock:(void(NS_NOESCAPE ^)(uint32_t value, NSUInteger idx, BOOL *stop))block {
- (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(uint32_t value, NSUInteger idx, BOOL *stop))block {
[self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block];
}
- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
usingBlock:(void(NS_NOESCAPE ^)(uint32_t value, NSUInteger idx, BOOL *stop))block {
usingBlock:(void (NS_NOESCAPE ^)(uint32_t value, NSUInteger idx, BOOL *stop))block {
// NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok).
BOOL stop = NO;
if ((opts & NSEnumerationReverse) == 0) {
@@ -791,8 +792,10 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
@end
// clang-format on
//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(Int64, int64_t, %lld)
// This block of code is generated, do not edit it directly.
// clang-format off
#pragma mark - Int64
@@ -903,12 +906,12 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
return result;
}
- (void)enumerateValuesWithBlock:(void(NS_NOESCAPE ^)(int64_t value, NSUInteger idx, BOOL *stop))block {
- (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(int64_t value, NSUInteger idx, BOOL *stop))block {
[self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block];
}
- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
usingBlock:(void(NS_NOESCAPE ^)(int64_t value, NSUInteger idx, BOOL *stop))block {
usingBlock:(void (NS_NOESCAPE ^)(int64_t value, NSUInteger idx, BOOL *stop))block {
// NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok).
BOOL stop = NO;
if ((opts & NSEnumerationReverse) == 0) {
@@ -1039,8 +1042,10 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
@end
// clang-format on
//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(UInt64, uint64_t, %llu)
// This block of code is generated, do not edit it directly.
// clang-format off
#pragma mark - UInt64
@@ -1151,12 +1156,12 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
return result;
}
- (void)enumerateValuesWithBlock:(void(NS_NOESCAPE ^)(uint64_t value, NSUInteger idx, BOOL *stop))block {
- (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(uint64_t value, NSUInteger idx, BOOL *stop))block {
[self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block];
}
- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
usingBlock:(void(NS_NOESCAPE ^)(uint64_t value, NSUInteger idx, BOOL *stop))block {
usingBlock:(void (NS_NOESCAPE ^)(uint64_t value, NSUInteger idx, BOOL *stop))block {
// NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok).
BOOL stop = NO;
if ((opts & NSEnumerationReverse) == 0) {
@@ -1287,8 +1292,10 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
@end
// clang-format on
//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(Float, float, %f)
// This block of code is generated, do not edit it directly.
// clang-format off
#pragma mark - Float
@@ -1399,12 +1406,12 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
return result;
}
- (void)enumerateValuesWithBlock:(void(NS_NOESCAPE ^)(float value, NSUInteger idx, BOOL *stop))block {
- (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(float value, NSUInteger idx, BOOL *stop))block {
[self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block];
}
- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
usingBlock:(void(NS_NOESCAPE ^)(float value, NSUInteger idx, BOOL *stop))block {
usingBlock:(void (NS_NOESCAPE ^)(float value, NSUInteger idx, BOOL *stop))block {
// NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok).
BOOL stop = NO;
if ((opts & NSEnumerationReverse) == 0) {
@@ -1535,8 +1542,10 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
@end
// clang-format on
//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(Double, double, %lf)
// This block of code is generated, do not edit it directly.
// clang-format off
#pragma mark - Double
@@ -1647,12 +1656,12 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
return result;
}
- (void)enumerateValuesWithBlock:(void(NS_NOESCAPE ^)(double value, NSUInteger idx, BOOL *stop))block {
- (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(double value, NSUInteger idx, BOOL *stop))block {
[self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block];
}
- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
usingBlock:(void(NS_NOESCAPE ^)(double value, NSUInteger idx, BOOL *stop))block {
usingBlock:(void (NS_NOESCAPE ^)(double value, NSUInteger idx, BOOL *stop))block {
// NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok).
BOOL stop = NO;
if ((opts & NSEnumerationReverse) == 0) {
@@ -1783,8 +1792,10 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
@end
// clang-format on
//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(Bool, BOOL, %d)
// This block of code is generated, do not edit it directly.
// clang-format off
#pragma mark - Bool
@@ -1895,12 +1906,12 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
return result;
}
- (void)enumerateValuesWithBlock:(void(NS_NOESCAPE ^)(BOOL value, NSUInteger idx, BOOL *stop))block {
- (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(BOOL value, NSUInteger idx, BOOL *stop))block {
[self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block];
}
- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
usingBlock:(void(NS_NOESCAPE ^)(BOOL value, NSUInteger idx, BOOL *stop))block {
usingBlock:(void (NS_NOESCAPE ^)(BOOL value, NSUInteger idx, BOOL *stop))block {
// NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok).
BOOL stop = NO;
if ((opts & NSEnumerationReverse) == 0) {
@@ -2031,9 +2042,8 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
@end
//%PDDM-EXPAND-END (7 expansions)
// clang-format on
//%PDDM-EXPAND-END (7 expansions)
#pragma mark - Enum
@@ -2056,15 +2066,19 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
return [[[self alloc] initWithValidationFunction:func] autorelease];
}
+ (instancetype)arrayWithValidationFunction:(GPBEnumValidationFunc)func rawValue:(int32_t)value {
return [[[self alloc] initWithValidationFunction:func rawValues:&value count:1] autorelease];
+ (instancetype)arrayWithValidationFunction:(GPBEnumValidationFunc)func
rawValue:(int32_t)value {
return [[[self alloc] initWithValidationFunction:func
rawValues:&value
count:1] autorelease];
}
+ (instancetype)arrayWithValueArray:(GPBEnumArray *)array {
return [[(GPBEnumArray *)[self alloc] initWithValueArray:array] autorelease];
return [[(GPBEnumArray*)[self alloc] initWithValueArray:array] autorelease];
}
+ (instancetype)arrayWithValidationFunction:(GPBEnumValidationFunc)func capacity:(NSUInteger)count {
+ (instancetype)arrayWithValidationFunction:(GPBEnumValidationFunc)func
capacity:(NSUInteger)count {
return [[[self alloc] initWithValidationFunction:func capacity:count] autorelease];
}
@@ -2087,7 +2101,7 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
}
- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
rawValues:(const int32_t[])values
rawValues:(const int32_t [])values
count:(NSUInteger)count {
self = [self initWithValidationFunction:func];
if (self) {
@@ -2099,16 +2113,17 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
_count = count;
} else {
[self release];
[NSException
raise:NSMallocException
format:@"Failed to allocate %lu bytes", (unsigned long)(count * sizeof(int32_t))];
[NSException raise:NSMallocException
format:@"Failed to allocate %lu bytes",
(unsigned long)(count * sizeof(int32_t))];
}
}
}
return self;
}
- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func capacity:(NSUInteger)count {
- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func
capacity:(NSUInteger)count {
self = [self initWithValidationFunction:func];
if (self && count) {
[self internalResizeToCapacity:count];
@@ -2117,16 +2132,15 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
}
- (instancetype)copyWithZone:(NSZone *)zone {
return [[GPBEnumArray allocWithZone:zone] initWithValidationFunction:_validationFunc
rawValues:_values
count:_count];
return [[GPBEnumArray allocWithZone:zone]
initWithValidationFunction:_validationFunc
rawValues:_values
count:_count];
}
// Disable clang-format for the macros.
// clang-format off
//%PDDM-EXPAND ARRAY_IMMUTABLE_CORE(Enum, int32_t, Raw, %d)
// This block of code is generated, do not edit it directly.
// clang-format off
- (void)dealloc {
NSAssert(!_autocreator,
@@ -2166,12 +2180,12 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
return result;
}
- (void)enumerateRawValuesWithBlock:(void(NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block {
- (void)enumerateRawValuesWithBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block {
[self enumerateRawValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block];
}
- (void)enumerateRawValuesWithOptions:(NSEnumerationOptions)opts
usingBlock:(void(NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block {
usingBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block {
// NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok).
BOOL stop = NO;
if ((opts & NSEnumerationReverse) == 0) {
@@ -2186,22 +2200,21 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
}
}
}
// clang-format on
//%PDDM-EXPAND-END ARRAY_IMMUTABLE_CORE(Enum, int32_t, Raw, %d)
// clang-format on
- (int32_t)valueAtIndex:(NSUInteger)index {
// clang-format off
//%PDDM-EXPAND VALIDATE_RANGE(index, _count)
// This block of code is generated, do not edit it directly.
// clang-format off
if (index >= _count) {
[NSException raise:NSRangeException
format:@"Index (%lu) beyond bounds (%lu)",
(unsigned long)index, (unsigned long)_count];
}
// clang-format on
//%PDDM-EXPAND-END VALIDATE_RANGE(index, _count)
// clang-format on
int32_t result = _values[index];
if (!_validationFunc(result)) {
result = kGPBUnrecognizedEnumeratorValue;
@@ -2210,28 +2223,26 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
}
- (int32_t)rawValueAtIndex:(NSUInteger)index {
// clang-format off
//%PDDM-EXPAND VALIDATE_RANGE(index, _count)
// This block of code is generated, do not edit it directly.
// clang-format off
if (index >= _count) {
[NSException raise:NSRangeException
format:@"Index (%lu) beyond bounds (%lu)",
(unsigned long)index, (unsigned long)_count];
}
// clang-format on
//%PDDM-EXPAND-END VALIDATE_RANGE(index, _count)
// clang-format on
return _values[index];
}
- (void)enumerateValuesWithBlock:(void(NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))
block {
- (void)enumerateValuesWithBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block {
[self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block];
}
- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
usingBlock:(void(NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))
block {
usingBlock:(void (NS_NOESCAPE ^)(int32_t value, NSUInteger idx, BOOL *stop))block {
// NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok).
BOOL stop = NO;
GPBEnumValidationFunc func = _validationFunc;
@@ -2260,10 +2271,9 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
}
}
// clang-format off
//%PDDM-EXPAND ARRAY_MUTABLE_CORE(Enum, int32_t, Raw, %d)
// This block of code is generated, do not edit it directly.
// clang-format off
- (void)internalResizeToCapacity:(NSUInteger)newCapacity {
_values = reallocf(_values, newCapacity * sizeof(int32_t));
@@ -2369,8 +2379,10 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
_values[idx2] = temp;
}
// clang-format on
//%PDDM-EXPAND MUTATION_METHODS(Enum, int32_t, , EnumValidationList, EnumValidationOne)
// This block of code is generated, do not edit it directly.
// clang-format off
- (void)addValue:(int32_t)value {
[self addValues:&value count:1];
@@ -2437,6 +2449,7 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
}
_values[index] = value;
}
// clang-format on
//%PDDM-EXPAND-END (2 expansions)
//%PDDM-DEFINE MUTATION_HOOK_EnumValidationList()
@@ -2457,8 +2470,6 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
//% }
//%
// clang-format on
@end
#pragma mark - NSArray Subclass
@@ -2468,7 +2479,8 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
}
- (void)dealloc {
NSAssert(!_autocreator, @"%@: Autocreator must be cleared before release, autocreator: %@",
NSAssert(!_autocreator,
@"%@: Autocreator must be cleared before release, autocreator: %@",
[self class], _autocreator);
[_array release];
[super dealloc];
@@ -2544,17 +2556,17 @@ static BOOL ArrayDefault_IsValidValue(int32_t value) {
}
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
objects:(id __unsafe_unretained[])buffer
objects:(id __unsafe_unretained [])buffer
count:(NSUInteger)len {
return [_array countByEnumeratingWithState:state objects:buffer count:len];
}
- (void)enumerateObjectsUsingBlock:(void(NS_NOESCAPE ^)(id obj, NSUInteger idx, BOOL *stop))block {
- (void)enumerateObjectsUsingBlock:(void (NS_NOESCAPE ^)(id obj, NSUInteger idx, BOOL *stop))block {
[_array enumerateObjectsUsingBlock:block];
}
- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts
usingBlock:(void(NS_NOESCAPE ^)(id obj, NSUInteger idx, BOOL *stop))block {
usingBlock:(void (NS_NOESCAPE ^)(id obj, NSUInteger idx, BOOL *stop))block {
[_array enumerateObjectsWithOptions:opts usingBlock:block];
}