Add Apache license boilerplate to several files

This commit is contained in:
Blake Watters
2012-08-29 13:25:28 -04:00
parent fc29fad19e
commit adfaaf29ca
12 changed files with 150 additions and 7 deletions

View File

@@ -5,6 +5,18 @@
// Created by Blake Watters on 4/10/12.
// Copyright (c) 2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <Foundation/Foundation.h>

View File

@@ -5,6 +5,18 @@
// Created by Blake Watters on 4/10/12.
// Copyright (c) 2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import "NSArray+RKAdditions.h"

View File

@@ -55,4 +55,7 @@
- (NSString *)stringWithURLEncodedEntries;
- (NSString *)URLEncodedString; // TODO: Deprecated..
+ (NSDictionary *)dictionaryByReverseMerging:(NSDictionary *)dictionary1 with:(NSDictionary *)dictionary2;
- (NSDictionary *)dictionaryByReverseMergingWith:(NSDictionary *)dictionary;
@end

View File

@@ -126,4 +126,24 @@ RK_FIX_CATEGORY_BUG(NSDictionary_RKAdditions)
return [self stringWithURLEncodedEntries];
}
+ (NSDictionary *)dictionaryByReverseMerging:(NSDictionary *)dictionary1 with:(NSDictionary *)dictionary2
{
NSMutableDictionary *result = [dictionary1 mutableCopy];
[dictionary2 enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
if ([dictionary1 objectForKey:key] && [obj isKindOfClass:[NSDictionary class]]) {
NSDictionary *newVal = [[dictionary1 objectForKey:key] dictionaryByReverseMergingWith:(NSDictionary *)obj];
[result setObject:newVal forKey:key];
} else {
[result setObject:obj forKey:key];
}
}];
return [NSDictionary dictionaryWithDictionary:result];
}
- (NSDictionary *)dictionaryByReverseMergingWith:(NSDictionary *)dictionary
{
return [[self class] dictionaryByReverseMerging:self with:dictionary];
}
@end

View File

@@ -5,6 +5,18 @@
// Created by Blake Watters on 5/10/12.
// Copyright (c) 2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import <Foundation/Foundation.h>

View File

@@ -5,6 +5,18 @@
// Created by Blake Watters on 5/10/12.
// Copyright (c) 2012 RestKit. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#import "RKPortCheck.h"