mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4593 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f110df87ff
commit
76f1d48a3a
4 changed files with 116 additions and 106 deletions
|
@ -1,3 +1,9 @@
|
|||
Thu Jul 15 6:26:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Headers/Foundation/NSURL.h: Tidied
|
||||
* Headers/Foundation/NSURLHandle.h: Tidied
|
||||
* Headers/Foundation/Foundation.h: inlcude NSURL.h and NSURLHandle.h
|
||||
|
||||
Wed Jul 14 20:19:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSThread.m: Make sure that a thread retains the target object
|
||||
|
|
|
@ -77,6 +77,8 @@
|
|||
#include <Foundation/NSTask.h>
|
||||
#include <Foundation/NSThread.h>
|
||||
#include <Foundation/NSTimer.h>
|
||||
#include <Foundation/NSURL.h>
|
||||
#include <Foundation/NSURLHandle.h>
|
||||
#include <Foundation/NSUndoManager.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* NSURL.h - Class NSURL
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Jan 1999
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
@ -22,104 +22,106 @@
|
|||
*/
|
||||
|
||||
#ifndef _NSURL_h__
|
||||
#define _NSURL_h__
|
||||
#define _NSURL_h__
|
||||
|
||||
#include <Foundation/NSURLHandle.h>
|
||||
|
||||
@class NSURLHandle;
|
||||
@class NSURL;
|
||||
|
||||
extern NSString* NSURLFileScheme; //file
|
||||
|
||||
//===================================================================================
|
||||
//============================================================================
|
||||
@interface NSURL: NSObject <NSCoding, NSCopying, NSURLHandleClient>
|
||||
{
|
||||
NSString *urlString;
|
||||
NSURL *baseURL;
|
||||
void *clients;
|
||||
};
|
||||
NSString *urlString;
|
||||
NSURL *baseURL;
|
||||
void *clients;
|
||||
}
|
||||
|
||||
+(id)fileURLWithPath:(NSString*)path;
|
||||
+(id)URLWithString:(NSString*)URLString;
|
||||
+(id)URLWithString:(NSString*)URLString
|
||||
relativeToURL:(NSURL*)baseURL;
|
||||
+ (id) fileURLWithPath: (NSString*)path;
|
||||
+ (id) URLWithString: (NSString*)URLString;
|
||||
+ (id) URLWithString: (NSString*)URLString
|
||||
relativeToURL: (NSURL*)baseURL;
|
||||
|
||||
-(id)initWithScheme:(NSString*)_scheme
|
||||
host:(NSString*)_host
|
||||
path:(NSString*)_path;
|
||||
- (id) initWithScheme: (NSString*)_scheme
|
||||
host: (NSString*)_host
|
||||
path: (NSString*)_path;
|
||||
|
||||
//Non Standard Function
|
||||
-(id)initWithScheme:(NSString*)_scheme
|
||||
host:(NSString*)_host
|
||||
port:(NSNumber*)_port
|
||||
path:(NSString*)_path;
|
||||
- (id) initWithScheme: (NSString*)_scheme
|
||||
host: (NSString*)_host
|
||||
port: (NSNumber*)_port
|
||||
path: (NSString*)_path;
|
||||
|
||||
//Do a initWithScheme:NSFileScheme host:nil path:_path
|
||||
-(id)initFileURLWithPath:(NSString*)_path;
|
||||
//Do a initWithScheme: NSFileScheme host: nil path: _path
|
||||
- (id) initFileURLWithPath: (NSString*)_path;
|
||||
|
||||
// urlString is escaped
|
||||
-(id)initWithString:(NSString*)URLString;
|
||||
- (id) initWithString: (NSString*)URLString;
|
||||
|
||||
//URLString!=nil !
|
||||
// urlString is escaped
|
||||
-(id)initWithString:(NSString*)URLString
|
||||
relativeToURL:(NSURL*)baseURL;
|
||||
- (id) initWithString: (NSString*)URLString
|
||||
relativeToURL: (NSURL*)baseURL;
|
||||
|
||||
-(NSString*)description;
|
||||
-(NSString*)absoluteString;
|
||||
-(NSString*)relativeString;
|
||||
- (NSString*) description;
|
||||
- (NSString*) absoluteString;
|
||||
- (NSString*) relativeString;
|
||||
|
||||
-(NSURL*)baseURL;
|
||||
-(NSURL*)absoluteURL;
|
||||
- (NSURL*) baseURL;
|
||||
- (NSURL*) absoluteURL;
|
||||
|
||||
-(NSString*)scheme;
|
||||
-(NSString*)resourceSpecifier;
|
||||
- (NSString*) scheme;
|
||||
- (NSString*) resourceSpecifier;
|
||||
|
||||
-(NSString*)host;
|
||||
-(NSNumber*)port;
|
||||
-(NSString*)user;
|
||||
-(NSString*)password;
|
||||
-(NSString*)path;
|
||||
-(NSString*)fragment;
|
||||
-(NSString*)parameterString;
|
||||
-(NSString*)query;
|
||||
-(NSString*)relativePath;
|
||||
- (NSString*) host;
|
||||
- (NSNumber*) port;
|
||||
- (NSString*) user;
|
||||
- (NSString*) password;
|
||||
- (NSString*) path;
|
||||
- (NSString*) fragment;
|
||||
- (NSString*) parameterString;
|
||||
- (NSString*) query;
|
||||
- (NSString*) relativePath;
|
||||
|
||||
-(BOOL)isFileURL;
|
||||
- (BOOL) isFileURL;
|
||||
|
||||
-(NSURL*)standardizedURL;
|
||||
- (NSURL*) standardizedURL;
|
||||
|
||||
//FIXME: delete these fn when NSURL will be validated
|
||||
+(void)test;
|
||||
+(void)testPrint:(NSURL*)_url;
|
||||
+ (void) test;
|
||||
+ (void) testPrint: (NSURL*)_url;
|
||||
|
||||
@end
|
||||
|
||||
//===================================================================================
|
||||
//=============================================================================
|
||||
@interface NSURL (NSURLLoading)
|
||||
-(NSData*)resourceDataUsingCache:(BOOL)shouldUseCache;
|
||||
- (NSData*) resourceDataUsingCache: (BOOL)shouldUseCache;
|
||||
|
||||
-(void)loadResourceDataNotifyingClient:(id)client
|
||||
usingCache:(BOOL)shouldUseCache;
|
||||
- (void) loadResourceDataNotifyingClient: (id)client
|
||||
usingCache: (BOOL)shouldUseCache;
|
||||
|
||||
-(NSURLHandle*)URLHandleUsingCache:(BOOL)shouldUseCache;
|
||||
- (NSURLHandle*)URLHandleUsingCache: (BOOL)shouldUseCache;
|
||||
|
||||
-(BOOL)setResourceData:(NSData*)data;
|
||||
- (BOOL) setResourceData: (NSData*)data;
|
||||
|
||||
-(id)propertyForKey:(NSString*)propertyKey;
|
||||
-(BOOL)setProperty:(id)property
|
||||
forKey:(NSString*)propertyKey;
|
||||
- (id) propertyForKey: (NSString*)propertyKey;
|
||||
- (BOOL) setProperty: (id)property
|
||||
forKey: (NSString*)propertyKey;
|
||||
|
||||
@end
|
||||
|
||||
//===================================================================================
|
||||
//=============================================================================
|
||||
@interface NSObject (NSURLClient)
|
||||
-(void) URL:(NSURL*)sender
|
||||
resourceDataDidBecomeAvailable:(NSData*)newBytes;
|
||||
- (void) URL: (NSURL*)sender
|
||||
resourceDataDidBecomeAvailable: (NSData*)newBytes;
|
||||
|
||||
-(void)URLResourceDidFinishLoading:(NSURL*)sender;
|
||||
-(void)URLResourceDidCancelLoading:(NSURL*)sender;
|
||||
- (void) URLResourceDidFinishLoading: (NSURL*)sender;
|
||||
- (void) URLResourceDidCancelLoading: (NSURL*)sender;
|
||||
|
||||
-(void) URL:(NSURL*)sender
|
||||
resourceDidFailLoadingWithReason:(NSString*)reason;
|
||||
- (void) URL: (NSURL*)sender
|
||||
resourceDidFailLoadingWithReason: (NSString*)reason;
|
||||
@end
|
||||
|
||||
#endif //_NSUrl_h__
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* NSURLHandle.h - Class NSURLHandle
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Jan 1999
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Jan 1999
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
#ifndef _NSURLHandle_h__
|
||||
#define _NSURLHandle_h__
|
||||
#define _NSURLHandle_h__
|
||||
|
||||
@class NSURLHandle;
|
||||
@class NSURL;
|
||||
|
@ -35,70 +35,70 @@ extern NSString *NSHTTPPropertyErrorPageDataKey;
|
|||
|
||||
typedef enum
|
||||
{
|
||||
NSURLHandleNotLoaded = 0,
|
||||
NSURLHandleLoadSucceeded,
|
||||
NSURLHandleLoadInProgress,
|
||||
NSURLHandleLoadFailed
|
||||
NSURLHandleNotLoaded = 0,
|
||||
NSURLHandleLoadSucceeded,
|
||||
NSURLHandleLoadInProgress,
|
||||
NSURLHandleLoadFailed
|
||||
} NSURLHandleStatus;
|
||||
|
||||
//===================================================================================
|
||||
//=============================================================================
|
||||
@protocol NSURLHandleClient
|
||||
-(void) URLHandle:(NSURLHandle*)sender
|
||||
resourceDataDidBecomeAvailable:(NSData*)newData;
|
||||
- (void) URLHandle: (NSURLHandle*)sender
|
||||
resourceDataDidBecomeAvailable: (NSData*)newData;
|
||||
|
||||
-(void)URLHandleResourceDidBeginLoading:(NSURLHandle*)sender;
|
||||
-(void)URLHandleResourceDidFinishLoading:(NSURLHandle*)sender;
|
||||
-(void)URLHandleResourceDidCancelLoading:(NSURLHandle*)sender;
|
||||
- (void) URLHandleResourceDidBeginLoading: (NSURLHandle*)sender;
|
||||
- (void) URLHandleResourceDidFinishLoading: (NSURLHandle*)sender;
|
||||
- (void) URLHandleResourceDidCancelLoading: (NSURLHandle*)sender;
|
||||
|
||||
-(void) URLHandle:(NSURLHandle*)sender
|
||||
resourceDidFailLoadingWithReason:(NSString*)reason;
|
||||
- (void) URLHandle: (NSURLHandle*)sender
|
||||
resourceDidFailLoadingWithReason: (NSString*)reason;
|
||||
@end
|
||||
|
||||
//===================================================================================
|
||||
@interface NSURLHandle:NSObject
|
||||
//=============================================================================
|
||||
@interface NSURLHandle: NSObject
|
||||
{
|
||||
NSMutableArray *clients;
|
||||
id data;
|
||||
NSURLHandleStatus status;
|
||||
};
|
||||
NSMutableArray *clients;
|
||||
id data;
|
||||
NSURLHandleStatus status;
|
||||
}
|
||||
|
||||
+(void)registerURLHandleClass:(Class)_urlHandleSubclass;
|
||||
+(Class)URLHandleClassForURL:(NSURL*)_url;
|
||||
+ (void) registerURLHandleClass: (Class)_urlHandleSubclass;
|
||||
+ (Class) URLHandleClassForURL: (NSURL*)_url;
|
||||
|
||||
-(id)initWithURL:(NSURL*)_url
|
||||
cached:(BOOL)_cached;
|
||||
- (id) initWithURL: (NSURL*)_url
|
||||
cached: (BOOL)_cached;
|
||||
|
||||
-(NSURLHandleStatus)status;
|
||||
-(NSString*)failureReason;
|
||||
- (NSURLHandleStatus) status;
|
||||
- (NSString*) failureReason;
|
||||
|
||||
-(void)addClient:(id <NSURLHandleClient>)_client;
|
||||
-(void)removeClient:(id <NSURLHandleClient>)_client;
|
||||
- (void) addClient: (id <NSURLHandleClient>)_client;
|
||||
- (void) removeClient: (id <NSURLHandleClient>)_client;
|
||||
|
||||
-(void)loadInBackground;
|
||||
-(void)cancelLoadInBackground;
|
||||
- (void) loadInBackground;
|
||||
- (void) cancelLoadInBackground;
|
||||
|
||||
-(NSData*)resourceData;
|
||||
-(NSData*)availableResourceData;
|
||||
- (NSData*) resourceData;
|
||||
- (NSData*) availableResourceData;
|
||||
|
||||
-(void)flushCachedData;
|
||||
- (void) flushCachedData;
|
||||
|
||||
-(void)backgroundLoadDidFailWithReason:(NSString*)reason;
|
||||
-(void)didLoadBytes:(NSData*)newData
|
||||
loadComplete:(BOOL)_loadComplete;
|
||||
- (void) backgroundLoadDidFailWithReason: (NSString*)reason;
|
||||
- (void) didLoadBytes: (NSData*)newData
|
||||
loadComplete: (BOOL)_loadComplete;
|
||||
|
||||
|
||||
+(BOOL)canInitWithURL:(NSURL*)_url;
|
||||
+(NSURLHandle*)cachedHandleForURL:(NSURL*)_url;
|
||||
+ (BOOL) canInitWithURL: (NSURL*)_url;
|
||||
+ (NSURLHandle*) cachedHandleForURL: (NSURL*)_url;
|
||||
|
||||
-(id)propertyForKey:(NSString*)propertyKey;
|
||||
-(id)propertyForKeyIfAvailable:(NSString*)propertyKey;
|
||||
-(BOOL)writeProperty:(id)propertyValue
|
||||
forKey:(NSString*)propertyKey;
|
||||
-(BOOL)writeData:(NSData*)data;
|
||||
- (id) propertyForKey: (NSString*)propertyKey;
|
||||
- (id) propertyForKeyIfAvailable: (NSString*)propertyKey;
|
||||
- (BOOL) writeProperty: (id)propertyValue
|
||||
forKey: (NSString*)propertyKey;
|
||||
- (BOOL) writeData: (NSData*)data;
|
||||
|
||||
-(NSData*)loadInForeground;
|
||||
-(void)beginLoadInBackground;
|
||||
-(void)endLoadInBackground;
|
||||
- (NSData*) loadInForeground;
|
||||
- (void) beginLoadInBackground;
|
||||
- (void) endLoadInBackground;
|
||||
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in a new issue