class_editorfilesystemdirectory.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the EditorFileSystemDirectory.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_EditorFileSystemDirectory:
  6. EditorFileSystemDirectory
  7. =========================
  8. **Inherits:** :ref:`Object<class_Object>`
  9. A directory for the resource filesystem.
  10. Description
  11. -----------
  12. A more generalized, low-level variation of the directory concept.
  13. Methods
  14. -------
  15. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`int<class_int>` | :ref:`find_dir_index<class_EditorFileSystemDirectory_method_find_dir_index>` **(** :ref:`String<class_String>` name **)** |const| |
  17. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`int<class_int>` | :ref:`find_file_index<class_EditorFileSystemDirectory_method_find_file_index>` **(** :ref:`String<class_String>` name **)** |const| |
  19. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`String<class_String>` | :ref:`get_file<class_EditorFileSystemDirectory_method_get_file>` **(** :ref:`int<class_int>` idx **)** |const| |
  21. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`get_file_count<class_EditorFileSystemDirectory_method_get_file_count>` **(** **)** |const| |
  23. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`get_file_import_is_valid<class_EditorFileSystemDirectory_method_get_file_import_is_valid>` **(** :ref:`int<class_int>` idx **)** |const| |
  25. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`String<class_String>` | :ref:`get_file_path<class_EditorFileSystemDirectory_method_get_file_path>` **(** :ref:`int<class_int>` idx **)** |const| |
  27. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`String<class_String>` | :ref:`get_file_script_class_extends<class_EditorFileSystemDirectory_method_get_file_script_class_extends>` **(** :ref:`int<class_int>` idx **)** |const| |
  29. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`String<class_String>` | :ref:`get_file_script_class_name<class_EditorFileSystemDirectory_method_get_file_script_class_name>` **(** :ref:`int<class_int>` idx **)** |const| |
  31. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`String<class_String>` | :ref:`get_file_type<class_EditorFileSystemDirectory_method_get_file_type>` **(** :ref:`int<class_int>` idx **)** |const| |
  33. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`String<class_String>` | :ref:`get_name<class_EditorFileSystemDirectory_method_get_name>` **(** **)** |
  35. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` | :ref:`get_parent<class_EditorFileSystemDirectory_method_get_parent>` **(** **)** |
  37. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`String<class_String>` | :ref:`get_path<class_EditorFileSystemDirectory_method_get_path>` **(** **)** |const| |
  39. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` | :ref:`get_subdir<class_EditorFileSystemDirectory_method_get_subdir>` **(** :ref:`int<class_int>` idx **)** |
  41. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`int<class_int>` | :ref:`get_subdir_count<class_EditorFileSystemDirectory_method_get_subdir_count>` **(** **)** |const| |
  43. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. Method Descriptions
  45. -------------------
  46. .. _class_EditorFileSystemDirectory_method_find_dir_index:
  47. - :ref:`int<class_int>` **find_dir_index** **(** :ref:`String<class_String>` name **)** |const|
  48. Returns the index of the directory with name ``name`` or ``-1`` if not found.
  49. ----
  50. .. _class_EditorFileSystemDirectory_method_find_file_index:
  51. - :ref:`int<class_int>` **find_file_index** **(** :ref:`String<class_String>` name **)** |const|
  52. Returns the index of the file with name ``name`` or ``-1`` if not found.
  53. ----
  54. .. _class_EditorFileSystemDirectory_method_get_file:
  55. - :ref:`String<class_String>` **get_file** **(** :ref:`int<class_int>` idx **)** |const|
  56. Returns the name of the file at index ``idx``.
  57. ----
  58. .. _class_EditorFileSystemDirectory_method_get_file_count:
  59. - :ref:`int<class_int>` **get_file_count** **(** **)** |const|
  60. Returns the number of files in this directory.
  61. ----
  62. .. _class_EditorFileSystemDirectory_method_get_file_import_is_valid:
  63. - :ref:`bool<class_bool>` **get_file_import_is_valid** **(** :ref:`int<class_int>` idx **)** |const|
  64. Returns ``true`` if the file at index ``idx`` imported properly.
  65. ----
  66. .. _class_EditorFileSystemDirectory_method_get_file_path:
  67. - :ref:`String<class_String>` **get_file_path** **(** :ref:`int<class_int>` idx **)** |const|
  68. Returns the path to the file at index ``idx``.
  69. ----
  70. .. _class_EditorFileSystemDirectory_method_get_file_script_class_extends:
  71. - :ref:`String<class_String>` **get_file_script_class_extends** **(** :ref:`int<class_int>` idx **)** |const|
  72. 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.
  73. ----
  74. .. _class_EditorFileSystemDirectory_method_get_file_script_class_name:
  75. - :ref:`String<class_String>` **get_file_script_class_name** **(** :ref:`int<class_int>` idx **)** |const|
  76. 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.
  77. ----
  78. .. _class_EditorFileSystemDirectory_method_get_file_type:
  79. - :ref:`String<class_String>` **get_file_type** **(** :ref:`int<class_int>` idx **)** |const|
  80. 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"``.
  81. ----
  82. .. _class_EditorFileSystemDirectory_method_get_name:
  83. - :ref:`String<class_String>` **get_name** **(** **)**
  84. Returns the name of this directory.
  85. ----
  86. .. _class_EditorFileSystemDirectory_method_get_parent:
  87. - :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` **get_parent** **(** **)**
  88. Returns the parent directory for this directory or ``null`` if called on a directory at ``res://`` or ``user://``.
  89. ----
  90. .. _class_EditorFileSystemDirectory_method_get_path:
  91. - :ref:`String<class_String>` **get_path** **(** **)** |const|
  92. Returns the path to this directory.
  93. ----
  94. .. _class_EditorFileSystemDirectory_method_get_subdir:
  95. - :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` **get_subdir** **(** :ref:`int<class_int>` idx **)**
  96. Returns the subdirectory at index ``idx``.
  97. ----
  98. .. _class_EditorFileSystemDirectory_method_get_subdir_count:
  99. - :ref:`int<class_int>` **get_subdir_count** **(** **)** |const|
  100. Returns the number of subdirectories in this directory.
  101. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  102. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  103. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`