AppleURLยถ

Inherits: RefCounted < Object

Represents an Apple Foundation.URL type

Descriptionยถ

When working with Apple APIs, some of those APIs either return URLs or expect URLs, in particular

this type is being exposed because Apple can return a URL when accessing files outside of

your application sandbox, and you must call the start_accessing_security_scoped_resource() to

begin accessing the resource and when you are done, you must call

stop_accessing_security_scoped_resource().

Methodsยถ

String

get_absolute_string()

PackedByteArray

get_data()

String

get_path()

String

get_path_encoded()

String

get_string()

void

set_from_filepath(path: String)

bool

set_value(str: String)

bool

start_accessing_security_scoped_resource()

void

stop_accessing_security_scoped_resource()


Method Descriptionsยถ

String get_absolute_string() ๐Ÿ”—

Returns the URL.absoluteString property


PackedByteArray get_data() ๐Ÿ”—

Loads the contents of a file referenced by the URL and returns it as a PackedByteArray.


String get_path() ๐Ÿ”—

Returns the URL contents, without percent-encoding.


String get_path_encoded() ๐Ÿ”—

Returns the URL contents, with percent-encoding.


String get_string() ๐Ÿ”—

Fetches the contents of a file URL and returns it as a string.


void set_from_filepath(path: String) ๐Ÿ”—

Sets the content of the URL from a string that represents a file path.


bool set_value(str: String) ๐Ÿ”—

Sets the content of the URL from a string, it will return false if the URL can not be parsed.


bool start_accessing_security_scoped_resource() ๐Ÿ”—

In an app that has adopted App Sandbox, makes the resource pointed to by a security-scoped URL available to the app.

If this call succeeds, you can access the resource, and when you are done, you must call stop_accessing_security_scoped_resource().


void stop_accessing_security_scoped_resource() ๐Ÿ”—

In an app that adopts App Sandbox, revokes access to the resource pointed to by a security-scoped URL.