URLUtils.h
author snej@snej-mbp.mtv.corp.google.com
Tue Apr 07 11:13:25 2009 -0700 (2009-04-07)
changeset 23 a910102a1c9d
parent 11 e5976864dfe9
permissions -rw-r--r--
* Added MYReturnError.
* Better iPhone support in ExceptionUtils.
* Make sure "All Tests Passed/Failed" message is always logged.
     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;