Platforms to show: All Mac Windows Linux Cross-Platform

Back to CFURLMBS class.

CFURLMBS.AbsoluteURL as CFURLMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the absolute URL.

A URL contains normally a base and a relative part. This function creates one absolute URL from those parts.

CFURLMBS.AppendPathComponent(pathcomponent as CFStringMBS,isDirectory as boolean) as CFURLMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Appends a path component to this URL.

CFURLMBS.AppendPathExtension(extension as CFStringMBS) as CFURLMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Appends a path extension to this URL.

CFURLMBS.BaseURL as CFURLMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the base URL.

A URL contains normally a base and a relative part.

CFURLMBS.CanBeDecomposed as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Can this url be decomposed?

CFURLMBS.Constructor(File as FolderItem)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates new CFURLMBS based on given folderitem.

Raises exception if not called on macOS or called with invalid URL.

See also:

CFURLMBS.Constructor(URL as string)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 17.4 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates new CFURLMBS based on given URL.

Raises exception if not called on macOS or called with invalid URL.

See also:

CFURLMBS.Data(encoding as Integer, escapeWhitespace as boolean) as CFBinaryDataMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the URL as binary data using the given encoding.

CFURLMBS.DeleteLastPathComponent as CFURLMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Deletes the last path component of this URL.

CFURLMBS.DeletePathExtension as CFURLMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Deletes the path extension of this URL.

CFURLMBS.DisplayName as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 2.9 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the display name for the url.

Returns "" on any error.

CFURLMBS.file as folderitem

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 2.7 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the URL as a folderitem.

Works only on RB 4.5 or later and if the file exists.

CFURLMBS.Fragment(charactersToLeaveEscaped as CFStringMBS) as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the Fragment part of this URL.

CFURLMBS.HasDirectoryPath as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Has this URL a directory path?

CFURLMBS.HFSFileSystemPath as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the URL as HFSFileSystemPath.

CFURLMBS.HostName as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the HostName part of this URL.

CFURLMBS.isAbsolutePath as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Is the path an absolute path?

CFURLMBS.Kind as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 2.9 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the kind string for the file.

CFURLMBS.LastPathComponent as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the LastPathComponent part of this URL.

CFURLMBS.Launch as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 2.9 ✅ Yes ❌ No ❌ No ✅ Yes All
Launches a file.

Returns a Mac OS error string or -1 if the function is not available.

CFURLMBS.NetLocation as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the NetLocation part of this URL.

CFURLMBS.ParameterString(charactersToLeaveEscaped as CFStringMBS) as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the ParameterString part of this URL.

CFURLMBS.Password as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the Password part of this URL.

CFURLMBS.Path as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the Path part of this URL.

See also:

CFURLMBS.Path(resolveAgainstBase as boolean) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the path of this URL.

See also:

CFURLMBS.PathExtension as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the PathExtension part of this URL.

CFURLMBS.PortNumber as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the PortNumber part of this URL.

Returns -1 if no port specified and -2 on Windows and Mac OS Classic.

CFURLMBS.PosixFileSystemPath as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the URL as PosixFileSystemPath.

Some examples using this method:

CFURLMBS.QueryString(charactersToLeaveEscaped as CFStringMBS) as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the QueryString part of this URL.

CFURLMBS.ResourcePropertyForKey(key as CFStringMBS, byref value as Variant, byref error as CFErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 17.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the resource value identified by a given resource key.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test")
dim c as CFURLMBS = NewCFURLMBSFile(f)

dim v as Variant
dim e as CFErrorMBS

if c.ResourcePropertyForKey(c.kCFURLIsPackageKey, v1, e) then
dim p as CFBooleanMBS = v

MsgBox "IsPackage: "+str(p.Value)
else
MsgBox "Error: "+e.Description
end if

key: The resource key that identifies the resource property.
Value: On output when the result is true, the resource value or nil.
error: On output when the result is false, the error that occurred.

Returns true if value is successfully populated; false if an error occurs.

ResourcePropertyForKey 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 ResourcePropertyForKey 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 v alue is populated with nil, 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.

CFURLMBS.ResourceSpecifier as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the ResourceSpecifier part of this URL.

CFURLMBS.Scheme as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the scheme part of this URL.

CFURLMBS.SetResourcePropertyForKey(key as CFStringMBS, value as Variant, byref error as CFErrorMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin 17.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets the resource value identified by a given resource key.
Example
Dim f As FolderItem = SpecialFolder.Desktop.Child("test")
Dim c As CFURLMBS = NewCFURLMBSFile(f)

Dim e As CFErrorMBS

If c.SetResourcePropertyForKey(c.kCFURLIsPackageKey, NewCFBooleanMBS(true), e) Then
MsgBox "OK"
Else
MsgBox "Error: "+e.Description
End If

key: The resource key that identifies the resource property.
Value: The resource value.
error: On output when the result is false, the error that occurred.

Returns true if the attempt to set the resource value completed with no errors; otherwise, false.

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.

CFURLMBS.Str as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the URL as binary data.

CFURLMBS.StrictPath as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the StrictPath part of this URL.

CFURLMBS.UserName as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the UserName part of this URL.

CFURLMBS.WindowsFileSystemPath as CFStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the URL as WindowsFileSystemPath.

The items on this page are in the following plugins: MBS MacCF Plugin.


The biggest plugin in space...