URLUtils.h
author Olivier Scherler <oscherler@femto-byte.com>
Tue May 12 14:38:30 2009 +0200 (2009-05-12)
changeset 30 2befbe36c746
parent 11 e5976864dfe9
permissions -rw-r--r--
Changed -[MYDirectoryEvent relativePath] to work on standardised paths, in case symlinks are used. Fixes issue #28 in Murky.
     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;