Files
godot-docs/classes/class_editorfilesystemdirectory.rst
2024-05-31 13:54:35 +00:00

243 lines
13 KiB
ReStructuredText

: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/doc/classes/EditorFileSystemDirectory.xml.
.. _class_EditorFileSystemDirectory:
EditorFileSystemDirectory
=========================
**Inherits:** :ref:`Object<class_Object>`
A directory for the resource filesystem.
.. rst-class:: classref-introduction-group
Description
-----------
A more generalized, low-level variation of the directory concept.
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find_dir_index<class_EditorFileSystemDirectory_method_find_dir_index>`\ (\ name\: :ref:`String<class_String>`\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`find_file_index<class_EditorFileSystemDirectory_method_find_file_index>`\ (\ name\: :ref:`String<class_String>`\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_file<class_EditorFileSystemDirectory_method_get_file>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_file_count<class_EditorFileSystemDirectory_method_get_file_count>`\ (\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_file_import_is_valid<class_EditorFileSystemDirectory_method_get_file_import_is_valid>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_file_path<class_EditorFileSystemDirectory_method_get_file_path>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_file_script_class_extends<class_EditorFileSystemDirectory_method_get_file_script_class_extends>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_file_script_class_name<class_EditorFileSystemDirectory_method_get_file_script_class_name>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`StringName<class_StringName>` | :ref:`get_file_type<class_EditorFileSystemDirectory_method_get_file_type>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_name<class_EditorFileSystemDirectory_method_get_name>`\ (\ ) |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` | :ref:`get_parent<class_EditorFileSystemDirectory_method_get_parent>`\ (\ ) |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_path<class_EditorFileSystemDirectory_method_get_path>`\ (\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` | :ref:`get_subdir<class_EditorFileSystemDirectory_method_get_subdir>`\ (\ idx\: :ref:`int<class_int>`\ ) |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_subdir_count<class_EditorFileSystemDirectory_method_get_subdir_count>`\ (\ ) |const| |
+-------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Method Descriptions
-------------------
.. _class_EditorFileSystemDirectory_method_find_dir_index:
.. rst-class:: classref-method
:ref:`int<class_int>` **find_dir_index**\ (\ name\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_find_dir_index>`
Returns the index of the directory with name ``name`` or ``-1`` if not found.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_find_file_index:
.. rst-class:: classref-method
:ref:`int<class_int>` **find_file_index**\ (\ name\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_find_file_index>`
Returns the index of the file with name ``name`` or ``-1`` if not found.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_file:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_file**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_get_file>`
Returns the name of the file at index ``idx``.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_file_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_file_count**\ (\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_get_file_count>`
Returns the number of files in this directory.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_file_import_is_valid:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **get_file_import_is_valid**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_get_file_import_is_valid>`
Returns ``true`` if the file at index ``idx`` imported properly.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_file_path:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_file_path**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_get_file_path>`
Returns the path to the file at index ``idx``.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_file_script_class_extends:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_file_script_class_extends**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_get_file_script_class_extends>`
Returns the base class of the script class defined in the file at index ``idx``. If the file doesn't define a script class using the ``class_name`` syntax, this will return an empty string.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_file_script_class_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_file_script_class_name**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_get_file_script_class_name>`
Returns the name of the script class defined in the file at index ``idx``. If the file doesn't define a script class using the ``class_name`` syntax, this will return an empty string.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_file_type:
.. rst-class:: classref-method
:ref:`StringName<class_StringName>` **get_file_type**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_get_file_type>`
Returns the resource type of the file at index ``idx``. This returns a string such as ``"Resource"`` or ``"GDScript"``, *not* a file extension such as ``".gd"``.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_name**\ (\ ) :ref:`🔗<class_EditorFileSystemDirectory_method_get_name>`
Returns the name of this directory.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_parent:
.. rst-class:: classref-method
:ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` **get_parent**\ (\ ) :ref:`🔗<class_EditorFileSystemDirectory_method_get_parent>`
Returns the parent directory for this directory or ``null`` if called on a directory at ``res://`` or ``user://``.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_path:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_path**\ (\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_get_path>`
Returns the path to this directory.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_subdir:
.. rst-class:: classref-method
:ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` **get_subdir**\ (\ idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_EditorFileSystemDirectory_method_get_subdir>`
Returns the subdirectory at index ``idx``.
.. rst-class:: classref-item-separator
----
.. _class_EditorFileSystemDirectory_method_get_subdir_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_subdir_count**\ (\ ) |const| :ref:`🔗<class_EditorFileSystemDirectory_method_get_subdir_count>`
Returns the number of subdirectories in this directory.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |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.)`