1 { CFURL.h
2 Copyright (c) 1998-2013, Apple Inc. All rights reserved.
3 }
4 {
5 Modified for use with Free Pascal
6 Version 308
7 Please report any bugs to <gpc@microbizz.nl>
8 }
9
10 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
11 {$mode macpas}
12 {$modeswitch cblocks}
13 {$packenum 1}
14 {$macro on}
15 {$inline on}
16 {$calling mwpascal}
17
18 unit CFURL;
19 interface
20 {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
21 {$setc GAP_INTERFACES_VERSION := $0308}
22
23 {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
24 {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
25 {$endc}
26
27 {$ifc defined CPUPOWERPC and defined CPUI386}
28 {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
29 {$endc}
30 {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
31 {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
32 {$endc}
33
34 {$ifc not defined __ppc__ and defined CPUPOWERPC32}
35 {$setc __ppc__ := 1}
36 {$elsec}
37 {$setc __ppc__ := 0}
38 {$endc}
39 {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
40 {$setc __ppc64__ := 1}
41 {$elsec}
42 {$setc __ppc64__ := 0}
43 {$endc}
44 {$ifc not defined __i386__ and defined CPUI386}
45 {$setc __i386__ := 1}
46 {$elsec}
47 {$setc __i386__ := 0}
48 {$endc}
49 {$ifc not defined __x86_64__ and defined CPUX86_64}
50 {$setc __x86_64__ := 1}
51 {$elsec}
52 {$setc __x86_64__ := 0}
53 {$endc}
54 {$ifc not defined __arm__ and defined CPUARM}
55 {$setc __arm__ := 1}
56 {$elsec}
57 {$setc __arm__ := 0}
58 {$endc}
59 {$ifc not defined __arm64__ and defined CPUAARCH64}
60 {$setc __arm64__ := 1}
61 {$elsec}
62 {$setc __arm64__ := 0}
63 {$endc}
64
65 {$ifc defined cpu64}
66 {$setc __LP64__ := 1}
67 {$elsec}
68 {$setc __LP64__ := 0}
69 {$endc}
70
71
72 {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
73 {$error Conflicting definitions for __ppc__ and __i386__}
74 {$endc}
75
76 {$ifc defined __ppc__ and __ppc__}
77 {$setc TARGET_CPU_PPC := TRUE}
78 {$setc TARGET_CPU_PPC64 := FALSE}
79 {$setc TARGET_CPU_X86 := FALSE}
80 {$setc TARGET_CPU_X86_64 := FALSE}
81 {$setc TARGET_CPU_ARM := FALSE}
82 {$setc TARGET_CPU_ARM64 := FALSE}
83 {$setc TARGET_OS_MAC := TRUE}
84 {$setc TARGET_OS_IPHONE := FALSE}
85 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
86 {$setc TARGET_OS_EMBEDDED := FALSE}
87 {$elifc defined __ppc64__ and __ppc64__}
88 {$setc TARGET_CPU_PPC := FALSE}
89 {$setc TARGET_CPU_PPC64 := TRUE}
90 {$setc TARGET_CPU_X86 := FALSE}
91 {$setc TARGET_CPU_X86_64 := FALSE}
92 {$setc TARGET_CPU_ARM := FALSE}
93 {$setc TARGET_CPU_ARM64 := FALSE}
94 {$setc TARGET_OS_MAC := TRUE}
95 {$setc TARGET_OS_IPHONE := FALSE}
96 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
97 {$setc TARGET_OS_EMBEDDED := FALSE}
98 {$elifc defined __i386__ and __i386__}
99 {$setc TARGET_CPU_PPC := FALSE}
100 {$setc TARGET_CPU_PPC64 := FALSE}
101 {$setc TARGET_CPU_X86 := TRUE}
102 {$setc TARGET_CPU_X86_64 := FALSE}
103 {$setc TARGET_CPU_ARM := FALSE}
104 {$setc TARGET_CPU_ARM64 := FALSE}
105 {$ifc defined iphonesim}
106 {$setc TARGET_OS_MAC := FALSE}
107 {$setc TARGET_OS_IPHONE := TRUE}
108 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
109 {$elsec}
110 {$setc TARGET_OS_MAC := TRUE}
111 {$setc TARGET_OS_IPHONE := FALSE}
112 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
113 {$endc}
114 {$setc TARGET_OS_EMBEDDED := FALSE}
115 {$elifc defined __x86_64__ and __x86_64__}
116 {$setc TARGET_CPU_PPC := FALSE}
117 {$setc TARGET_CPU_PPC64 := FALSE}
118 {$setc TARGET_CPU_X86 := FALSE}
119 {$setc TARGET_CPU_X86_64 := TRUE}
120 {$setc TARGET_CPU_ARM := FALSE}
121 {$setc TARGET_CPU_ARM64 := FALSE}
122 {$ifc defined iphonesim}
123 {$setc TARGET_OS_MAC := FALSE}
124 {$setc TARGET_OS_IPHONE := TRUE}
125 {$setc TARGET_IPHONE_SIMULATOR := TRUE}
126 {$elsec}
127 {$setc TARGET_OS_MAC := TRUE}
128 {$setc TARGET_OS_IPHONE := FALSE}
129 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
130 {$endc}
131 {$setc TARGET_OS_EMBEDDED := FALSE}
132 {$elifc defined __arm__ and __arm__}
133 {$setc TARGET_CPU_PPC := FALSE}
134 {$setc TARGET_CPU_PPC64 := FALSE}
135 {$setc TARGET_CPU_X86 := FALSE}
136 {$setc TARGET_CPU_X86_64 := FALSE}
137 {$setc TARGET_CPU_ARM := TRUE}
138 {$setc TARGET_CPU_ARM64 := FALSE}
139 {$setc TARGET_OS_MAC := FALSE}
140 {$setc TARGET_OS_IPHONE := TRUE}
141 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
142 {$setc TARGET_OS_EMBEDDED := TRUE}
143 {$elifc defined __arm64__ and __arm64__}
144 {$setc TARGET_CPU_PPC := FALSE}
145 {$setc TARGET_CPU_PPC64 := FALSE}
146 {$setc TARGET_CPU_X86 := FALSE}
147 {$setc TARGET_CPU_X86_64 := FALSE}
148 {$setc TARGET_CPU_ARM := FALSE}
149 {$setc TARGET_CPU_ARM64 := TRUE}
150 {$ifc defined ios}
151 {$setc TARGET_OS_MAC := FALSE}
152 {$setc TARGET_OS_IPHONE := TRUE}
153 {$setc TARGET_OS_EMBEDDED := TRUE}
154 {$elsec}
155 {$setc TARGET_OS_MAC := TRUE}
156 {$setc TARGET_OS_IPHONE := FALSE}
157 {$setc TARGET_OS_EMBEDDED := FALSE}
158 {$endc}
159 {$setc TARGET_IPHONE_SIMULATOR := FALSE}
160 {$elsec}
161 {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
162 {$endc}
163
164 {$ifc defined __LP64__ and __LP64__ }
165 {$setc TARGET_CPU_64 := TRUE}
166 {$elsec}
167 {$setc TARGET_CPU_64 := FALSE}
168 {$endc}
169
170 {$ifc defined FPC_BIG_ENDIAN}
171 {$setc TARGET_RT_BIG_ENDIAN := TRUE}
172 {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
173 {$elifc defined FPC_LITTLE_ENDIAN}
174 {$setc TARGET_RT_BIG_ENDIAN := FALSE}
175 {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
176 {$elsec}
177 {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
178 {$endc}
179 {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
180 {$setc CALL_NOT_IN_CARBON := FALSE}
181 {$setc OLDROUTINENAMES := FALSE}
182 {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
183 {$setc OPAQUE_UPP_TYPES := TRUE}
184 {$setc OTCARBONAPPLICATION := TRUE}
185 {$setc OTKERNEL := FALSE}
186 {$setc PM_USE_SESSION_APIS := TRUE}
187 {$setc TARGET_API_MAC_CARBON := TRUE}
188 {$setc TARGET_API_MAC_OS8 := FALSE}
189 {$setc TARGET_API_MAC_OSX := TRUE}
190 {$setc TARGET_CARBON := TRUE}
191 {$setc TARGET_CPU_68K := FALSE}
192 {$setc TARGET_CPU_MIPS := FALSE}
193 {$setc TARGET_CPU_SPARC := FALSE}
194 {$setc TARGET_OS_UNIX := FALSE}
195 {$setc TARGET_OS_WIN32 := FALSE}
196 {$setc TARGET_RT_MAC_68881 := FALSE}
197 {$setc TARGET_RT_MAC_CFM := FALSE}
198 {$setc TARGET_RT_MAC_MACHO := TRUE}
199 {$setc TYPED_FUNCTION_POINTERS := TRUE}
200 {$setc TYPE_BOOL := FALSE}
201 {$setc TYPE_EXTENDED := FALSE}
202 {$setc TYPE_LONGLONG := TRUE}
203 uses MacTypes,CFBase,CFArray,CFData,CFDictionary,CFError,CFString,Files;
204 {$endc} {not MACOSALLINCLUDE}
205
206 {$ALIGN POWER}
207
208
209 type
210 CFURLPathStyle = CFIndex;
211 const
212 kCFURLPOSIXPathStyle = 0;
213 kCFURLHFSPathStyle = 1; { The use of kCFURLHFSPathStyle is deprecated. The Carbon File Manager, which uses HFS style paths, is deprecated. HFS style paths are unreliable because they can arbitrarily refer to multiple volumes if those volumes have identical volume names. You should instead use kCFURLPOSIXPathStyle wherever possible. }
214 kCFURLWindowsPathStyle = 2;
215
216 { CFURLRef moved to CFBase to avoid circular dependency with Files unit }
217
218 { CFURLs are composed of two fundamental pieces - their string, and a }
219 { (possibly NULL) base URL. A relative URL is one in which the string }
220 { by itself does not fully specify the URL (for instance "myDir/image.tiff"); }
221 { an absolute URL is one in which the string does fully specify the URL }
222 { ("file://localhost/myDir/image.tiff"). Absolute URLs always have NULL }
223 { base URLs; however, it is possible for a URL to have a NULL base, and still }
224 { not be absolute. Such a URL has only a relative string, and cannot be }
225 { resolved. Two CFURLs are considered equal if and only if their strings }
226 { are equal and their bases are equal. In other words, }
227 { "file://localhost/myDir/image.tiff" is NOT equal to the URL with relative }
228 { string "myDir/image.tiff" and base URL "file://localhost/". Clients that }
229 { need these less strict form of equality should convert all URLs to their }
230 { absolute form via CFURLCopyAbsoluteURL(), then compare the absolute forms. }
231
CFURLGetTypeIDnull232 function CFURLGetTypeID: CFTypeID; external name '_CFURLGetTypeID';
233
234 { encoding will be used both to interpret the bytes of URLBytes, and to }
235 { interpret any percent-escapes within the bytes. }
236 { Using a string encoding which isn't a superset of ASCII encoding is not }
237 { supported because CFURLGetBytes and CFURLGetByteRangeForComponent require }
238 { 7-bit ASCII characters to be stored in a single 8-bit byte. }
239 { CFStringEncodings which are a superset of ASCII encoding include MacRoman, }
240 { WindowsLatin1, ISOLatin1, NextStepLatin, ASCII, and UTF8. }
CFURLCreateWithBytesnull241 function CFURLCreateWithBytes( allocator: CFAllocatorRef; URLBytes: UInt8Ptr; length: CFIndex; encoding: CFStringEncoding; baseURL: CFURLRef ): CFURLRef; external name '_CFURLCreateWithBytes';
242
243 { Escapes any character that is not 7-bit ASCII with the byte-code }
244 { for the given encoding. If escapeWhitespace is true, whitespace }
245 { characters (' ', '\t', '\r', '\n') will be escaped also (desirable }
246 { if embedding the URL into a larger text stream like HTML) }
CFURLCreateDatanull247 function CFURLCreateData( allocator: CFAllocatorRef; url: CFURLRef; encoding: CFStringEncoding; escapeWhitespace: Boolean ): CFDataRef; external name '_CFURLCreateData';
248
249 { Any escape sequences in URLString will be interpreted via UTF-8. }
CFURLCreateWithStringnull250 function CFURLCreateWithString( allocator: CFAllocatorRef; URLString: CFStringRef; baseURL: CFURLRef ): CFURLRef; external name '_CFURLCreateWithString';
251
252 {#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED}
253
254 { Create an absolute URL directly, without requiring the extra step }
255 { of calling CFURLCopyAbsoluteURL(). If useCompatibilityMode is }
256 { true, the rules historically used on the web are used to resolve }
257 { relativeString against baseURL - these rules are generally listed }
258 { in the RFC as optional or alternate interpretations. Otherwise, }
259 { the strict rules from the RFC are used. The major differences are }
260 { that in compatibility mode, we are lenient of the scheme appearing }
261 { in relative portion, leading "../" components are removed from the }
262 { final URL's path, and if the relative portion contains only }
263 { resource specifier pieces (query, parameters, and fragment), then }
264 { the last path component of the base URL will not be deleted. }
265 { Using a string encoding which isn't a superset of ASCII encoding is not }
266 { supported because CFURLGetBytes and CFURLGetByteRangeForComponent require }
267 { 7-bit ASCII characters to be stored in a single 8-bit byte. }
268 { CFStringEncodings which are a superset of ASCII encoding include MacRoman, }
269 { WindowsLatin1, ISOLatin1, NextStepLatin, ASCII, and UTF8. }
CFURLCreateAbsoluteURLWithBytesnull270 function CFURLCreateAbsoluteURLWithBytes( alloc: CFAllocatorRef; relativeURLBytes: UInt8Ptr; length: CFIndex; encoding: CFStringEncoding; baseURL: CFURLRef; useCompatibilityMode: Boolean ): CFURLRef; external name '_CFURLCreateAbsoluteURLWithBytes';
271 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
272 {#endif}
273
274 { filePath should be the URL's path expressed as a path of the type }
275 { fsType. If filePath is not absolute, the resulting URL will be }
276 { considered relative to the current working directory (evaluated }
277 { at creation time). isDirectory determines whether filePath is }
278 { treated as a directory path when resolving against relative path }
279 { components }
CFURLCreateWithFileSystemPathnull280 function CFURLCreateWithFileSystemPath( allocator: CFAllocatorRef; filePath: CFStringRef; pathStyle: CFURLPathStyle; isDirectory: Boolean ): CFURLRef; external name '_CFURLCreateWithFileSystemPath';
281
CFURLCreateFromFileSystemRepresentationnull282 function CFURLCreateFromFileSystemRepresentation( allocator: CFAllocatorRef; buffer: CStringPtr; bufLen: CFIndex; isDirectory: Boolean ): CFURLRef; external name '_CFURLCreateFromFileSystemRepresentation';
283
284 { The path style of the baseURL must match the path style of the relative }
285 { url or the results are undefined. If the provided filePath looks like an }
286 { absolute path ( starting with '/' if pathStyle is kCFURLPosixPathStyle, }
287 { not starting with ':' for kCFURLHFSPathStyle, or starting with what looks }
288 { like a drive letter and colon for kCFURLWindowsPathStyle ) then the baseURL }
289 { is ignored. }
CFURLCreateWithFileSystemPathRelativeToBasenull290 function CFURLCreateWithFileSystemPathRelativeToBase( allocator: CFAllocatorRef; filePath: CFStringRef; pathStyle: CFURLPathStyle; isDirectory: Boolean; baseURL: CFURLRef ): CFURLRef; external name '_CFURLCreateWithFileSystemPathRelativeToBase';
291
CFURLCreateFromFileSystemRepresentationRelativeToBasenull292 function CFURLCreateFromFileSystemRepresentationRelativeToBase( allocator: CFAllocatorRef; buffer: CStringPtr; bufLen: CFIndex; isDirectory: Boolean; baseURL: CFURLRef ): CFURLRef; external name '_CFURLCreateFromFileSystemRepresentationRelativeToBase';
293
294 { Fills buffer with the file system's native representation of }
295 { url's path. No more than maxBufLen bytes are written to buffer. }
296 { The buffer should be at least the maximum path length for }
297 { the file system in question to avoid failures for insufficiently }
298 { large buffers. If resolveAgainstBase is true, the url's relative }
299 { portion is resolved against its base before the path is computed. }
300 { Returns success or failure. }
CFURLGetFileSystemRepresentationnull301 function CFURLGetFileSystemRepresentation( url: CFURLRef; resolveAgainstBase: Boolean; buffer: CStringPtr; maxBufLen: CFIndex ): Boolean; external name '_CFURLGetFileSystemRepresentation';
302
303 { Creates a new URL by resolving the relative portion of relativeURL against its base. }
CFURLCopyAbsoluteURLnull304 function CFURLCopyAbsoluteURL( relativeURL: CFURLRef ): CFURLRef; external name '_CFURLCopyAbsoluteURL';
305
306 { Returns the URL's string. }
CFURLGetStringnull307 function CFURLGetString( anURL: CFURLRef ): CFStringRef; external name '_CFURLGetString';
308
309 { Returns the base URL if it exists }
CFURLGetBaseURLnull310 function CFURLGetBaseURL( anURL: CFURLRef ): CFURLRef; external name '_CFURLGetBaseURL';
311
312 {
313 All URLs can be broken into two pieces - the scheme (preceding the
314 first colon) and the resource specifier (following the first colon).
315 Most URLs are also "standard" URLs conforming to RFC 1808 (available
316 from www.w3c.org). This category includes URLs of the file, http,
317 https, and ftp schemes, to name a few. Standard URLs start the
318 resource specifier with two slashes ("//"), and can be broken into
319 four distinct pieces - the scheme, the net location, the path, and
320 further resource specifiers (typically an optional parameter, query,
321 and/or fragment). The net location appears immediately following
322 the two slashes and goes up to the next slash; it's format is
323 scheme-specific, but is usually composed of some or all of a username,
324 password, host name, and port. The path is a series of path components
325 separated by slashes; if the net location is present, the path always
326 begins with a slash. Standard URLs can be relative to another URL,
327 in which case at least the scheme and possibly other pieces as well
328 come from the base URL (see RFC 1808 for precise details when resolving
329 a relative URL against its base). The full URL is therefore
330
331 <scheme> "://" <net location> <path, always starting with slash> <add'l resource specifiers>
332
333 If a given CFURL can be decomposed (that is, conforms to RFC 1808), you
334 can ask for each of the four basic pieces (scheme, net location, path,
335 and resource specifer) separately, as well as for its base URL. The
336 basic pieces are returned with any percent escape sequences still in
337 place (although note that the scheme may not legally include any
338 percent escapes); this is to allow the caller to distinguish between
339 percent sequences that may have syntactic meaning if replaced by the
340 character being escaped (for instance, a '/' in a path component).
341 Since only the individual schemes know which characters are
342 syntactically significant, CFURL cannot safely replace any percent
343 escape sequences. However, you can use
344 CFURLCreateStringByReplacingPercentEscapes() to create a new string with
345 the percent escapes removed; see below.
346
347 If a given CFURL can not be decomposed, you can ask for its scheme and its
348 resource specifier; asking it for its net location or path will return NULL.
349
350 To get more refined information about the components of a decomposable
351 CFURL, you may ask for more specific pieces of the URL, expressed with
352 the percent escapes removed. The available functions are CFURLCopyHostName(),
353 CFURLGetPortNumber() (returns an Int32), CFURLCopyUserName(),
354 CFURLCopyPassword(), CFURLCopyQuery(), CFURLCopyParameters(), and
355 CFURLCopyFragment(). Because the parameters, query, and fragment of an
356 URL may contain scheme-specific syntaxes, these methods take a second
357 argument, giving a list of characters which should NOT be replaced if
358 percent escaped. For instance, the ftp parameter syntax gives simple
359 key-value pairs as "<key>=<value>;" Clearly if a key or value includes
360 either '=' or ';', it must be escaped to avoid corrupting the meaning of
361 the parameters, so the caller may request the parameter string as
362
363 CFStringRef myParams = CFURLCopyParameters(ftpURL, CFSTR("=;%"));
364
365 requesting that all percent escape sequences be replaced by the represented
366 characters, except for escaped '=', '%' or ';' characters. Pass the empty
367 string (CFSTR("")) to request that all percent escapes be replaced, or NULL
368 to request that none be.
369 }
370
371 { Returns true if anURL conforms to RFC 1808 }
CFURLCanBeDecomposednull372 function CFURLCanBeDecomposed( anURL: CFURLRef ): Boolean; external name '_CFURLCanBeDecomposed';
373
374 { The next several methods leave any percent escape sequences intact }
375
CFURLCopySchemenull376 function CFURLCopyScheme( anURL: CFURLRef ): CFStringRef; external name '_CFURLCopyScheme';
377
378 { NULL if CFURLCanBeDecomposed(anURL) is false }
CFURLCopyNetLocationnull379 function CFURLCopyNetLocation( anURL: CFURLRef ): CFStringRef; external name '_CFURLCopyNetLocation';
380
381 { NULL if CFURLCanBeDecomposed(anURL) is false; also does not resolve the URL }
382 { against its base. See also CFURLCopyAbsoluteURL(). Note that, strictly }
383 { speaking, any leading '/' is not considered part of the URL's path, although }
384 { its presence or absence determines whether the path is absolute. }
385 { CFURLCopyPath()'s return value includes any leading slash (giving the path }
386 { the normal POSIX appearance); CFURLCopyStrictPath()'s return value omits any }
387 { leading slash, and uses isAbsolute to report whether the URL's path is absolute. }
388
389 { CFURLCopyFileSystemPath() returns the URL's path as a file system path for the }
390 { given path style. All percent escape sequences are replaced. The URL is not }
391 { resolved against its base before computing the path. }
CFURLCopyPathnull392 function CFURLCopyPath( anURL: CFURLRef ): CFStringRef; external name '_CFURLCopyPath';
393
CFURLCopyStrictPathnull394 function CFURLCopyStrictPath( anURL: CFURLRef; var isAbsolute: Boolean ): CFStringRef; external name '_CFURLCopyStrictPath';
395
CFURLCopyFileSystemPathnull396 function CFURLCopyFileSystemPath( anURL: CFURLRef; pathStyle: CFURLPathStyle ): CFStringRef; external name '_CFURLCopyFileSystemPath';
397
398 { Returns whether anURL's path represents a directory }
399 { (true returned) or a simple file (false returned) }
CFURLHasDirectoryPathnull400 function CFURLHasDirectoryPath( anURL: CFURLRef ): Boolean; external name '_CFURLHasDirectoryPath';
401
402 { Any additional resource specifiers after the path. For URLs }
403 { that cannot be decomposed, this is everything except the scheme itself. }
CFURLCopyResourceSpecifiernull404 function CFURLCopyResourceSpecifier( anURL: CFURLRef ): CFStringRef; external name '_CFURLCopyResourceSpecifier';
405
CFURLCopyHostNamenull406 function CFURLCopyHostName( anURL: CFURLRef ): CFStringRef; external name '_CFURLCopyHostName';
407
CFURLGetPortNumbernull408 function CFURLGetPortNumber( anURL: CFURLRef ): SInt32; external name '_CFURLGetPortNumber'; { Returns -1 if no port number is specified }
409
CFURLCopyUserNamenull410 function CFURLCopyUserName( anURL: CFURLRef ): CFStringRef; external name '_CFURLCopyUserName';
411
CFURLCopyPasswordnull412 function CFURLCopyPassword( anURL: CFURLRef ): CFStringRef; external name '_CFURLCopyPassword';
413
414 { These remove all percent escape sequences except those for }
415 { characters in charactersToLeaveEscaped. If charactersToLeaveEscaped }
416 { is empty (""), all percent escape sequences are replaced by their }
417 { corresponding characters. If charactersToLeaveEscaped is NULL, }
418 { then no escape sequences are removed at all }
CFURLCopyParameterStringnull419 function CFURLCopyParameterString( anURL: CFURLRef; charactersToLeaveEscaped: CFStringRef ): CFStringRef; external name '_CFURLCopyParameterString';
420
CFURLCopyQueryStringnull421 function CFURLCopyQueryString( anURL: CFURLRef; charactersToLeaveEscaped: CFStringRef ): CFStringRef; external name '_CFURLCopyQueryString';
422
CFURLCopyFragmentnull423 function CFURLCopyFragment( anURL: CFURLRef; charactersToLeaveEscaped: CFStringRef ): CFStringRef; external name '_CFURLCopyFragment';
424
CFURLCopyLastPathComponentnull425 function CFURLCopyLastPathComponent( url: CFURLRef ): CFStringRef; external name '_CFURLCopyLastPathComponent';
426
CFURLCopyPathExtensionnull427 function CFURLCopyPathExtension( url: CFURLRef ): CFStringRef; external name '_CFURLCopyPathExtension';
428
429 { These functions all treat the base URL of the supplied url as }
430 { invariant. In other words, the URL returned will always have }
431 { the same base as the URL supplied as an argument. }
432
CFURLCreateCopyAppendingPathComponentnull433 function CFURLCreateCopyAppendingPathComponent( allocator: CFAllocatorRef; url: CFURLRef; pathComponent: CFStringRef; isDirectory: Boolean ): CFURLRef; external name '_CFURLCreateCopyAppendingPathComponent';
434
CFURLCreateCopyDeletingLastPathComponentnull435 function CFURLCreateCopyDeletingLastPathComponent( allocator: CFAllocatorRef; url: CFURLRef ): CFURLRef; external name '_CFURLCreateCopyDeletingLastPathComponent';
436
CFURLCreateCopyAppendingPathExtensionnull437 function CFURLCreateCopyAppendingPathExtension( allocator: CFAllocatorRef; url: CFURLRef; extension: CFStringRef ): CFURLRef; external name '_CFURLCreateCopyAppendingPathExtension';
438
CFURLCreateCopyDeletingPathExtensionnull439 function CFURLCreateCopyDeletingPathExtension( allocator: CFAllocatorRef; url: CFURLRef ): CFURLRef; external name '_CFURLCreateCopyDeletingPathExtension';
440
441 {#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED}
442 { Fills buffer with the bytes for url, returning the number of bytes }
443 { filled. If buffer is of insufficient size, returns -1 and no bytes }
444 { are placed in buffer. If buffer is NULL, the needed length is }
445 { computed and returned. The returned bytes are the original bytes }
446 { from which the URL was created; if the URL was created from a }
447 { string, the bytes will be the bytes of the string encoded via UTF-8 }
CFURLGetBytesnull448 function CFURLGetBytes( url: CFURLRef; buffer: CStringPtr; bufferLength: CFIndex ): CFIndex; external name '_CFURLGetBytes';
449 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
450
451 type
452 CFURLComponentType = CFIndex;
453 const
454 kCFURLComponentScheme = 1;
455 kCFURLComponentNetLocation = 2;
456 kCFURLComponentPath = 3;
457 kCFURLComponentResourceSpecifier = 4;
458 kCFURLComponentUser = 5;
459 kCFURLComponentPassword = 6;
460 kCFURLComponentUserInfo = 7;
461 kCFURLComponentHost = 8;
462 kCFURLComponentPort = 9;
463 kCFURLComponentParameterString = 10;
464 kCFURLComponentQuery = 11;
465 kCFURLComponentFragment = 12;
466
467 {
468 Gets the range of the requested component in the bytes of url, as
469 returned by CFURLGetBytes(). This range is only good for use in the
470 bytes returned by CFURLGetBytes!
471
472 If non-NULL, rangeIncludingSeparators gives the range of component
473 including the sequences that separate component from the previous and
474 next components. If there is no previous or next component, that end of
475 rangeIncludingSeparators will match the range of the component itself.
476 If url does not contain the given component type, (kCFNotFound, 0) is
477 returned, and rangeIncludingSeparators is set to the location where the
478 component would be inserted. Some examples -
479
480 For the URL http://www.apple.com/hotnews/
481
482 Component returned range rangeIncludingSeparators
483 scheme (0, 4) (0, 7)
484 net location (7, 13) (4, 16)
485 path (20, 9) (20, 9)
486 resource specifier (kCFNotFound, 0) (29, 0)
487 user (kCFNotFound, 0) (7, 0)
488 password (kCFNotFound, 0) (7, 0)
489 user info (kCFNotFound, 0) (7, 0)
490 host (7, 13) (4, 16)
491 port (kCFNotFound, 0) (20, 0)
492 parameter (kCFNotFound, 0) (29, 0)
493 query (kCFNotFound, 0) (29, 0)
494 fragment (kCFNotFound, 0) (29, 0)
495
496
497 For the URL ./relPath/file.html#fragment
498
499 Component returned range rangeIncludingSeparators
500 scheme (kCFNotFound, 0) (0, 0)
501 net location (kCFNotFound, 0) (0, 0)
502 path (0, 19) (0, 20)
503 resource specifier (20, 8) (19, 9)
504 user (kCFNotFound, 0) (0, 0)
505 password (kCFNotFound, 0) (0, 0)
506 user info (kCFNotFound, 0) (0, 0)
507 host (kCFNotFound, 0) (0, 0)
508 port (kCFNotFound, 0) (0, 0)
509 parameter (kCFNotFound, 0) (19, 0)
510 query (kCFNotFound, 0) (19, 0)
511 fragment (20, 8) (19, 9)
512
513
514 For the URL scheme://user:pass@host:1/path/path2/file.html;params?query#fragment
515
516 Component returned range rangeIncludingSeparators
517 scheme (0, 6) (0, 9)
518 net location (9, 16) (6, 19)
519 path (25, 21) (25, 22)
520 resource specifier (47, 21) (46, 22)
521 user (9, 4) (6, 8)
522 password (14, 4) (13, 6)
523 user info (9, 9) (6, 13)
524 host (19, 4) (18, 6)
525 port (24, 1) (23, 2)
526 parameter (47, 6) (46, 8)
527 query (54, 5) (53, 7)
528 fragment (60, 8) (59, 9)
529 }
CFURLGetByteRangeForComponentnull530 function CFURLGetByteRangeForComponent( url: CFURLRef; component: CFURLComponentType; var rangeIncludingSeparators: CFRange ): CFRange; external name '_CFURLGetByteRangeForComponent';
531 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
532 {#endif}
533
534 { Returns a string with any percent escape sequences that do NOT }
535 { correspond to characters in charactersToLeaveEscaped with their }
536 { equivalent. Returns NULL on failure (if an invalid percent sequence }
537 { is encountered), or the original string (retained) if no characters }
538 { need to be replaced. Pass NULL to request that no percent escapes be }
539 { replaced, or the empty string (CFSTR("")) to request that all percent }
540 { escapes be replaced. Uses UTF8 to interpret percent escapes. }
CFURLCreateStringByReplacingPercentEscapesnull541 function CFURLCreateStringByReplacingPercentEscapes( allocator: CFAllocatorRef; originalString: CFStringRef; charactersToLeaveEscaped: CFStringRef ): CFStringRef; external name '_CFURLCreateStringByReplacingPercentEscapes';
542
543 {#if MAC_OS_X_VERSION_10_3 <= MAC_OS_X_VERSION_MAX_ALLOWED}
544 { As above, but allows you to specify the encoding to use when interpreting percent escapes }
CFURLCreateStringByReplacingPercentEscapesUsingEncodingnull545 function CFURLCreateStringByReplacingPercentEscapesUsingEncoding( allocator: CFAllocatorRef; origString: CFStringRef; charsToLeaveEscaped: CFStringRef; encoding: CFStringEncoding ): CFStringRef; external name '_CFURLCreateStringByReplacingPercentEscapesUsingEncoding';
546 (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
547 {#endif}
548
549 { Creates a copy or originalString, replacing certain characters with }
550 { the equivalent percent escape sequence based on the encoding specified. }
551 { If the originalString does not need to be modified (no percent escape }
552 { sequences are missing), may retain and return originalString. }
553 { If you are uncertain of the correct encoding, you should use UTF-8, }
554 { which is the encoding designated by RFC 2396 as the correct encoding }
555 { for use in URLs. The characters so escaped are all characters that }
556 { are not legal URL characters (based on RFC 2396), plus any characters }
557 { in legalURLCharactersToBeEscaped, less any characters in }
558 { charactersToLeaveUnescaped. To simply correct any non-URL characters }
559 { in an otherwise correct URL string, do: }
560
561 { newString = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, origString, NULL, NULL, kCFStringEncodingUTF8); }
CFURLCreateStringByAddingPercentEscapesnull562 function CFURLCreateStringByAddingPercentEscapes( allocator: CFAllocatorRef; originalString: CFStringRef; charactersToLeaveUnescaped: CFStringRef; legalURLCharactersToBeEscaped: CFStringRef; encoding: CFStringEncoding ): CFStringRef; external name '_CFURLCreateStringByAddingPercentEscapes';
563
564
565 { #if (TARGET_OS_MAC || TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) || CF_BUILDING_CF || NSBUILDINGFOUNDATION }
566 { CF_IMPLICIT_BRIDGING_DISABLED }
567
568 {
569 CFURLIsFileReferenceURL
570
571 Returns whether the URL is a file reference URL.
572
573 Parameters
574 url
575 The URL specifying the resource.
576 }
CFURLIsFileReferenceURLnull577 function CFURLIsFileReferenceURL( url: CFURLRef ): Boolean; external name '_CFURLIsFileReferenceURL';
578 (* CF_AVAILABLE_STARTING(10_9, 7_0) *)
579
580 {
581 CFURLCreateFileReferenceURL
582
583 Returns a new file reference URL that refers to the same resource as a specified URL.
584
585 Parameters
586 allocator
587 The memory allocator for creating the new URL.
588 url
589 The file URL specifying the resource.
590 error
591 On output when the result is NULL, the error that occurred. This parameter is optional; if you do not wish the error returned, pass NULL here. The caller is responsible for releasing a valid output error.
592
593 Return Value
594 The new file reference URL, or NULL if an error occurs.
595
596 Discussion
597 File reference URLs use a URL path syntax that identifies a file system object by reference, not by path. This form of file URL remains valid when the file system path of the URL’s underlying resource changes. An error will occur if the url parameter is not a file URL. File reference URLs cannot be created to file system objects which do not exist or are not reachable. In some areas of the file system hierarchy, file reference URLs cannot be generated to the leaf node of the URL path. A file reference URL's path should never be persistently stored because is not valid across system restarts, and across remounts of volumes -- if you want to create a persistent reference to a file system object, use a bookmark (see CFURLCreateBookmarkData). If this function returns NULL, the optional error is populated. This function is currently applicable only to URLs for file system resources.
598 Symbol is present in iOS 4, but performs no operation.
599 }
CFURLCreateFileReferenceURLnull600 function CFURLCreateFileReferenceURL( allocator: CFAllocatorRef; url: CFURLRef; var error: CFErrorRef ): CFURLRef; external name '_CFURLCreateFileReferenceURL';
601 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
602
603
604 {
605 CFURLCreateFilePathURL
606
607 Returns a new file path URL that refers to the same resource as a specified URL.
608
609 Parameters
610 allocator
611 The memory allocator for creating the new URL.
612 url
613 The file URL specifying the resource.
614 error
615 On output when the result is NULL, the error that occurred. This parameter is optional; if you do not wish the error returned, pass NULL here. The caller is responsible for releasing a valid output error.
616
617 Return Value
618 The new file path URL, or NULL if an error occurs.
619
620 Discussion
621 File path URLs use a file system style path. An error will occur if the url parameter is not a file URL. A file reference URL's resource must exist and be reachable to be converted to a file path URL. If this function returns NULL, the optional error is populated. This function is currently applicable only to URLs for file system resources.
622 Symbol is present in iOS 4, but performs no operation.
623 }
CFURLCreateFilePathURLnull624 function CFURLCreateFilePathURL( allocator: CFAllocatorRef; url: CFURLRef; var error: CFErrorRef ): CFURLRef; external name '_CFURLCreateFilePathURL';
625 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
626
627 { CF_IMPLICIT_BRIDGING_ENABLED }
628 {#ifndef CF_OPEN_SOURCE}
629
630 // Note: CFURLCreateFromFSRef and CFURLGetFSRef have never been functional on iOS because the Carbon File Manager is not on iOS.
631 {$ifc TARGET_OS_MAC}
632
CFURLCreateFromFSRefnull633 function CFURLCreateFromFSRef( allocator: CFAllocatorRef; const (*var*) fsRef_: FSRef ): CFURLRef; external name '_CFURLCreateFromFSRef';
634 (* CF_DEPRECATED(10_0, 10_9, 2_0, 7_0) *)
635
CFURLGetFSRefnull636 function CFURLGetFSRef( url: CFURLRef; var fsRef_: FSRef ): Boolean; external name '_CFURLGetFSRef';
637 (* CF_DEPRECATED(10_0, 10_9, 2_0, 7_0) *)
638
639 {$endc} {TARGET_OS_MAC}
640
641 {#endif} // !CF_OPEN_SOURCE
642
643 { Resource access
644
645 The behavior of resource value caching is slightly different between the NSURL and CFURL API.
646
647 When the NSURL methods which get, set, or use cached resource values are used from the main thread, resource values cached by the URL (except those added as temporary properties) are invalidated the next time the main thread's run loop runs.
648
649 The CFURL functions do not automatically clear any resource values cached by the URL. The client has complete control over the cache lifetime. If you are using CFURL API, you must use CFURLClearResourcePropertyCacheForKey or CFURLClearResourcePropertyCache to clear cached resource values.
650 }
651
652
653 {
654 CFURLCopyResourcePropertyForKey
655
656 Returns the resource value identified by a given resource key.
657
658 Parameters
659 url
660 The URL specifying the resource.
661 key
662 The resource key that identifies the resource property.
663 propertyValueTypeRefPtr
664 On output when the result is true, the resource value or NULL.
665 error
666 On output when the result is false, the error that occurred. This parameter is optional; if you do not wish the error returned, pass NULL here. The caller is responsible for releasing a valid output error.
667
668 Return Value
669 true if propertyValueTypeRefPtr is successfully populated; false if an error occurs.
670
671 Discussion
672 CFURLCopyResourcePropertyForKey first checks if the URL object already caches the resource value. If so, it returns the cached resource value to the caller. If not, then CFURLCopyResourcePropertyForKey synchronously obtains the resource value from the backing store, adds the resource value to the URL object's cache, and returns the resource value to the caller. The type of the resource value varies by resource property (see resource key definitions). If this function returns true and propertyValueTypeRefPtr is populated with NULL, it means the resource property is not available for the specified resource and no errors occurred when determining the resource property was not available. If this function returns false, the optional error is populated. This function is currently applicable only to URLs for file system resources.
673 Symbol is present in iOS 4, but performs no operation.
674 }
CFURLCopyResourcePropertyForKeynull675 function CFURLCopyResourcePropertyForKey( url: CFURLRef; key: CFStringRef; propertyValueTypeRefPtr: UnivPtr; error: CFErrorRefPtr ): Boolean; external name '_CFURLCopyResourcePropertyForKey';
676 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
677
678
679 {
680 CFURLCopyResourcePropertiesForKeys
681
682 Returns the resource values identified by specified array of resource keys.
683
684 Parameters
685 url
686 The URL specifying the resource.
687 keys
688 An array of resource keys that identify the resource properties.
689 error
690 On output when the result is NULL, the error that occurred. This parameter is optional; if you do not wish the error returned, pass NULL here. The caller is responsible for releasing a valid output error.
691
692 Return Value
693 A dictionary of resource values indexed by resource key; NULL if an error occurs.
694
695 Discussion
696 CFURLCopyResourcePropertiesForKeys first checks if the URL object already caches the resource values. If so, it returns the cached resource values to the caller. If not, then CFURLCopyResourcePropertyForKey synchronously obtains the resource values from the backing store, adds the resource values to the URL object's cache, and returns the resource values to the caller. The type of the resource values vary by property (see resource key definitions). If the result dictionary does not contain a resource value for one or more of the requested resource keys, it means those resource properties are not available for the specified resource and no errors occurred when determining those resource properties were not available. If this function returns NULL, the optional error is populated. This function is currently applicable only to URLs for file system resources.
697 Symbol is present in iOS 4, but performs no operation.
698 }
CFURLCopyResourcePropertiesForKeysnull699 function CFURLCopyResourcePropertiesForKeys( url: CFURLRef; keys: CFArrayRef; error: CFErrorRefPtr ): CFDictionaryRef; external name '_CFURLCopyResourcePropertiesForKeys';
700 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
701
702
703 {
704 CFURLSetResourcePropertyForKey
705
706 Sets the resource value identified by a given resource key.
707
708 Parameters
709 url
710 The URL specifying the resource.
711 key
712 The resource key that identifies the resource property.
713 propertyValue
714 The resource value.
715 error
716 On output when the result is false, the error that occurred. This parameter is optional; if you do not wish the error returned, pass NULL here. The caller is responsible for releasing a valid output error.
717
718 Return Value
719 true if the attempt to set the resource value completed with no errors; otherwise, false.
720
721 Discussion
722 CFURLSetResourcePropertyForKey writes the new resource value out to the backing store. Attempts to set a read-only resource property or to set a resource property not supported by the resource are ignored and are not considered errors. If this function returns false, the optional error is populated. This function is currently applicable only to URLs for file system resources.
723 Symbol is present in iOS 4, but performs no operation.
724 }
CFURLSetResourcePropertyForKeynull725 function CFURLSetResourcePropertyForKey( url: CFURLRef; key: CFStringRef; propertyValue: CFTypeRef; error: CFErrorRefPtr ): Boolean; external name '_CFURLSetResourcePropertyForKey';
726 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
727
728
729 {
730 CFURLSetResourcePropertiesForKeys
731
732 Sets any number of resource values of a URL's resource.
733
734 Parameters
735 url
736 The URL specifying the resource.
737 keyedPropertyValues
738 A dictionary of resource values indexed by resource keys.
739 error
740 On output when the result is false, the error that occurred. This parameter is optional; if you do not wish the error returned, pass NULL here. The caller is responsible for releasing a valid output error.
741
742 Return Value
743 true if the attempt to set the resource values completed with no errors; otherwise, false.
744
745 Discussion
746 CFURLSetResourcePropertiesForKeys writes the new resource values out to the backing store. Attempts to set read-only resource properties or to set resource properties not supported by the resource are ignored and are not considered errors. If an error occurs after some resource properties have been successfully changed, the userInfo dictionary in the returned error contains an array of resource keys that were not set with the key kCFURLKeysOfUnsetValuesKey. The order in which the resource values are set is not defined. If you need to guarantee the order resource values are set, you should make multiple requests to CFURLSetResourcePropertiesForKeys or CFURLSetResourcePropertyForKey to guarantee the order. If this function returns false, the optional error is populated. This function is currently applicable only to URLs for file system resources.
747 Symbol is present in iOS 4, but performs no operation.
748 }
CFURLSetResourcePropertiesForKeysnull749 function CFURLSetResourcePropertiesForKeys( url: CFURLRef; keyedPropertyValues: CFDictionaryRef; error: CFErrorRefPtr ): Boolean; external name '_CFURLSetResourcePropertiesForKeys';
750 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
751
752
753 var kCFURLKeysOfUnsetValuesKey: CFStringRef; external name '_kCFURLKeysOfUnsetValuesKey'; (* attribute const *)
754 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
755 { Key for the resource properties that have not been set after the CFURLSetResourcePropertiesForKeys function returns an error, returned as an array of of CFString objects. }
756
757
758 {
759 CFURLClearResourcePropertyCacheForKey
760
761 Discards a cached resource value of a URL.
762
763 Parameters
764 url
765 The URL specifying the resource.
766 key
767 The resource key that identifies the resource property.
768
769 Discussion
770 Discarding a cached resource value may discard other cached resource values, because some resource values are cached as a set of values and because some resource values depend on other resource values (temporary properties have no dependencies). This function is currently applicable only to URLs for file system resources.
771 Symbol is present in iOS 4, but performs no operation.
772 }
773 procedure CFURLClearResourcePropertyCacheForKey( url: CFURLRef; key: CFStringRef ); external name '_CFURLClearResourcePropertyCacheForKey';
774 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
775
776
777 {
778 CFURLClearResourcePropertyCache
779
780 Discards all cached resource values of a URL.
781
782 Parameters
783 url
784 The URL specifying the resource.
785
786 Discussion
787 All temporary properties are also cleared from the URL object's cache. This function is currently applicable only to URLs for file system resources.
788 Symbol is present in iOS 4, but performs no operation.
789 }
790 procedure CFURLClearResourcePropertyCache( url: CFURLRef ); external name '_CFURLClearResourcePropertyCache';
791 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
792
793
794 {
795 CFURLSetTemporaryResourcePropertyForKey
796
797 Sets a temporary resource value on the URL object.
798
799 Parameters
800 url
801 The URL object.
802 key
803 The resource key that identifies the temporary resource property.
804 propertyValue
805 The resource value.
806
807 Discussion
808 Temporary properties are for client use. Temporary properties exist only in memory and are never written to the resource's backing store. Once set, a temporary value can be copied from the URL object with CFURLCopyResourcePropertyForKey and CFURLCopyResourcePropertiesForKeys. To remove a temporary value from the URL object, use CFURLClearResourcePropertyCacheForKey. Temporary values must be valid Core Foundation types, and will be retained by CFURLSetTemporaryResourcePropertyForKey. Care should be taken to ensure the key that identifies a temporary resource property is unique and does not conflict with system defined keys (using reverse domain name notation in your temporary resource property keys is recommended). This function is currently applicable only to URLs for file system resources.
809 Symbol is present in iOS 4, but performs no operation.
810 }
811 procedure CFURLSetTemporaryResourcePropertyForKey( url: CFURLRef; key: CFStringRef; propertyValue: CFTypeRef ); external name '_CFURLSetTemporaryResourcePropertyForKey';
812 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
813
814
815 {
816 CFURLResourceIsReachable
817
818 Returns whether the URL's resource exists and is reachable.
819
820 Parameters
821 url
822 The URL object.
823 error
824 On output when the result is false, the error that occurred. This parameter is optional; if you do not wish the error returned, pass NULL here. The caller is responsible for releasing a valid output error.
825
826 Return Value
827 true if the resource is reachable; otherwise, false.
828
829 Discussion
830 CFURLResourceIsReachable synchronously checks if the resource's backing store is reachable. Checking reachability is appropriate when making decisions that do not require other immediate operations on the resource, e.g. periodic maintenance of UI state that depends on the existence of a specific document. When performing operations such as opening a file or copying resource properties, it is more efficient to simply try the operation and handle failures. This function is currently applicable only to URLs for file system resources. If this function returns false, the optional error is populated. For other URL types, false is returned.
831 Symbol is present in iOS 4, but performs no operation.
832 }
CFURLResourceIsReachablenull833 function CFURLResourceIsReachable( url: CFURLRef; error: CFErrorRefPtr ): Boolean; external name '_CFURLResourceIsReachable';
834 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
835
836 { CF_IMPLICIT_BRIDGING_ENABLED }
837
838
839 { Properties of File System Resources }
840
841 var kCFURLNameKey: CFStringRef; external name '_kCFURLNameKey'; (* attribute const *)
842 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
843 { The resource name provided by the file system (Read-write, value type CFString) }
844
845 var kCFURLLocalizedNameKey: CFStringRef; external name '_kCFURLLocalizedNameKey'; (* attribute const *)
846 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
847 { Localized or extension-hidden name as displayed to users (Read-only, value type CFString) }
848
849 var kCFURLIsRegularFileKey: CFStringRef; external name '_kCFURLIsRegularFileKey'; (* attribute const *)
850 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
851 { True for regular files (Read-only, value type CFBoolean) }
852
853 var kCFURLIsDirectoryKey: CFStringRef; external name '_kCFURLIsDirectoryKey'; (* attribute const *)
854 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
855 { True for directories (Read-only, CFBoolean) }
856
857 var kCFURLIsSymbolicLinkKey: CFStringRef; external name '_kCFURLIsSymbolicLinkKey'; (* attribute const *)
858 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
859 { True for symlinks (Read-only, value type CFBoolean) }
860
861 var kCFURLIsVolumeKey: CFStringRef; external name '_kCFURLIsVolumeKey'; (* attribute const *)
862 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
863 { True for the root directory of a volume (Read-only, value type CFBoolean) }
864
865 var kCFURLIsPackageKey: CFStringRef; external name '_kCFURLIsPackageKey'; (* attribute const *)
866 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
867 { True for packaged directories (Read-only 10_6 and 10_7, read-write 10_8, value type CFBoolean). Note: You can only set or clear this property on directories; if you try to set this property on non-directory objects, the property is ignored. If the directory is a package for some other reason (extension type, etc), setting this property to false will have no effect. }
868
869 var kCFURLIsSystemImmutableKey: CFStringRef; external name '_kCFURLIsSystemImmutableKey'; (* attribute const *)
870 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
871 { True for system-immutable resources (Read-write, value type CFBoolean) }
872
873 var kCFURLIsUserImmutableKey: CFStringRef; external name '_kCFURLIsUserImmutableKey'; (* attribute const *)
874 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
875 { True for user-immutable resources (Read-write, value type CFBoolean) }
876
877 var kCFURLIsHiddenKey: CFStringRef; external name '_kCFURLIsHiddenKey'; (* attribute const *)
878 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
879 { True for resources normally not displayed to users (Read-write, value type CFBoolean). Note: If the resource is a hidden because its name starts with a period, setting this property to false will not change the property. }
880
881 var kCFURLHasHiddenExtensionKey: CFStringRef; external name '_kCFURLHasHiddenExtensionKey'; (* attribute const *)
882 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
883 { True for resources whose filename extension is removed from the localized name property (Read-write, value type CFBoolean) }
884
885 var kCFURLCreationDateKey: CFStringRef; external name '_kCFURLCreationDateKey'; (* attribute const *)
886 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
887 { The date the resource was created (Read-write, value type CFDate) }
888
889 var kCFURLContentAccessDateKey: CFStringRef; external name '_kCFURLContentAccessDateKey'; (* attribute const *)
890 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
891 { The date the resource was last accessed (Read-only, value type CFDate) }
892
893 var kCFURLContentModificationDateKey: CFStringRef; external name '_kCFURLContentModificationDateKey'; (* attribute const *)
894 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
895 { The time the resource content was last modified (Read-write, value type CFDate) }
896
897 var kCFURLAttributeModificationDateKey: CFStringRef; external name '_kCFURLAttributeModificationDateKey'; (* attribute const *)
898 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
899 { The time the resource's attributes were last modified (Read-write, value type CFDate) }
900
901 var kCFURLLinkCountKey: CFStringRef; external name '_kCFURLLinkCountKey'; (* attribute const *)
902 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
903 { Number of hard links to the resource (Read-only, value type CFNumber) }
904
905 var kCFURLParentDirectoryURLKey: CFStringRef; external name '_kCFURLParentDirectoryURLKey'; (* attribute const *)
906 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
907 { The resource's parent directory, if any (Read-only, value type CFURL) }
908
909 var kCFURLVolumeURLKey: CFStringRef; external name '_kCFURLVolumeURLKey'; (* attribute const *)
910 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
911 { URL of the volume on which the resource is stored (Read-only, value type CFURL) }
912
913 var kCFURLTypeIdentifierKey: CFStringRef; external name '_kCFURLTypeIdentifierKey'; (* attribute const *)
914 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
915 { Uniform type identifier (UTI) for the resource (Read-only, value type CFString) }
916
917 var kCFURLLocalizedTypeDescriptionKey: CFStringRef; external name '_kCFURLLocalizedTypeDescriptionKey'; (* attribute const *)
918 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
919 { User-visible type or "kind" description (Read-only, value type CFString) }
920
921 var kCFURLLabelNumberKey: CFStringRef; external name '_kCFURLLabelNumberKey'; (* attribute const *)
922 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
923 { The label number assigned to the resource (Read-write, value type CFNumber) }
924
925 var kCFURLLabelColorKey: CFStringRef; external name '_kCFURLLabelColorKey'; (* attribute const *)
926 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
927 { The color of the assigned label (Currently not implemented, value type CGColorRef, must link with Application Services) }
928
929 var kCFURLLocalizedLabelKey: CFStringRef; external name '_kCFURLLocalizedLabelKey'; (* attribute const *)
930 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
931 { The user-visible label text (Read-only, value type CFString) }
932
933 var kCFURLEffectiveIconKey: CFStringRef; external name '_kCFURLEffectiveIconKey'; (* attribute const *)
934 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
935 { The icon normally displayed for the resource (Read-only, value type CGImageRef, must link with Application Services) }
936
937 var kCFURLCustomIconKey: CFStringRef; external name '_kCFURLCustomIconKey'; (* attribute const *)
938 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
939 { The custom icon assigned to the resource, if any (Currently not implemented, value type CGImageRef, must link with Application Services) }
940
941 var kCFURLFileResourceIdentifierKey: CFStringRef; external name '_kCFURLFileResourceIdentifierKey'; (* attribute const *)
942 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
943 { An identifier which can be used to compare two file system objects for equality using CFEqual (i.e, two object identifiers are equal if they have the same file system path or if the paths are linked to same inode on the same file system). This identifier is not persistent across system restarts. (Read-only, value type CFType) }
944
945 var kCFURLVolumeIdentifierKey: CFStringRef; external name '_kCFURLVolumeIdentifierKey'; (* attribute const *)
946 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
947 { An identifier that can be used to identify the volume the file system object is on. Other objects on the same volume will have the same volume identifier and can be compared using for equality using CFEqual. This identifier is not persistent across system restarts. (Read-only, value type CFType) }
948
949 var kCFURLPreferredIOBlockSizeKey: CFStringRef; external name '_kCFURLPreferredIOBlockSizeKey'; (* attribute const *)
950 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
951 { The optimal block size when reading or writing this file's data, or NULL if not available. (Read-only, value type CFNumber) }
952
953 var kCFURLIsReadableKey: CFStringRef; external name '_kCFURLIsReadableKey'; (* attribute const *)
954 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
955 { true if this process (as determined by EUID) can read the resource. (Read-only, value type CFBoolean) }
956
957 var kCFURLIsWritableKey: CFStringRef; external name '_kCFURLIsWritableKey'; (* attribute const *)
958 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
959 { true if this process (as determined by EUID) can write to the resource. (Read-only, value type CFBoolean) }
960
961 var kCFURLIsExecutableKey: CFStringRef; external name '_kCFURLIsExecutableKey'; (* attribute const *)
962 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
963 { true if this process (as determined by EUID) can execute a file resource or search a directory resource. (Read-only, value type CFBoolean) }
964
965 var kCFURLFileSecurityKey: CFStringRef; external name '_kCFURLFileSecurityKey'; (* attribute const *)
966 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
967 { The file system object's security information encapsulated in a CFFileSecurity object. (Read-write, value type CFFileSecurity) }
968
969 var kCFURLIsExcludedFromBackupKey: CFStringRef; external name '_kCFURLIsExcludedFromBackupKey'; (* attribute const *)
970 (* CF_AVAILABLE_STARTING(10_8, 5_1) *)
971 { true if resource should be excluded from backups, false otherwise (Read-write, value type CFBoolean). This property is only useful for excluding cache and other application support files which are not needed in a backup. Some operations commonly made to user documents will cause this property to be reset to false and so this property should not be used on user documents. }
972
973 var kCFURLTagNamesKey: CFStringRef; external name '_kCFURLTagNamesKey'; (* attribute const *)
974 (* CF_AVAILABLE_STARTING(10_9, NA) *)
975 { The array of Tag names (Read-write, value type CFArray of CFString) }
976
977 var kCFURLPathKey: CFStringRef; external name '_kCFURLPathKey'; (* attribute const *)
978 (* CF_AVAILABLE_STARTING(10_8, 6_0) *)
979 { the URL's path as a file system path (Read-only, value type CFString) }
980
981 var kCFURLIsMountTriggerKey: CFStringRef; external name '_kCFURLIsMountTriggerKey'; (* attribute const *)
982 (* CF_AVAILABLE_STARTING(10_7, 4_0) *)
983 { true if this URL is a file system trigger directory. Traversing or opening a file system trigger will cause an attempt to mount a file system on the trigger directory. (Read-only, value type CFBoolean) }
984
985 var kCFURLFileResourceTypeKey: CFStringRef; external name '_kCFURLFileResourceTypeKey'; (* attribute const *)
986 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
987 { Returns the file system object type. (Read-only, value type CFString) }
988
989 { The file system object type values returned for the kCFURLFileResourceTypeKey }
990 var kCFURLFileResourceTypeNamedPipe: CFStringRef; external name '_kCFURLFileResourceTypeNamedPipe'; (* attribute const *)
991 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
992 var kCFURLFileResourceTypeCharacterSpecial: CFStringRef; external name '_kCFURLFileResourceTypeCharacterSpecial'; (* attribute const *)
993 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
994 var kCFURLFileResourceTypeDirectory: CFStringRef; external name '_kCFURLFileResourceTypeDirectory'; (* attribute const *)
995 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
996 var kCFURLFileResourceTypeBlockSpecial: CFStringRef; external name '_kCFURLFileResourceTypeBlockSpecial'; (* attribute const *)
997 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
998 var kCFURLFileResourceTypeRegular: CFStringRef; external name '_kCFURLFileResourceTypeRegular'; (* attribute const *)
999 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1000 var kCFURLFileResourceTypeSymbolicLink: CFStringRef; external name '_kCFURLFileResourceTypeSymbolicLink'; (* attribute const *)
1001 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1002 var kCFURLFileResourceTypeSocket: CFStringRef; external name '_kCFURLFileResourceTypeSocket'; (* attribute const *)
1003 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1004 var kCFURLFileResourceTypeUnknown: CFStringRef; external name '_kCFURLFileResourceTypeUnknown'; (* attribute const *)
1005 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1006
1007 { File Properties }
1008
1009 var kCFURLFileSizeKey: CFStringRef; external name '_kCFURLFileSizeKey'; (* attribute const *)
1010 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1011 { Total file size in bytes (Read-only, value type CFNumber) }
1012
1013 var kCFURLFileAllocatedSizeKey: CFStringRef; external name '_kCFURLFileAllocatedSizeKey'; (* attribute const *)
1014 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1015 { Total size allocated on disk for the file in bytes (number of blocks times block size) (Read-only, value type CFNumber) }
1016
1017 var kCFURLTotalFileSizeKey: CFStringRef; external name '_kCFURLTotalFileSizeKey'; (* attribute const *)
1018 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1019 { Total displayable size of the file in bytes (this may include space used by metadata), or NULL if not available. (Read-only, value type CFNumber) }
1020
1021 var kCFURLTotalFileAllocatedSizeKey: CFStringRef; external name '_kCFURLTotalFileAllocatedSizeKey'; (* attribute const *)
1022 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1023 { Total allocated size of the file in bytes (this may include space used by metadata), or NULL if not available. This can be less than the value returned by kCFURLTotalFileSizeKey if the resource is compressed. (Read-only, value type CFNumber) }
1024
1025 var kCFURLIsAliasFileKey: CFStringRef; external name '_kCFURLIsAliasFileKey'; (* attribute const *)
1026 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1027 { true if the resource is a Finder alias file or a symlink, false otherwise ( Read-only, value type CFBooleanRef) }
1028
1029
1030 { Volume Properties }
1031
1032 { As a convenience, volume properties can be requested from any file system URL. The value returned will reflect the property value for the volume on which the resource is located. }
1033
1034 var kCFURLVolumeLocalizedFormatDescriptionKey: CFStringRef; external name '_kCFURLVolumeLocalizedFormatDescriptionKey'; (* attribute const *)
1035 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1036 { The user-visible volume format (Read-only, value type CFString) }
1037
1038 var kCFURLVolumeTotalCapacityKey: CFStringRef; external name '_kCFURLVolumeTotalCapacityKey'; (* attribute const *)
1039 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1040 { Total volume capacity in bytes (Read-only, value type CFNumber) }
1041
1042 var kCFURLVolumeAvailableCapacityKey: CFStringRef; external name '_kCFURLVolumeAvailableCapacityKey'; (* attribute const *)
1043 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1044 { Total free space in bytes (Read-only, value type CFNumber) }
1045
1046 var kCFURLVolumeResourceCountKey: CFStringRef; external name '_kCFURLVolumeResourceCountKey'; (* attribute const *)
1047 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1048 { Total number of resources on the volume (Read-only, value type CFNumber) }
1049
1050 var kCFURLVolumeSupportsPersistentIDsKey: CFStringRef; external name '_kCFURLVolumeSupportsPersistentIDsKey'; (* attribute const *)
1051 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1052 { true if the volume format supports persistent object identifiers and can look up file system objects by their IDs (Read-only, value type CFBoolean) }
1053
1054 var kCFURLVolumeSupportsSymbolicLinksKey: CFStringRef; external name '_kCFURLVolumeSupportsSymbolicLinksKey'; (* attribute const *)
1055 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1056 { true if the volume format supports symbolic links (Read-only, value type CFBoolean) }
1057
1058 var kCFURLVolumeSupportsHardLinksKey: CFStringRef; external name '_kCFURLVolumeSupportsHardLinksKey'; (* attribute const *)
1059 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1060 { true if the volume format supports hard links (Read-only, value type CFBoolean) }
1061
1062 var kCFURLVolumeSupportsJournalingKey: CFStringRef; external name '_kCFURLVolumeSupportsJournalingKey'; (* attribute const *)
1063 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1064 { true if the volume format supports a journal used to speed recovery in case of unplanned restart (such as a power outage or crash). This does not necessarily mean the volume is actively using a journal. (Read-only, value type CFBoolean) }
1065
1066 var kCFURLVolumeIsJournalingKey: CFStringRef; external name '_kCFURLVolumeIsJournalingKey'; (* attribute const *)
1067 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1068 { true if the volume is currently using a journal for speedy recovery after an unplanned restart. (Read-only, value type CFBoolean) }
1069
1070 var kCFURLVolumeSupportsSparseFilesKey: CFStringRef; external name '_kCFURLVolumeSupportsSparseFilesKey'; (* attribute const *)
1071 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1072 { true if the volume format supports sparse files, that is, files which can have 'holes' that have never been written to, and thus do not consume space on disk. A sparse file may have an allocated size on disk that is less than its logical length. (Read-only, value type CFBoolean) }
1073
1074 var kCFURLVolumeSupportsZeroRunsKey: CFStringRef; external name '_kCFURLVolumeSupportsZeroRunsKey'; (* attribute const *)
1075 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1076 { For security reasons, parts of a file (runs) that have never been written to must appear to contain zeroes. true if the volume keeps track of allocated but unwritten runs of a file so that it can substitute zeroes without actually writing zeroes to the media. (Read-only, value type CFBoolean) }
1077
1078 var kCFURLVolumeSupportsCaseSensitiveNamesKey: CFStringRef; external name '_kCFURLVolumeSupportsCaseSensitiveNamesKey'; (* attribute const *)
1079 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1080 { true if the volume format treats upper and lower case characters in file and directory names as different. Otherwise an upper case character is equivalent to a lower case character, and you can't have two names that differ solely in the case of the characters. (Read-only, value type CFBoolean) }
1081
1082 var kCFURLVolumeSupportsCasePreservedNamesKey: CFStringRef; external name '_kCFURLVolumeSupportsCasePreservedNamesKey'; (* attribute const *)
1083 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1084 { true if the volume format preserves the case of file and directory names. Otherwise the volume may change the case of some characters (typically making them all upper or all lower case). (Read-only, value type CFBoolean) }
1085
1086 var kCFURLVolumeSupportsRootDirectoryDatesKey: CFStringRef; external name '_kCFURLVolumeSupportsRootDirectoryDatesKey'; (* attribute const *)
1087 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1088 { true if the volume supports reliable storage of times for the root directory. (Read-only, value type CFBoolean) }
1089
1090 var kCFURLVolumeSupportsVolumeSizesKey: CFStringRef; external name '_kCFURLVolumeSupportsVolumeSizesKey'; (* attribute const *)
1091 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1092 { true if the volume supports returning volume size values (kCFURLVolumeTotalCapacityKey and kCFURLVolumeAvailableCapacityKey). (Read-only, value type CFBoolean) }
1093
1094 var kCFURLVolumeSupportsRenamingKey: CFStringRef; external name '_kCFURLVolumeSupportsRenamingKey'; (* attribute const *)
1095 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1096 { true if the volume can be renamed. (Read-only, value type CFBoolean) }
1097
1098 var kCFURLVolumeSupportsAdvisoryFileLockingKey: CFStringRef; external name '_kCFURLVolumeSupportsAdvisoryFileLockingKey'; (* attribute const *)
1099 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1100 { true if the volume implements whole-file flock(2) style advisory locks, and the O_EXLOCK and O_SHLOCK flags of the open(2) call. (Read-only, value type CFBoolean) }
1101
1102 var kCFURLVolumeSupportsExtendedSecurityKey: CFStringRef; external name '_kCFURLVolumeSupportsExtendedSecurityKey'; (* attribute const *)
1103 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1104 { true if the volume implements extended security (ACLs). (Read-only, value type CFBoolean) }
1105
1106 var kCFURLVolumeIsBrowsableKey: CFStringRef; external name '_kCFURLVolumeIsBrowsableKey'; (* attribute const *)
1107 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1108 { true if the volume should be visible via the GUI (i.e., appear on the Desktop as a separate volume). (Read-only, value type CFBoolean) }
1109
1110 var kCFURLVolumeMaximumFileSizeKey: CFStringRef; external name '_kCFURLVolumeMaximumFileSizeKey'; (* attribute const *)
1111 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1112 { The largest file size (in bytes) supported by this file system, or NULL if this cannot be determined. (Read-only, value type CFNumber) }
1113
1114 var kCFURLVolumeIsEjectableKey: CFStringRef; external name '_kCFURLVolumeIsEjectableKey'; (* attribute const *)
1115 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1116 { true if the volume's media is ejectable from the drive mechanism under software control. (Read-only, value type CFBoolean) }
1117
1118 var kCFURLVolumeIsRemovableKey: CFStringRef; external name '_kCFURLVolumeIsRemovableKey'; (* attribute const *)
1119 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1120 { true if the volume's media is removable from the drive mechanism. (Read-only, value type CFBoolean) }
1121
1122 var kCFURLVolumeIsInternalKey: CFStringRef; external name '_kCFURLVolumeIsInternalKey'; (* attribute const *)
1123 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1124 { true if the volume's device is connected to an internal bus, false if connected to an external bus, or NULL if not available. (Read-only, value type CFBoolean) }
1125
1126 var kCFURLVolumeIsAutomountedKey: CFStringRef; external name '_kCFURLVolumeIsAutomountedKey'; (* attribute const *)
1127 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1128 { true if the volume is automounted. Note: do not mistake this with the functionality provided by kCFURLVolumeSupportsBrowsingKey. (Read-only, value type CFBoolean) }
1129
1130 var kCFURLVolumeIsLocalKey: CFStringRef; external name '_kCFURLVolumeIsLocalKey'; (* attribute const *)
1131 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1132 { true if the volume is stored on a local device. (Read-only, value type CFBoolean) }
1133
1134 var kCFURLVolumeIsReadOnlyKey: CFStringRef; external name '_kCFURLVolumeIsReadOnlyKey'; (* attribute const *)
1135 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1136 { true if the volume is read-only. (Read-only, value type CFBoolean) }
1137
1138 var kCFURLVolumeCreationDateKey: CFStringRef; external name '_kCFURLVolumeCreationDateKey'; (* attribute const *)
1139 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1140 { The volume's creation date, or NULL if this cannot be determined. (Read-only, value type CFDate) }
1141
1142 var kCFURLVolumeURLForRemountingKey: CFStringRef; external name '_kCFURLVolumeURLForRemountingKey'; (* attribute const *)
1143 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1144 { The CFURL needed to remount a network volume, or NULL if not available. (Read-only, value type CFURL) }
1145
1146 var kCFURLVolumeUUIDStringKey: CFStringRef; external name '_kCFURLVolumeUUIDStringKey'; (* attribute const *)
1147 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1148 { The volume's persistent UUID as a string, or NULL if a persistent UUID is not available for the volume. (Read-only, value type CFString) }
1149
1150 var kCFURLVolumeNameKey: CFStringRef; external name '_kCFURLVolumeNameKey'; (* attribute const *)
1151 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1152 { The name of the volume (Read-write, settable if kCFURLVolumeSupportsRenamingKey is true and permissions allow, value type CFString) }
1153
1154 var kCFURLVolumeLocalizedNameKey: CFStringRef; external name '_kCFURLVolumeLocalizedNameKey'; (* attribute const *)
1155 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1156 { The user-presentable name of the volume (Read-only, value type CFString) }
1157
1158 { UbiquitousItem Properties }
1159
1160 var kCFURLIsUbiquitousItemKey: CFStringRef; external name '_kCFURLIsUbiquitousItemKey'; (* attribute const *)
1161 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1162 { true if this item is synced to the cloud, false if it is only a local file. (Read-only, value type CFBoolean) }
1163
1164 var kCFURLUbiquitousItemHasUnresolvedConflictsKey: CFStringRef; external name '_kCFURLUbiquitousItemHasUnresolvedConflictsKey'; (* attribute const *)
1165 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1166 { true if this item has conflicts outstanding. (Read-only, value type CFBoolean) }
1167
1168 var kCFURLUbiquitousItemIsDownloadedKey: CFStringRef; external name '_kCFURLUbiquitousItemIsDownloadedKey'; (* attribute const *)
1169 (* CF_DEPRECATED(10_7, 10_9, 5_0, 7_0, "Use kCFURLUbiquitousItemDownloadingStatusKey instead") *)
1170 { Equivalent to NSURLUbiquitousItemDownloadingStatusKey == NSURLUbiquitousItemDownloadingStatusCurrent. Has never behaved as documented in earlier releases, hence deprecated. (Read-only, value type CFBoolean) }
1171
1172 var kCFURLUbiquitousItemIsDownloadingKey: CFStringRef; external name '_kCFURLUbiquitousItemIsDownloadingKey'; (* attribute const *)
1173 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1174 { true if data is being downloaded for this item. (Read-only, value type CFBoolean) }
1175
1176 var kCFURLUbiquitousItemIsUploadedKey: CFStringRef; external name '_kCFURLUbiquitousItemIsUploadedKey'; (* attribute const *)
1177 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1178 { true if there is data present in the cloud for this item. (Read-only, value type CFBoolean) }
1179
1180 var kCFURLUbiquitousItemIsUploadingKey: CFStringRef; external name '_kCFURLUbiquitousItemIsUploadingKey'; (* attribute const *)
1181 (* CF_AVAILABLE_STARTING(10_7, 5_0) *)
1182 { true if data is being uploaded for this item. (Read-only, value type CFBoolean) }
1183
1184 var kCFURLUbiquitousItemPercentDownloadedKey: CFStringRef; external name '_kCFURLUbiquitousItemPercentDownloadedKey'; (* attribute const *)
1185 (* CF_DEPRECATED(10_7, 10_8, 5_0, 6_0, "Use NSMetadataQuery and NSMetadataUbiquitousItemPercentDownloadedKey on NSMetadataItem instead") *)
1186 { Use NSMetadataQuery and NSMetadataUbiquitousItemPercentDownloadedKey on NSMetadataItem instead }
1187
1188 var kCFURLUbiquitousItemPercentUploadedKey: CFStringRef; external name '_kCFURLUbiquitousItemPercentUploadedKey'; (* attribute const *)
1189 (* CF_DEPRECATED(10_7, 10_8, 5_0, 6_0, "Use NSMetadataQuery and NSMetadataUbiquitousItemPercentUploadedKey on NSMetadataItem instead") *)
1190
1191 { Use NSMetadataQuery and NSMetadataUbiquitousItemPercentUploadedKey on NSMetadataItem instead }
1192
1193 var kCFURLUbiquitousItemDownloadingStatusKey: CFStringRef; external name '_kCFURLUbiquitousItemDownloadingStatusKey'; (* attribute const *)
1194 (* CF_AVAILABLE_STARTING(10_9, 7_0) *)
1195 { Returns the download status of this item. (Read-only, value type CFString). Possible values below. }
1196
1197 var kCFURLUbiquitousItemDownloadingErrorKey: CFStringRef; external name '_kCFURLUbiquitousItemDownloadingErrorKey'; (* attribute const *)
1198 (* CF_AVAILABLE_STARTING(10_9, 7_0) *)
1199 { returns the error when downloading the item from iCloud failed. See the NSUbiquitousFile section in FoundationErrors.h. }
1200
1201 var kCFURLUbiquitousItemUploadingErrorKey: CFStringRef; external name '_kCFURLUbiquitousItemUploadingErrorKey'; (* attribute const *)
1202 (* CF_AVAILABLE_STARTING(10_9, 7_0) *)
1203 { returns the error when uploading the item to iCloud failed. See the NSUbiquitousFile section in FoundationErrors.h. }
1204
1205 { The values returned for kCFURLUbiquitousItemDownloadingStatusKey
1206 }
1207 var kCFURLUbiquitousItemDownloadingStatusNotDownloaded: CFStringRef; external name '_kCFURLUbiquitousItemDownloadingStatusNotDownloaded'; (* attribute const *)
1208 (* CF_AVAILABLE_STARTING(10_9, 7_0) *)
1209 { this item has not been downloaded yet. Use NSFileManager's startDownloadingUbiquitousItemAtURL:error: to download it }
1210
1211 var kCFURLUbiquitousItemDownloadingStatusDownloaded: CFStringRef; external name '_kCFURLUbiquitousItemDownloadingStatusDownloaded'; (* attribute const *)
1212 (* CF_AVAILABLE_STARTING(10_9, 7_0) *)
1213 { there is a local version of this item available. The most current version will get downloaded as soon as possible. }
1214
1215 var kCFURLUbiquitousItemDownloadingStatusCurrent: CFStringRef; external name '_kCFURLUbiquitousItemDownloadingStatusCurrent'; (* attribute const *)
1216 (* CF_AVAILABLE_STARTING(10_9, 7_0) *)
1217 { there is a local version of this item and it is the most up-to-date version known to this device. }
1218
1219 type
1220 CFURLBookmarkCreationOptions = CFOptionFlags;
1221 const
1222 kCFURLBookmarkCreationPreferFileIDResolutionMask = 1 shl 8; { At resolution time, this alias will prefer resolving by the embedded fileID to the path }
1223 kCFURLBookmarkCreationMinimalBookmarkMask = 1 shl 9; { Creates a bookmark with "less" information, which may be smaller but still be able to resolve in certain ways }
1224 kCFURLBookmarkCreationSuitableForBookmarkFile = 1 shl 10; { includes in the created bookmark those properties which are needed for a bookmark/alias file }
1225 {$ifc TARGET_OS_MAC}
1226 kCFURLBookmarkCreationWithSecurityScope = 1 shl 11; (* CF_AVAILABLE_STARTING(10_7,NA) *) { Mac OS X 10.7.3 and later, include information in the bookmark data which allows the same sandboxed process to access the resource after being relaunched }
1227 kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess = 1 shl 12; (* CF_AVAILABLE_STARTING(10_7,NA) *) { Mac OS X 10.7.3 and later, if used with kCFURLBookmarkCreationWithSecurityScope, at resolution time only read access to the resource will be granted }
1228 {$endc}
1229
1230 const
1231 kCFBookmarkResolutionWithoutUIMask = 1 shl 8; { don't perform any UI during bookmark resolution }
1232 kCFBookmarkResolutionWithoutMountingMask = 1 shl 9 ; { don't mount a volume during bookmark resolution }
1233
1234 {$ifc TARGET_OS_MAC}
1235 const
1236 kCFURLBookmarkResolutionWithSecurityScope = 1 shl 10 ; (* CF_ENUM_AVAILABLE(10_7,NA) *) { Mac OS X 10.7.3 and later, extract the security scope included at creation time to provide the ability to access the resource. }
1237 {$endc}
1238
1239 type
1240 CFURLBookmarkResolutionOptions = CFOptionFlags;
1241
1242 type
1243 CFURLBookmarkFileCreationOptions = CFOptionFlags;
1244
1245 { CF_IMPLICIT_BRIDGING_DISABLED }
1246
1247 { @function CFURLCreateBookmarkData
1248 @discussion Create a CFDataRef containing an externalizable representation from a CFURLRef, modified with the given options, including ( at the minimum ) any
1249 properties in the propertiesToInclude array which are retrievable from the given url.
1250 @param allocator the CFAllocator to use to create this object
1251 @param url the CFURLRef to create a bookmark data from.
1252 @param options a set of options which control creation of the bookmark data
1253 @param resourcePropertiesToInclude If non-NULL, an CFArrayRef of additional properties copied from the url to include in the created bookmark data.
1254 @param relativeToURL If non-NULL, the created bookmark will be relative to the given url. If kCFURLBookmarkCreationWithSecurityScope is given as
1255 an option and relativeToURL is non-NULL, then a collection-scoped bookmark is created which enables future access to url provided the caller has
1256 access to relativeURL.
1257 @param error If non-NULL, on exit will be filled in with a CFErrorRef representing any error which occured during creation of the bookmark data
1258 @result A CFDataRef containing an data, which can be later be passed to CFURLCreateByResolvingBookmarkData() or to CFURLCopyPropertiesForKeysFromBookmarkData() / CFURLCopyPropertyForKeyFromBookmarkData() }
CFURLCreateBookmarkDatanull1259 function CFURLCreateBookmarkData( allocator: CFAllocatorRef; url: CFURLRef; options: CFURLBookmarkCreationOptions; resourcePropertiesToInclude: CFArrayRef; relativeToURL: CFURLRef; error: CFErrorRefPtr ): CFDataRef; external name '_CFURLCreateBookmarkData';
1260 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1261
1262 { @function CFURLCreateByResolvingBookmarkData
1263 @discussion Given a CFDataRef created with CFURLCreateBookmarkRepresentation(), return a CFURLRef of the item it was a bookmark to, and
1264 attempt to pre-cache those properties in propertiesToInclude in the resulting url. If in the process of resolving the bookmark into the CFURLRef
1265 it points to this determines that some properties in the bookmark are out of date or not correct for the item it resolves to, set *isStale to YES,
1266 which the client may want to use to decide to make a new bookmark from the returned item and replace the saved bookmark it has. If the bookmarked
1267 item cannot be found, return NULL. A bookmark created with security scope may fail to resolve if the caller does not have the same code signing identity
1268 as the caller which created the bookmark.
1269 After resolving a security scoped bookmark, the caller must call CFURLStartAccessingSecurityScopedResource() in order to gain access to the resource.
1270 If an error ( other than "original item can not be found" ) occurs during the process, return NULL and fill in error )
1271 @param allocator the CFAllocator to use to create this object
1272 @param bookmark a CFDataRef containing a bookmark data, created with CFURLCreateBookmarkData
1273 @param options options which affect the resolution
1274 @param relativeToURL If non-NULL, and if the bookmark was created relative to another url, then resolve it relative to this url. If
1275 kCFURLBookmarkCreationWithSecurityScope was provided at creation, and kCFURLBookmarkResolutionWithSecurityScope is set, then relativeURL
1276 should point to the same item which was passed as relavitiveURL at creation time.
1277 @param resourcePropertiesToInclude If non-NULL, a CFArray containing those properties which the caller would like to already be cached on the given url
1278 @param isStale If non-NULL, on exit will be set to true if during resolution any of the properties in the bookmark no longer seemed to match the
1279 corresponding properties on the returned file. Clients, upon seeing a stale representation, may want to replace whatever stored bookmark data they
1280 have saved and create a new one.
1281 @param error If non-NULL, on exit will be filled in with a CFErrorRef representing any error which occured during resolution of the bookmark data
1282 @result A CFURLRef of a file which is the closest match to the file the bookmark data }
CFURLCreateByResolvingBookmarkDatanull1283 function CFURLCreateByResolvingBookmarkData( allocator: CFAllocatorRef; bookmark: CFDataRef; options: CFURLBookmarkResolutionOptions; relativeToURL: CFURLRef; resourcePropertiesToInclude: CFArrayRef; isStale: BooleanPtr; error: CFErrorRefPtr ): CFURLRef; external name '_CFURLCreateByResolvingBookmarkData';
1284 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1285
1286 { @function CFURLCreatePropertiesForKeysFromBookmarkData
1287 @discussion Given a bookmark, return a dictionary of properties ( all properties if propertiesToReturn == NULL ).
1288 This returns only the properties stored within the bookmark and will not attempt to resolve the bookmark or do i/o.
1289 @param allocator the CFAllocator to use to create this object
1290 @param bookmark a CFDataRef containing a bookmark data, created with CFURLCreateBookmarkData
1291 @param propertiesToReturn a CFArrayRef of the properties of the bookmark data which the client would like returned.
1292 @result a CFDictionaryRef containing the values for the properties passed in obtained from the bookmark data ( not by attempting to resolve it or do i/o in any way ) }
CFURLCreateResourcePropertiesForKeysFromBookmarkDatanull1293 function CFURLCreateResourcePropertiesForKeysFromBookmarkData( allocator: CFAllocatorRef; resourcePropertiesToReturn: CFArrayRef; bookmark: CFDataRef ): CFDictionaryRef; external name '_CFURLCreateResourcePropertiesForKeysFromBookmarkData';
1294 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1295
1296 { @function CFURLCreatePropertyForKeyFromBookmarkData
1297 @discussion Given a bookmark, return the value for a given property from the bookmark data
1298 This returns only the properties stored within the bookmark and will not attempt to resolve the bookmark or do i/o.
1299 @param allocator the CFAllocator to use to create this object
1300 @param bookmark a CFDataRef containing a bookmark data, created with CFURLCreateBookmarkData
1301 @param propertyKey the property key to return.
1302 @result a CFTypeRef value for the property passed in obtained from the bookmark data ( not by attempting to resolve it or do i/o in any way ) }
CFURLCreateResourcePropertyForKeyFromBookmarkDatanull1303 function CFURLCreateResourcePropertyForKeyFromBookmarkData( allocator: CFAllocatorRef; resourcePropertyKey: CFStringRef; bookmark: CFDataRef ): CFTypeRef; external name '_CFURLCreateResourcePropertyForKeyFromBookmarkData';
1304 (* CF_AVAILABLE_STARTING(10_6, 4_0) *)
1305
1306 {! @function CFURLCreateBookmarkDataFromFile
1307 @description Given a fileURL of a file which is a Finder "alias" file, return a CFDataRef with the bookmark data from the file. If urlRef points to an alias file
1308 created before SnowLeopard which contains Alias Manager information and no bookmark data, then a CFDataRef will be synthesized which contains
1309 a approximation of the alias information in a format which can be used to resolve the bookmark. If an error prevents reading the data or
1310 if it is corrupt, NULL will be returned and error will be filled in if errorRef is non-NULL.
1311 @param allocator the CFAllocator to use to create this object
1312 @param fileURL a CFURLRef to to the alias file to create the bookmark data from
1313 @param errorRef if non-NULL, on exit will be filled in with a CFErrorRef representing any error which occurred during the creation of the bookmark data from the file
1314 @result A CFDataRef containing bookmark data, or NULL if there was an error creating bookmark data from the file, such as if the file is not an alias file.
1315 }
CFURLCreateBookmarkDataFromFilenull1316 function CFURLCreateBookmarkDataFromFile( allocator: CFAllocatorRef; fileURL: CFURLRef; var errorRef: CFErrorRef ): CFDataRef; external name '_CFURLCreateBookmarkDataFromFile';
1317 (* CF_AVAILABLE_STARTING(10_6, 5_0) *)
1318
1319 {! @function CFURLWriteBookmarkDataToFile
1320 @description Given a created bookmarkData object, create a new Finder "alias" file at fileURL which contains the bookmark data. If fileURL is a url to a directory, an alias file
1321 will be created with the same name as the bookmarked item and a ".alias" extension. If fileURL is a url for a file and it exists it will be overwritten. If a
1322 .alias extension is not present it will be added. In addition to the bookmark data, sufficient pre-SnowLeopard alias data will added to the file to allow
1323 systems running something before SnowLeopard to resolve this file using Alias Manager routines and get back the same file as the bookmark routines.
1324 The bookmark data must have been created with the kCFURLBookmarkCreationSuitableForBookmarkFile option and an error will be returned if not.
1325 @param allocator the CFAllocator to use to create this object
1326 @param bookmark a CFDataRef containing a bookmark data, created with CFURLCreateBookmarkData
1327 @param options options flags
1328 @param errorRef if non-NULL, on exit will be filled in with a CFErrorRef representing any error which occurred during the creation of the alias file
1329 }
CFURLWriteBookmarkDataToFilenull1330 function CFURLWriteBookmarkDataToFile( bookmarkRef: CFDataRef; fileURL: CFURLRef; options: CFURLBookmarkFileCreationOptions; errorRef: CFErrorRefPtr ): Boolean; external name '_CFURLWriteBookmarkDataToFile';
1331 (* CF_AVAILABLE_STARTING(10_6, 5_0) *)
1332
1333 {$ifc TARGET_OS_MAC}
1334 {! @function CFURLCreateBookmarkDataFromAliasRecord
1335 @discussion Create a CFDataRef containing bookmarkdata by converting the alias data in aliasRecordDataRef, which should be the contents of an AliasRecord copied into a CFDataRef object.
1336 The created bookmarkdata can be passed into CFURLCreateByResolvingBookmarkData() to resolve the item into a CFURLRef, or a small set of information can be returned from
1337 CFURLCreateResourcePropertiesForKeysFromBookmarkData() / CFURLCreateResourcePropertyForKeyFromBookmarkData().
1338 @param allocator the CFAllocator to use to create this object
1339 @param aliasRecordDataRef the contents of an AliasRecord to create bookmark data for
1340 @result A CFDataRef containing an data, which can be later be passed to CFURLCreateByResolvingBookmarkData() or to CFURLCopyPropertiesForKeysFromBookmarkData() / CFURLCopyPropertyForKeyFromBookmarkData()
1341 }
CFURLCreateBookmarkDataFromAliasRecordnull1342 function CFURLCreateBookmarkDataFromAliasRecord ( allocatorRef: CFAllocatorRef; aliasRecordDataRef: CFDataRef ): CFDataRef; external name '_CFURLCreateBookmarkDataFromAliasRecord';
1343 (* CF_AVAILABLE_STARTING(10_6, NA) *)
1344 {$endc}
1345
1346 { CF_IMPLICIT_BRIDGING_ENABLED }
1347
1348 {$ifc TARGET_OS_MAC}
1349 {! @function CFURLStartAccessingSecurityScopedResource
1350 @discussion Given a CFURLRef created by resolving a bookmark data created with security scope, make the resource referenced by the
1351 url accessible to the process. When access to this resource is no longer needed the client should call
1352 CFURLStopAccessingSecurityScopedResource(). Each call to CFURLStartAccessingSecurityScopedResource() must be balanced
1353 with a call to CFURLStopAccessingSecurityScopedResource().
1354 @param url the CFURLRef for the resource returned by CFURLCreateByResolvingBookmarkData() using kCFURLBookmarkResolutionWithSecurityScope.
1355 @result returns TRUE if access was granted and FALSE if the url does not reference a security scoped resource, or if some error occurred
1356 which didn't allow access to be granted
1357 }
CFURLStartAccessingSecurityScopedResourcenull1358 function CFURLStartAccessingSecurityScopedResource( url: CFURLRef ): Boolean; external name '_CFURLStartAccessingSecurityScopedResource';
1359 (* CF_AVAILABLE_STARTING(10_7, NA) *) // Available in MacOS X 10.7.3 and later
1360
1361 {! @function CFURLStopAccessingSecurityScopedResource
1362 @discussion Revokes the access granted to the url by a prior successful call to CFURLStartAccessingSecurityScopedResource().
1363 @param url the CFURLRef for the resource to stop accessing.
1364 }
1365 procedure CFURLStopAccessingSecurityScopedResource( url: CFURLRef ); external name '_CFURLStopAccessingSecurityScopedResource';
1366 (* CF_AVAILABLE_STARTING(10_7, NA) *)
1367 {$endc}
1368 {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
1369
1370 end.
1371 {$endc} {not MACOSALLINCLUDE}
1372