URLUtils.h
author snej@snej.local
Sun Apr 12 22:00:36 2009 -0700 (2009-04-12)
changeset 25 47d10ac2d04e
parent 11 e5976864dfe9
permissions -rw-r--r--
Fixed some incorrect CSSM error code strings. Removed a log call from MYError.
     1 //
     2 //  URLUtils.h
     3 //  MYUtilities
     4 //
     5 //  Created by Jens Alfke on 4/28/08.
     6 //  Copyright 2008 Jens Alfke. All rights reserved.
     7 //
     8 
     9 #import <Foundation/Foundation.h>
    10 
    11 
    12 @interface NSURL (MYUtilities)
    13 
    14 /** Smart/lenient version of +URLWithString:, for use with user-entered URLs.
    15     - Strips out any whitespace or newlines
    16     - Removes surrounding "<...>"
    17     - Adds a default scheme like http: if necessary, if one is provided
    18     - Checks against a list of allowed schemes, if one is provided */
    19 + (NSURL*) my_URLWithLenientString: (NSString*)string 
    20                      defaultScheme: (NSString*)defaultScheme
    21                     allowedSchemes: (NSArray*)allowedSchemes;
    22 @end
    23 
    24 
    25 @interface NSHTTPURLResponse (MYUtilities)
    26 
    27 - (NSError*) HTTPError;
    28 
    29 @end
    30 
    31 extern NSString* const MyHTTPErrorDomain;