:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/../../GodotApplePlugins/doc_classes/AppleURL.xml. .. _class_AppleURL: AppleURL ======== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Represents an Apple Foundation.URL type .. rst-class:: classref-introduction-group 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 :ref:`start_accessing_security_scoped_resource()` to begin accessing the resource and when you are done, you must call :ref:`stop_accessing_security_scoped_resource()`. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_absolute_string`\ (\ ) | +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedByteArray` | :ref:`get_data`\ (\ ) | +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_path`\ (\ ) | +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_path_encoded`\ (\ ) | +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_string`\ (\ ) | +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_from_filepath`\ (\ path\: :ref:`String`\ ) | +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`set_value`\ (\ str\: :ref:`String`\ ) | +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`start_accessing_security_scoped_resource`\ (\ ) | +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`stop_accessing_security_scoped_resource`\ (\ ) | +-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_AppleURL_method_get_absolute_string: .. rst-class:: classref-method :ref:`String` **get_absolute_string**\ (\ ) :ref:`🔗` Returns the URL.absoluteString property .. rst-class:: classref-item-separator ---- .. _class_AppleURL_method_get_data: .. rst-class:: classref-method :ref:`PackedByteArray` **get_data**\ (\ ) :ref:`🔗` Loads the contents of a file referenced by the URL and returns it as a PackedByteArray. .. rst-class:: classref-item-separator ---- .. _class_AppleURL_method_get_path: .. rst-class:: classref-method :ref:`String` **get_path**\ (\ ) :ref:`🔗` Returns the URL contents, without percent-encoding. .. rst-class:: classref-item-separator ---- .. _class_AppleURL_method_get_path_encoded: .. rst-class:: classref-method :ref:`String` **get_path_encoded**\ (\ ) :ref:`🔗` Returns the URL contents, with percent-encoding. .. rst-class:: classref-item-separator ---- .. _class_AppleURL_method_get_string: .. rst-class:: classref-method :ref:`String` **get_string**\ (\ ) :ref:`🔗` Fetches the contents of a file URL and returns it as a string. .. rst-class:: classref-item-separator ---- .. _class_AppleURL_method_set_from_filepath: .. rst-class:: classref-method |void| **set_from_filepath**\ (\ path\: :ref:`String`\ ) :ref:`🔗` Sets the content of the URL from a string that represents a file path. .. rst-class:: classref-item-separator ---- .. _class_AppleURL_method_set_value: .. rst-class:: classref-method :ref:`bool` **set_value**\ (\ str\: :ref:`String`\ ) :ref:`🔗` Sets the content of the URL from a string, it will return false if the URL can not be parsed. .. rst-class:: classref-item-separator ---- .. _class_AppleURL_method_start_accessing_security_scoped_resource: .. rst-class:: classref-method :ref:`bool` **start_accessing_security_scoped_resource**\ (\ ) :ref:`🔗` 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 :ref:`stop_accessing_security_scoped_resource()`. .. rst-class:: classref-item-separator ---- .. _class_AppleURL_method_stop_accessing_security_scoped_resource: .. rst-class:: classref-method |void| **stop_accessing_security_scoped_resource**\ (\ ) :ref:`🔗` In an app that adopts App Sandbox, revokes access to the resource pointed to by a security-scoped URL. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`