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
Methodsยถ
String |
|
PackedByteArray |
get_data() |
String |
get_path() |
String |
|
String |
|
void |
set_from_filepath(path: String) |
bool |
set_value(str: String) |
bool |
|
void |
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.