-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCFURL.h
753 lines (645 loc) · 21.5 KB
/
CFURL.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
/*
File: CFURL.h
Contains: CoreFoundation urls
Version: Technology: Mac OS X
Release: Universal Interfaces 3.4
Copyright: © 1999-2001 by Apple Computer, Inc., all rights reserved
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __CFURL__
#define __CFURL__
#ifndef __CFBASE__
#include <CFBase.h>
#endif
#ifndef __CFDATA__
#include <CFData.h>
#endif
#ifndef __CFSTRING__
#include <CFString.h>
#endif
#ifndef __FILES__
#include <Files.h>
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
#if PRAGMA_ENUM_ALWAYSINT
#if defined(__fourbyteints__) && !__fourbyteints__
#define __CFURL__RESTORE_TWOBYTEINTS
#pragma fourbyteints on
#endif
#pragma enumsalwaysint on
#elif PRAGMA_ENUM_OPTIONS
#pragma option enum=int
#elif PRAGMA_ENUM_PACK
#if __option(pack_enums)
#define __CFURL__RESTORE_PACKED_ENUMS
#pragma options(!pack_enums)
#endif
#endif
enum CFURLPathStyle {
kCFURLPOSIXPathStyle = 0,
kCFURLHFSPathStyle = 1,
kCFURLWindowsPathStyle = 2
};
typedef enum CFURLPathStyle CFURLPathStyle;
typedef const struct __CFURL* CFURLRef;
/* CFURLs are composed of two fundamental pieces - their string, and a */
/* (possibly NULL) base URL. A relative URL is one in which the string */
/* by itself does not fully specify the URL (for instance "myDir/image.tiff"); */
/* an absolute URL is one in which the string does fully specify the URL */
/* ("file://localhost/myDir/image.tiff"). Absolute URLs always have NULL */
/* base URLs; however, it is possible for a URL to have a NULL base, and still */
/* not be absolute. Such a URL has only a relative string, and cannot be */
/* resolved. Two CFURLs are considered equal if and only if their strings */
/* are equal and their bases are equal. In other words, */
/* "file://localhost/myDir/image.tiff" is NOT equal to the URL with relative */
/* string "myDir/image.tiff" and base URL "file://localhost/". Clients that */
/* need these less strict form of equality should convert all URLs to their */
/* absolute form via CFURLCopyAbsoluteURL(), then compare the absolute forms. */
/*
* CFURLGetTypeID()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFTypeID )
CFURLGetTypeID(void);
/* encoding will be used both to interpret the bytes of URLBytes, and to */
/* interpret any percent-escapes within the bytes. */
/*
* CFURLCreateWithBytes()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateWithBytes(
CFAllocatorRef allocator,
const UInt8 * URLBytes,
CFIndex length,
CFStringEncoding encoding,
CFURLRef baseURL);
/* Escapes any character that is not 7-bit ASCII with the byte-code */
/* for the given encoding. If escapeWhitespace is true, whitespace */
/* characters (' ', '\t', '\r', '\n') will be escaped also (desirable */
/* if embedding the URL into a larger text stream like HTML) */
/*
* CFURLCreateData()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFDataRef )
CFURLCreateData(
CFAllocatorRef allocator,
CFURLRef url,
CFStringEncoding encoding,
Boolean escapeWhitespace);
/* Any escape sequences in URLString will be interpreted via UTF-8. */
/*
* CFURLCreateWithString()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateWithString(
CFAllocatorRef allocator,
CFStringRef URLString,
CFURLRef baseURL);
/* filePath should be the URL's path expressed as a path of the type */
/* fsType. If filePath is not absolute, the resulting URL will be */
/* considered relative to the current working directory (evaluated */
/* at creation time). isDirectory determines whether filePath is */
/* treated as a directory path when resolving against relative path */
/* components */
/*
* CFURLCreateWithFileSystemPath()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateWithFileSystemPath(
CFAllocatorRef allocator,
CFStringRef filePath,
CFURLPathStyle pathStyle,
Boolean isDirectory);
/*
* CFURLCreateFromFileSystemRepresentation()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateFromFileSystemRepresentation(
CFAllocatorRef allocator,
const UInt8 * buffer,
CFIndex bufLen,
Boolean isDirectory);
/*
* CFURLCreateWithFileSystemPathRelativeToBase()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateWithFileSystemPathRelativeToBase(
CFAllocatorRef allocator,
CFStringRef filePath,
CFURLPathStyle pathStyle,
Boolean isDirectory,
CFURLRef baseURL);
/*
* CFURLCreateFromFileSystemRepresentationRelativeToBase()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateFromFileSystemRepresentationRelativeToBase(
CFAllocatorRef allocator,
const UInt8 * buffer,
CFIndex bufLen,
Boolean isDirectory,
CFURLRef baseURL);
/* Fills buffer with the file system's native representation of */
/* url's path. No more than maxBufLen bytes are written to buffer. */
/* The buffer should be at least the maximum path length for */
/* the file system in question to avoid failures for insufficiently */
/* large buffers. If resolveAgainstBase is true, the url's relative */
/* portion is resolved against its base before the path is computed. */
/* Returns success or failure. */
/*
* CFURLGetFileSystemRepresentation()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( Boolean )
CFURLGetFileSystemRepresentation(
CFURLRef url,
Boolean resolveAgainstBase,
UInt8 * buffer,
CFIndex maxBufLen);
/* Creates a new URL by resolving the relative portion of relativeURL against its base. */
/*
* CFURLCopyAbsoluteURL()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCopyAbsoluteURL(CFURLRef relativeURL);
/* Returns the URL's string. */
/*
* CFURLGetString()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLGetString(CFURLRef anURL);
/* Returns the base URL if it exists */
/*
* CFURLGetBaseURL()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLGetBaseURL(CFURLRef anURL);
/*
All URLs can be broken into two pieces - the scheme (preceding the
first colon) and the resource specifier (following the first colon).
Most URLs are also "standard" URLs conforming to RFC 1808 (available
from www.w3c.org). This category includes URLs of the file, http,
https, and ftp schemes, to name a few. Standard URLs start the
resource specifier with two slashes ("//"), and can be broken into
four distinct pieces - the scheme, the net location, the path, and
further resource specifiers (typically an optional parameter, query,
and/or fragment). The net location appears immediately following
the two slashes and goes up to the next slash; it's format is
scheme-specific, but is usually composed of some or all of a username,
password, host name, and port. The path is a series of path components
separated by slashes; if the net location is present, the path always
begins with a slash. Standard URLs can be relative to another URL,
in which case at least the scheme and possibly other pieces as well
come from the base URL (see RFC 1808 for precise details when resolving
a relative URL against its base). The full URL is therefore
<scheme> "://" <net location> <path, always starting with slash> <add'l resource specifiers>
If a given CFURL can be decomposed (that is, conforms to RFC 1808), you
can ask for each of the four basic pieces (scheme, net location, path,
and resource specifer) separately, as well as for its base URL. The
basic pieces are returned with any percent escape sequences still in
place (although note that the scheme may not legally include any
percent escapes); this is to allow the caller to distinguish between
percent sequences that may have syntactic meaning if replaced by the
character being escaped (for instance, a '/' in a path component).
Since only the individual schemes know which characters are
syntactically significant, CFURL cannot safely replace any percent
escape sequences. However, you can use
CFURLCreateStringByReplacingPercentEscapes() to create a new string with
the percent escapes removed; see below.
If a given CFURL can not be decomposed, you can ask for its scheme and its
resource specifier; asking it for its net location or path will return NULL.
To get more refined information about the components of a decomposable
CFURL, you may ask for more specific pieces of the URL, expressed with
the percent escapes removed. The available functions are CFURLCopyHostName(),
CFURLGetPortNumber() (returns an Int32), CFURLCopyUserName(),
CFURLCopyPassword(), CFURLCopyQuery(), CFURLCopyParameters(), and
CFURLCopyFragment(). Because the parameters, query, and fragment of an
URL may contain scheme-specific syntaxes, these methods take a second
argument, giving a list of characters which should NOT be replaced if
percent escaped. For instance, the ftp parameter syntax gives simple
key-value pairs as "<key>=<value>;" Clearly if a key or value includes
either '=' or ';', it must be escaped to avoid corrupting the meaning of
the parameters, so the caller may request the parameter string as
CFStringRef myParams = CFURLCopyParameters(ftpURL, CFSTR("=;%"));
requesting that all percent escape sequences be replaced by the represented
characters, except for escaped '=', '%' or ';' characters. Pass the empty
string (CFSTR("")) to request that all percent escapes be replaced, or NULL
to request that none be.
*/
/* Returns TRUE if anURL conforms to RFC 1808 */
/*
* CFURLCanBeDecomposed()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( Boolean )
CFURLCanBeDecomposed(CFURLRef anURL);
/* The next several methods leave any percent escape sequences intact */
/*
* CFURLCopyScheme()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyScheme(CFURLRef anURL);
/* NULL if CFURLCanBeDecomposed(anURL) is FALSE */
/*
* CFURLCopyNetLocation()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyNetLocation(CFURLRef anURL);
/* NULL if CFURLCanBeDecomposed(anURL) is FALSE; also does not resolve the URL */
/* against its base. See also CFURLCopyAbsoluteURL(). Note that, strictly */
/* speaking, any leading '/' is not considered part of the URL's path, although */
/* its presence or absence determines whether the path is absolute. */
/* CFURLCopyPath()'s return value includes any leading slash (giving the path */
/* the normal POSIX appearance); CFURLCopyStrictPath()'s return value omits any */
/* leading slash, and uses isAbsolute to report whether the URL's path is absolute. */
/* CFURLCopyFileSystemPath() returns the URL's path as a file system path for the */
/* given path style. All percent escape sequences are replaced. The URL is not */
/* resolved against its base before computing the path. */
/*
* CFURLCopyPath()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyPath(CFURLRef anURL);
/*
* CFURLCopyStrictPath()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyStrictPath(
CFURLRef anURL,
Boolean * isAbsolute);
/*
* CFURLCopyFileSystemPath()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyFileSystemPath(
CFURLRef anURL,
CFURLPathStyle pathStyle);
/* Returns whether anURL's path represents a directory */
/* (TRUE returned) or a simple file (FALSE returned) */
/*
* CFURLHasDirectoryPath()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( Boolean )
CFURLHasDirectoryPath(CFURLRef anURL);
/* Any additional resource specifiers after the path. For URLs */
/* that cannot be decomposed, this is everything except the scheme itself. */
/*
* CFURLCopyResourceSpecifier()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyResourceSpecifier(CFURLRef anURL);
/*
* CFURLCopyHostName()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyHostName(CFURLRef anURL);
/*
* CFURLGetPortNumber()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( SInt32 )
CFURLGetPortNumber(CFURLRef anURL);
/* Returns -1 if no port number is specified */
/*
* CFURLCopyUserName()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyUserName(CFURLRef anURL);
/*
* CFURLCopyPassword()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyPassword(CFURLRef anURL);
/* These remove all percent escape sequences except those for */
/* characters in charactersToLeaveEscaped. If charactersToLeaveEscaped */
/* is empty (""), all percent escape sequences are replaced by their */
/* corresponding characters. If charactersToLeaveEscaped is NULL, */
/* then no escape sequences are removed at all */
/*
* CFURLCopyParameterString()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyParameterString(
CFURLRef anURL,
CFStringRef charactersToLeaveEscaped);
/*
* CFURLCopyQueryString()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyQueryString(
CFURLRef anURL,
CFStringRef charactersToLeaveEscaped);
/*
* CFURLCopyFragment()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyFragment(
CFURLRef anURL,
CFStringRef charactersToLeaveEscaped);
/*
* CFURLCopyLastPathComponent()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyLastPathComponent(CFURLRef url);
/*
* CFURLCopyPathExtension()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCopyPathExtension(CFURLRef url);
/* These functions all treat the base URL of the supplied url as */
/* invariant. In other words, the URL returned will always have */
/* the same base as the URL supplied as an argument. */
/*
* CFURLCreateCopyAppendingPathComponent()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateCopyAppendingPathComponent(
CFAllocatorRef allocator,
CFURLRef url,
CFStringRef pathComponent,
Boolean isDirectory);
/*
* CFURLCreateCopyDeletingLastPathComponent()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateCopyDeletingLastPathComponent(
CFAllocatorRef allocator,
CFURLRef url);
/*
* CFURLCreateCopyAppendingPathExtension()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateCopyAppendingPathExtension(
CFAllocatorRef allocator,
CFURLRef url,
CFStringRef extension);
/*
* CFURLCreateCopyDeletingPathExtension()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateCopyDeletingPathExtension(
CFAllocatorRef allocator,
CFURLRef url);
/* Returns a string with any percent escape sequences that do NOT */
/* correspond to characters in charactersToLeaveEscaped with their */
/* equivalent. Returns NULL on failure (if an invalid percent sequence */
/* is encountered), or the original string (retained) if no characters */
/* need to be replaced. Pass NULL to request that no percent escapes be */
/* replaced, or the empty string (CFSTR("")) to request that all percent */
/* escapes be replaced. Uses UTF8 to interpret percent escapes. */
/*
* CFURLCreateStringByReplacingPercentEscapes()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCreateStringByReplacingPercentEscapes(
CFAllocatorRef allocator,
CFStringRef originalString,
CFStringRef charactersToLeaveEscaped);
/*
* CFURLCreateStringByAddingPercentEscapes()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.3 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFStringRef )
CFURLCreateStringByAddingPercentEscapes(
CFAllocatorRef allocator,
CFStringRef originalString,
CFStringRef charactersToLeaveUnescaped,
CFStringRef legalURLCharactersToBeEscaped,
CFStringEncoding encoding);
/*
* CFURLCreateFromFSRef()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( CFURLRef )
CFURLCreateFromFSRef(
CFAllocatorRef allocator,
const FSRef * fsRef);
/*
* CFURLGetFSRef()
*
* Availability:
* Non-Carbon CFM: not available
* CarbonLib: in CarbonLib 1.1 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API_C( Boolean )
CFURLGetFSRef(
CFURLRef url,
FSRef * fsRef);
#if PRAGMA_ENUM_ALWAYSINT
#pragma enumsalwaysint reset
#ifdef __CFURL__RESTORE_TWOBYTEINTS
#pragma fourbyteints off
#endif
#elif PRAGMA_ENUM_OPTIONS
#pragma option enum=reset
#elif defined(__CFURL__RESTORE_PACKED_ENUMS)
#pragma options(pack_enums)
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#endif /* __CFURL__ */