Platforms to show: All Mac Windows Linux Cross-Platform

Back to CFURLMBS class.

Previous items

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.

Previous items

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


💬 Ask a question or report a problem
The biggest plugin in space...