URLUtils.h
changeset 30 2befbe36c746
parent 11 e5976864dfe9
     1.1 --- a/URLUtils.h	Sat May 24 13:24:33 2008 -0700
     1.2 +++ b/URLUtils.h	Tue May 12 14:38:30 2009 +0200
     1.3 @@ -9,6 +9,19 @@
     1.4  #import <Foundation/Foundation.h>
     1.5  
     1.6  
     1.7 +@interface NSURL (MYUtilities)
     1.8 +
     1.9 +/** Smart/lenient version of +URLWithString:, for use with user-entered URLs.
    1.10 +    - Strips out any whitespace or newlines
    1.11 +    - Removes surrounding "<...>"
    1.12 +    - Adds a default scheme like http: if necessary, if one is provided
    1.13 +    - Checks against a list of allowed schemes, if one is provided */
    1.14 ++ (NSURL*) my_URLWithLenientString: (NSString*)string 
    1.15 +                     defaultScheme: (NSString*)defaultScheme
    1.16 +                    allowedSchemes: (NSArray*)allowedSchemes;
    1.17 +@end
    1.18 +
    1.19 +
    1.20  @interface NSHTTPURLResponse (MYUtilities)
    1.21  
    1.22  - (NSError*) HTTPError;