1999-02-13 00:50:41 +00:00
|
|
|
/* NSURL.h - Class NSURL
|
|
|
|
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
|
|
|
1999-07-15 05:43:49 +00:00
|
|
|
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
2002-06-06 14:02:59 +00:00
|
|
|
Date: Jan 1999
|
1999-02-13 00:50:41 +00:00
|
|
|
|
|
|
|
This file is part of the GNUstep Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
2005-05-22 03:32:16 +00:00
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
1999-02-13 00:50:41 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NSURL_h__
|
1999-07-15 05:43:49 +00:00
|
|
|
#define _NSURL_h__
|
|
|
|
|
2001-11-24 15:47:59 +00:00
|
|
|
#include <Foundation/NSURLHandle.h>
|
1999-02-13 00:50:41 +00:00
|
|
|
|
2002-06-06 14:02:59 +00:00
|
|
|
#ifndef STRICT_OPENSTEP
|
|
|
|
|
2001-11-24 15:47:59 +00:00
|
|
|
@class NSNumber;
|
1999-02-13 00:50:41 +00:00
|
|
|
|
2004-07-29 15:30:47 +00:00
|
|
|
/**
|
|
|
|
* URL scheme constant for use with [NSURL-initWithScheme:host:path:].
|
|
|
|
*/
|
2004-09-19 23:19:53 +00:00
|
|
|
GS_EXPORT NSString* const NSURLFileScheme;
|
1999-02-13 00:50:41 +00:00
|
|
|
|
|
|
|
@interface NSURL: NSObject <NSCoding, NSCopying, NSURLHandleClient>
|
|
|
|
{
|
1999-09-16 07:21:34 +00:00
|
|
|
NSString *_urlString;
|
|
|
|
NSURL *_baseURL;
|
2002-06-05 12:39:28 +00:00
|
|
|
void *_clients;
|
|
|
|
void *_data;
|
1999-07-15 05:43:49 +00:00
|
|
|
}
|
1999-02-13 00:50:41 +00:00
|
|
|
|
2001-12-17 14:31:42 +00:00
|
|
|
+ (id) fileURLWithPath: (NSString*)aPath;
|
|
|
|
+ (id) URLWithString: (NSString*)aUrlString;
|
|
|
|
+ (id) URLWithString: (NSString*)aUrlString
|
|
|
|
relativeToURL: (NSURL*)aBaseUrl;
|
1999-02-13 00:50:41 +00:00
|
|
|
|
2002-06-05 12:39:28 +00:00
|
|
|
- (id) initFileURLWithPath: (NSString*)aPath;
|
2001-12-17 14:31:42 +00:00
|
|
|
- (id) initWithScheme: (NSString*)aScheme
|
|
|
|
host: (NSString*)aHost
|
|
|
|
path: (NSString*)aPath;
|
|
|
|
- (id) initWithString: (NSString*)aUrlString;
|
|
|
|
- (id) initWithString: (NSString*)aUrlString
|
|
|
|
relativeToURL: (NSURL*)aBaseUrl;
|
1999-02-13 00:50:41 +00:00
|
|
|
|
1999-07-15 05:43:49 +00:00
|
|
|
- (NSString*) absoluteString;
|
|
|
|
- (NSURL*) absoluteURL;
|
2002-06-05 12:39:28 +00:00
|
|
|
- (NSURL*) baseURL;
|
|
|
|
- (NSString*) fragment;
|
1999-07-15 05:43:49 +00:00
|
|
|
- (NSString*) host;
|
2002-06-05 12:39:28 +00:00
|
|
|
- (BOOL) isFileURL;
|
2002-06-05 12:44:34 +00:00
|
|
|
- (void) loadResourceDataNotifyingClient: (id)client
|
|
|
|
usingCache: (BOOL)shouldUseCache;
|
2002-06-05 12:39:28 +00:00
|
|
|
- (NSString*) parameterString;
|
1999-07-15 05:43:49 +00:00
|
|
|
- (NSString*) password;
|
|
|
|
- (NSString*) path;
|
2002-06-05 12:39:28 +00:00
|
|
|
- (NSNumber*) port;
|
2002-06-05 12:44:34 +00:00
|
|
|
- (id) propertyForKey: (NSString*)propertyKey;
|
1999-07-15 05:43:49 +00:00
|
|
|
- (NSString*) query;
|
|
|
|
- (NSString*) relativePath;
|
2002-06-05 12:39:28 +00:00
|
|
|
- (NSString*) relativeString;
|
2002-06-05 12:44:34 +00:00
|
|
|
- (NSData*) resourceDataUsingCache: (BOOL)shouldUseCache;
|
2002-06-05 12:39:28 +00:00
|
|
|
- (NSString*) resourceSpecifier;
|
|
|
|
- (NSString*) scheme;
|
1999-07-15 05:43:49 +00:00
|
|
|
- (BOOL) setProperty: (id)property
|
|
|
|
forKey: (NSString*)propertyKey;
|
2002-06-05 12:44:34 +00:00
|
|
|
- (BOOL) setResourceData: (NSData*)data;
|
|
|
|
- (NSURL*) standardizedURL;
|
|
|
|
- (NSURLHandle*)URLHandleUsingCache: (BOOL)shouldUseCache;
|
|
|
|
- (NSString*) user;
|
1999-02-13 00:50:41 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSObject (NSURLClient)
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Some data has become available. Note that this does not mean that all data
|
|
|
|
* has become available, only that a chunk of data has arrived.
|
|
|
|
*/
|
1999-07-15 05:43:49 +00:00
|
|
|
- (void) URL: (NSURL*)sender
|
|
|
|
resourceDataDidBecomeAvailable: (NSData*)newBytes;
|
1999-02-13 00:50:41 +00:00
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Loading of resource data is complete.
|
|
|
|
*/
|
1999-07-15 05:43:49 +00:00
|
|
|
- (void) URLResourceDidFinishLoading: (NSURL*)sender;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Loading of resource data was canceled by programmatic request (not an error).
|
|
|
|
*/
|
1999-07-15 05:43:49 +00:00
|
|
|
- (void) URLResourceDidCancelLoading: (NSURL*)sender;
|
1999-02-13 00:50:41 +00:00
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Loading of resource data has failed, for given human-readable reason.
|
|
|
|
*/
|
1999-07-15 05:43:49 +00:00
|
|
|
- (void) URL: (NSURL*)sender
|
|
|
|
resourceDidFailLoadingWithReason: (NSString*)reason;
|
1999-02-13 00:50:41 +00:00
|
|
|
@end
|
|
|
|
|
2002-06-06 14:02:59 +00:00
|
|
|
#endif
|
|
|
|
|
1999-02-13 00:50:41 +00:00
|
|
|
#endif //_NSUrl_h__
|