PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/google-toolbox-for-mac/Foundation/GTMNSString+URLArguments.h

http://macfuse.googlecode.com/
C++ Header | 41 lines | 5 code | 5 blank | 31 comment | 0 complexity | 6d822b35d9e330f6ab3c1bb836d3067d MD5 | raw file
 1//
 2//  GTMNSString+URLArguments.h
 3//
 4//  Copyright 2006-2008 Google Inc.
 5//
 6//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
 7//  use this file except in compliance with the License.  You may obtain a copy
 8//  of the License at
 9// 
10//  http://www.apache.org/licenses/LICENSE-2.0
11// 
12//  Unless required by applicable law or agreed to in writing, software
13//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
15//  License for the specific language governing permissions and limitations under
16//  the License.
17//
18
19#import <Foundation/Foundation.h>
20
21/// Utilities for encoding and decoding URL arguments.
22@interface NSString (GTMNSStringURLArgumentsAdditions)
23
24/// Returns a string that is escaped properly to be a URL argument.
25//
26/// This differs from stringByAddingPercentEscapesUsingEncoding: in that it
27/// will escape all the reserved characters (per RFC 3986
28/// <http://www.ietf.org/rfc/rfc3986.txt>) which
29/// stringByAddingPercentEscapesUsingEncoding would leave.
30///
31/// This will also escape '%', so this should not be used on a string that has
32/// already been escaped unless double-escaping is the desired result.
33- (NSString*)gtm_stringByEscapingForURLArgument;
34
35/// Returns the unescaped version of a URL argument
36//
37/// This has the same behavior as stringByReplacingPercentEscapesUsingEncoding:,
38/// except that it will also convert '+' to space.
39- (NSString*)gtm_stringByUnescapingFromURLArgument;
40
41@end