~ubuntu-branches/ubuntu/karmic/gnustep-base/karmic

« back to all changes in this revision

Viewing changes to Headers/gnustep/base/NSURL.h

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2005-04-17 00:14:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050417001438-enf0y07c9tku85z1
Tags: 1.10.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* NSURL.h - Class NSURL
2
 
   Copyright (C) 1999 Free Software Foundation, Inc.
3
 
   
4
 
   Written by:  Manuel Guesdon <mguesdon@sbuilders.com>
5
 
   Date:                Jan 1999
6
 
   
7
 
   This file is part of the GNUstep Library.
8
 
   
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.
13
 
   
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.
18
 
   
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.
22
 
*/
23
 
 
24
 
#ifndef _NSURL_h__
25
 
#define _NSURL_h__
26
 
 
27
 
#include <Foundation/NSURLHandle.h>
28
 
 
29
 
@class NSNumber;
30
 
 
31
 
GS_EXPORT NSString* NSURLFileScheme; //file
32
 
 
33
 
//============================================================================
34
 
@interface NSURL: NSObject <NSCoding, NSCopying, NSURLHandleClient>
35
 
{
36
 
  NSString      *_urlString;
37
 
  NSURL         *_baseURL;
38
 
}
39
 
        
40
 
+ (id) fileURLWithPath: (NSString*)aPath;
41
 
+ (id) URLWithString: (NSString*)aUrlString;
42
 
+ (id) URLWithString: (NSString*)aUrlString
43
 
       relativeToURL: (NSURL*)aBaseUrl;
44
 
 
45
 
- (id) initWithScheme: (NSString*)aScheme
46
 
                 host: (NSString*)aHost
47
 
                 path: (NSString*)aPath;
48
 
 
49
 
//Non Standard Function
50
 
- (id) initWithScheme: (NSString*)aScheme
51
 
                 host: (NSString*)aHost
52
 
                 port: (NSNumber*)aPort
53
 
                 path: (NSString*)aPath;
54
 
 
55
 
//Do a initWithScheme: NSFileScheme host: nil path: path
56
 
- (id) initFileURLWithPath: (NSString*)aPath;
57
 
 
58
 
// urlString is escaped
59
 
- (id) initWithString: (NSString*)aUrlString;
60
 
 
61
 
//URLString!=nil !
62
 
// urlString is escaped
63
 
- (id) initWithString: (NSString*)aUrlString
64
 
        relativeToURL: (NSURL*)aBaseUrl;
65
 
 
66
 
- (NSString*) description;
67
 
- (NSString*) absoluteString;
68
 
- (NSString*) relativeString;
69
 
 
70
 
- (NSURL*) baseURL;
71
 
- (NSURL*) absoluteURL;
72
 
 
73
 
- (NSString*) scheme;
74
 
- (NSString*) resourceSpecifier;
75
 
 
76
 
- (NSString*) host;
77
 
- (NSNumber*) port;
78
 
- (NSString*) user;
79
 
- (NSString*) password;
80
 
- (NSString*) path;
81
 
- (NSString*) fragment;
82
 
- (NSString*) parameterString;
83
 
- (NSString*) query;
84
 
- (NSString*) relativePath;
85
 
 
86
 
- (BOOL) isFileURL;
87
 
 
88
 
- (NSURL*) standardizedURL;
89
 
 
90
 
//FIXME: delete these fn when NSURL will be validated
91
 
+ (void) test;
92
 
+ (void) testPrint: (NSURL*)url;
93
 
 
94
 
@end
95
 
 
96
 
//=============================================================================
97
 
@interface NSURL (NSURLLoading)
98
 
- (NSData*) resourceDataUsingCache: (BOOL)shouldUseCache;
99
 
 
100
 
- (void) loadResourceDataNotifyingClient: (id)client
101
 
                              usingCache: (BOOL)shouldUseCache;
102
 
 
103
 
- (NSURLHandle*)URLHandleUsingCache: (BOOL)shouldUseCache;
104
 
 
105
 
- (BOOL) setResourceData: (NSData*)data;
106
 
 
107
 
- (id) propertyForKey: (NSString*)propertyKey;
108
 
- (BOOL) setProperty: (id)property
109
 
              forKey: (NSString*)propertyKey;
110
 
 
111
 
@end
112
 
 
113
 
//=============================================================================
114
 
@interface NSObject (NSURLClient)
115
 
- (void) URL: (NSURL*)sender
116
 
  resourceDataDidBecomeAvailable: (NSData*)newBytes;
117
 
 
118
 
- (void) URLResourceDidFinishLoading: (NSURL*)sender;
119
 
- (void) URLResourceDidCancelLoading: (NSURL*)sender;
120
 
 
121
 
- (void) URL: (NSURL*)sender
122
 
  resourceDidFailLoadingWithReason: (NSString*)reason;
123
 
@end
124
 
 
125
 
#endif //_NSUrl_h__