1
/* NSURL.h - Class NSURL
2
Copyright (C) 1999 Free Software Foundation, Inc.
4
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
7
This file is part of the GNUstep Library.
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Library General Public
11
License as published by the Free Software Foundation; either
12
version 2 of the License, or (at your option) any later version.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Library General Public License for more details.
19
You should have received a copy of the GNU Library General Public
20
License along with this library; if not, write to the Free
21
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
27
#include <Foundation/NSURLHandle.h>
31
GS_EXPORT NSString* NSURLFileScheme; //file
33
//============================================================================
34
@interface NSURL: NSObject <NSCoding, NSCopying, NSURLHandleClient>
40
+ (id) fileURLWithPath: (NSString*)aPath;
41
+ (id) URLWithString: (NSString*)aUrlString;
42
+ (id) URLWithString: (NSString*)aUrlString
43
relativeToURL: (NSURL*)aBaseUrl;
45
- (id) initWithScheme: (NSString*)aScheme
46
host: (NSString*)aHost
47
path: (NSString*)aPath;
49
//Non Standard Function
50
- (id) initWithScheme: (NSString*)aScheme
51
host: (NSString*)aHost
52
port: (NSNumber*)aPort
53
path: (NSString*)aPath;
55
//Do a initWithScheme: NSFileScheme host: nil path: path
56
- (id) initFileURLWithPath: (NSString*)aPath;
58
// urlString is escaped
59
- (id) initWithString: (NSString*)aUrlString;
62
// urlString is escaped
63
- (id) initWithString: (NSString*)aUrlString
64
relativeToURL: (NSURL*)aBaseUrl;
66
- (NSString*) description;
67
- (NSString*) absoluteString;
68
- (NSString*) relativeString;
71
- (NSURL*) absoluteURL;
74
- (NSString*) resourceSpecifier;
79
- (NSString*) password;
81
- (NSString*) fragment;
82
- (NSString*) parameterString;
84
- (NSString*) relativePath;
88
- (NSURL*) standardizedURL;
90
//FIXME: delete these fn when NSURL will be validated
92
+ (void) testPrint: (NSURL*)url;
96
//=============================================================================
97
@interface NSURL (NSURLLoading)
98
- (NSData*) resourceDataUsingCache: (BOOL)shouldUseCache;
100
- (void) loadResourceDataNotifyingClient: (id)client
101
usingCache: (BOOL)shouldUseCache;
103
- (NSURLHandle*)URLHandleUsingCache: (BOOL)shouldUseCache;
105
- (BOOL) setResourceData: (NSData*)data;
107
- (id) propertyForKey: (NSString*)propertyKey;
108
- (BOOL) setProperty: (id)property
109
forKey: (NSString*)propertyKey;
113
//=============================================================================
114
@interface NSObject (NSURLClient)
115
- (void) URL: (NSURL*)sender
116
resourceDataDidBecomeAvailable: (NSData*)newBytes;
118
- (void) URLResourceDidFinishLoading: (NSURL*)sender;
119
- (void) URLResourceDidCancelLoading: (NSURL*)sender;
121
- (void) URL: (NSURL*)sender
122
resourceDidFailLoadingWithReason: (NSString*)reason;