EditorFileSystemDirectory
A directory for the resource filesystem.
EditorFileSystemDirectory.swift:17class EditorFileSystemDirectory
A more generalized, low-level variation of the directory concept.
Superclasses
class Object
Base class for all other classes in the engine.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
func findDirIndex(name: String
) -> Int32 Returns the index of the directory with name
name
or-1
if not found.func findFileIndex(name: String
) -> Int32 Returns the index of the file with name
name
or-1
if not found.func getFile(idx: Int32
) -> String Returns the name of the file at index
idx
.func getFileCount(
) -> Int32 Returns the number of files in this directory.
func getFileImportIsValid(idx: Int32
) -> Bool Returns
true
if the file at indexidx
imported properly.func getFilePath(idx: Int32
) -> String Returns the path to the file at index
idx
.func getFileScriptClassExtends(idx: Int32
) -> String 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 theclass_name
syntax, this will return an empty string.func getFileScriptClassName(idx: Int32
) -> String Returns the name of the script class defined in the file at index
idx
. If the file doesn’t define a script class using theclass_name
syntax, this will return an empty string.func getFileType(idx: Int32
) -> StringName 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"
.func getName(
) -> String Returns the name of this directory.
func getParent(
) -> EditorFileSystemDirectory? Returns the parent directory for this directory or
null
if called on a directory atres://
oruser://
.func getPath(
) -> String Returns the path to this directory.
func getSubdir(idx: Int32
) -> EditorFileSystemDirectory? Returns the subdirectory at index
idx
.func getSubdirCount(
) -> Int32 Returns the number of subdirectories in this directory.