From e46f27a2c4cab235883eb1da39e7a34b2d66da27 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Fri, 20 Apr 2018 16:04:04 -0700 Subject: Eliminate tvOS deprecation warnings in FirebaseDatabase (#1155) * Delete unused URLEncoded and URLDecoded --- Firebase/Database/Utilities/NSString+FURLUtils.h | 24 --------------- Firebase/Database/Utilities/NSString+FURLUtils.m | 38 ------------------------ 2 files changed, 62 deletions(-) delete mode 100644 Firebase/Database/Utilities/NSString+FURLUtils.h delete mode 100644 Firebase/Database/Utilities/NSString+FURLUtils.m (limited to 'Firebase/Database') diff --git a/Firebase/Database/Utilities/NSString+FURLUtils.h b/Firebase/Database/Utilities/NSString+FURLUtils.h deleted file mode 100644 index 7bd39bc..0000000 --- a/Firebase/Database/Utilities/NSString+FURLUtils.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2017 Google - * - * 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 - -@interface NSString (FURLUtils) - -- (NSString *) urlEncoded; -- (NSString *) urlDecoded; - -@end diff --git a/Firebase/Database/Utilities/NSString+FURLUtils.m b/Firebase/Database/Utilities/NSString+FURLUtils.m deleted file mode 100644 index 2e018c8..0000000 --- a/Firebase/Database/Utilities/NSString+FURLUtils.m +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2017 Google - * - * 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 "NSString+FURLUtils.h" - -@implementation NSString (FURLUtils) - -- (NSString *) urlDecoded { - NSString* replaced = [self stringByReplacingOccurrencesOfString:@"+" withString:@" "]; - NSString* decoded = [replaced stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - // This is kind of a hack, but is generally how the js client works. We could run into trouble if - // some piece is a correctly escaped %-sequence, and another isn't. But, that's bad input anyways... - if (decoded) { - return decoded; - } else { - return replaced; - } -} - -- (NSString *) urlEncoded { - CFStringRef urlString = CFURLCreateStringByAddingPercentEscapes(NULL, (__bridge CFStringRef)self, NULL, (CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ", kCFStringEncodingUTF8); - return (__bridge NSString *) urlString; -} - -@end -- cgit v1.2.3