diff options
Diffstat (limited to 'doc/classes/Directory.xml')
-rw-r--r-- | doc/classes/Directory.xml | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index cd4b8fde1e..3f0a5610b1 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -108,17 +108,37 @@ Returns the currently opened directory's drive index. See [method get_drive] to convert returned index to the name of the drive. </description> </method> + <method name="get_directories"> + <return type="PackedStringArray" /> + <description> + Returns a [PackedStringArray] containing filenames of the directory contents, excluding files. The array is sorted alphabetically. + Affected by [member include_hidden] and [member include_navigational]. + </description> + </method> <method name="get_drive"> <return type="String" /> <argument index="0" name="idx" type="int" /> <description> - On Windows, returns the name of the drive (partition) passed as an argument (e.g. [code]C:[/code]). On other platforms, or if the requested drive does not exist, the method returns an empty String. + On Windows, returns the name of the drive (partition) passed as an argument (e.g. [code]C:[/code]). + On macOS, returns the path to the mounted volume passed as an argument. + On Linux, returns the path to the mounted volume or GTK 3 bookmark passed as an argument. + On other platforms, or if the requested drive does not exist, the method returns an empty String. </description> </method> <method name="get_drive_count"> <return type="int" /> <description> - On Windows, returns the number of drives (partitions) mounted on the current filesystem. On other platforms, the method returns 0. + On Windows, returns the number of drives (partitions) mounted on the current filesystem. + On macOS, returns the number of mounted volumes. + On Linux, returns the number of mounted volumes and GTK 3 bookmarks. + On other platforms, the method returns 0. + </description> + </method> + <method name="get_files"> + <return type="PackedStringArray" /> + <description> + Returns a [PackedStringArray] containing filenames of the directory contents, excluding directories. The array is sorted alphabetically. + Affected by [member include_hidden]. </description> </method> <method name="get_next"> @@ -136,12 +156,10 @@ </method> <method name="list_dir_begin"> <return type="int" enum="Error" /> - <argument index="0" name="show_navigational" type="bool" default="false" /> - <argument index="1" name="show_hidden" type="bool" default="false" /> <description> Initializes the stream used to list all files and directories using the [method get_next] function, closing the currently opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end]. - If [code]show_navigational[/code] is [code]true[/code], [code].[/code] and [code]..[/code] are included too. - If [code]show_hidden[/code] is [code]true[/code], hidden files are included too. + Affected by [member include_hidden] and [member include_navigational]. + [b]Note:[/b] The order of files and directories returned by this method is not deterministic, and can vary between operating systems. If you want a list of all files or folders sorted alphabetically, use [method get_files] or [method get_directories]. </description> </method> <method name="list_dir_end"> @@ -192,4 +210,14 @@ </description> </method> </methods> + <members> + <member name="include_hidden" type="bool" setter="set_include_hidden" getter="get_include_hidden" default="false"> + If [code]true[/code], hidden files are included when the navigating directory. + Affects [method list_dir_begin], [method get_directories] and [method get_files]. + </member> + <member name="include_navigational" type="bool" setter="set_include_navigational" getter="get_include_navigational" default="false"> + If [code]true[/code], [code].[/code] and [code]..[/code] are included when navigating the directory. + Affects [method list_dir_begin] and [method get_directories]. + </member> + </members> </class> |