aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objective-c/GRPCClient/private/GRPCRequestHeaders.m
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2016-10-25 13:28:12 -0700
committerGravatar Muxi Yan <mxyan@google.com>2016-10-25 13:37:19 -0700
commitbd19fc7e30abcd9ea7cb2bad8217e1b405e8e14f (patch)
treed8bf4ad7e8ae5d420b217216ebc3de4eeb4ef20a /src/objective-c/GRPCClient/private/GRPCRequestHeaders.m
parentad93106da012bcd2080d229ab5b6c61dd2f59fed (diff)
clang-format format clean
Diffstat (limited to 'src/objective-c/GRPCClient/private/GRPCRequestHeaders.m')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCRequestHeaders.m41
1 files changed, 25 insertions, 16 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCRequestHeaders.m b/src/objective-c/GRPCClient/private/GRPCRequestHeaders.m
index c6a03c145e..58c6032e80 100644
--- a/src/objective-c/GRPCClient/private/GRPCRequestHeaders.m
+++ b/src/objective-c/GRPCClient/private/GRPCRequestHeaders.m
@@ -38,9 +38,10 @@
#import "NSDictionary+GRPC.h"
// Used by the setter.
-static void CheckIsNonNilASCII(NSString *name, NSString* value) {
+static void CheckIsNonNilASCII(NSString *name, NSString *value) {
if (!value) {
- [NSException raise:NSInvalidArgumentException format:@"%@ cannot be nil", name];
+ [NSException raise:NSInvalidArgumentException
+ format:@"%@ cannot be nil", name];
}
if (![value canBeConvertedToEncoding:NSASCIIStringEncoding]) {
[NSException raise:NSInvalidArgumentException
@@ -52,15 +53,20 @@ static void CheckIsNonNilASCII(NSString *name, NSString* value) {
static void CheckKeyValuePairIsValid(NSString *key, id value) {
if ([key hasSuffix:@"-bin"]) {
if (![value isKindOfClass:NSData.class]) {
- [NSException raise:NSInvalidArgumentException
- format:@"Expected NSData value for header %@ ending in \"-bin\", "
- @"instead got %@", key, value];
+ [NSException
+ raise:NSInvalidArgumentException
+ format:@"Expected NSData value for header %@ ending in \"-bin\", "
+ @"instead got %@",
+ key, value];
}
} else {
if (![value isKindOfClass:NSString.class]) {
- [NSException raise:NSInvalidArgumentException
- format:@"Expected NSString value for header %@ not ending in \"-bin\", "
- @"instead got %@", key, value];
+ [NSException
+ raise:NSInvalidArgumentException
+ format:
+ @"Expected NSString value for header %@ not ending in \"-bin\", "
+ @"instead got %@",
+ key, value];
}
CheckIsNonNilASCII(@"Text header value", (NSString *)value);
}
@@ -68,9 +74,10 @@ static void CheckKeyValuePairIsValid(NSString *key, id value) {
@implementation GRPCRequestHeaders {
__weak GRPCCall *_call;
- // The NSMutableDictionary superclass doesn't hold any storage (so that people can implement their
- // own in subclasses). As that's not the reason we're subclassing, we just delegate storage to the
- // default NSMutableDictionary subclass returned by the cluster (e.g. __NSDictionaryM on iOS 9).
+ // The NSMutableDictionary superclass doesn't hold any storage (so that people
+ // can implement their own in subclasses). As that's not the reason we're
+ // subclassing, we just delegate storage to the default NSMutableDictionary
+ // subclass returned by the cluster (e.g. __NSDictionaryM on iOS 9).
NSMutableDictionary *_delegate;
}
@@ -91,7 +98,8 @@ static void CheckKeyValuePairIsValid(NSString *key, id value) {
}
// Designated initializer
-- (instancetype)initWithCall:(GRPCCall *)call storage:(NSMutableDictionary *)storage {
+- (instancetype)initWithCall:(GRPCCall *)call
+ storage:(NSMutableDictionary *)storage {
// TODO(jcanizales): Throw if call or storage are nil.
if ((self = [super init])) {
_call = call;
@@ -100,9 +108,10 @@ static void CheckKeyValuePairIsValid(NSString *key, id value) {
return self;
}
-- (instancetype)initWithObjects:(const id _Nonnull __unsafe_unretained *)objects
- forKeys:(const id<NSCopying> _Nonnull __unsafe_unretained *)keys
- count:(NSUInteger)cnt {
+- (instancetype)
+initWithObjects:(const id _Nonnull __unsafe_unretained *)objects
+ forKeys:(const id<NSCopying> _Nonnull __unsafe_unretained *)keys
+ count:(NSUInteger)cnt {
return [self init];
}
@@ -134,7 +143,7 @@ static void CheckKeyValuePairIsValid(NSString *key, id value) {
return _delegate.count;
}
-- (NSEnumerator * _Nonnull)keyEnumerator {
+- (NSEnumerator *_Nonnull)keyEnumerator {
return [_delegate keyEnumerator];
}