Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
Directory Class Reference

Filesystem directory manipulation. More...

Public Member Functions

boolean Create (string path)
 Creates a folder at the path.
boolean Exists (string path)
 Determines if the folder at the path exists.
array GetFiles (string directory, string pattern, boolean allDirs)
 Gets the paths of all the files in the directory.
array GetDirectories (string directory, string pattern, boolean allDirs)
 Gets the paths of all the folders in the directory.

Detailed Description

Filesystem directory manipulation.

Member Function Documentation

◆ Create()

boolean Directory.Create ( string path)

Creates a folder at the path.

Parameters
pathThe path of the folder to create.
Returns
Returns whether folder creation was successful.

◆ Exists()

boolean Directory.Exists ( string path)

Determines if the folder at the path exists.

Parameters
pathThe path of the folder to check for existence.
Returns
Returns whether the folder exists.

◆ GetDirectories()

array Directory.GetDirectories ( string directory,
string pattern,
boolean allDirs )

Gets the paths of all the folders in the directory.

Parameters
directoryThe path of the folder to find folders in.
patternThe search pattern for the folders. (ex: "*" for any folder, "image*" any folder that starts with "image")
allDirsWhether to search into all folders in the directory.
Returns
Returns an array containing the filepaths as strings.

◆ GetFiles()

array Directory.GetFiles ( string directory,
string pattern,
boolean allDirs )

Gets the paths of all the files in the directory.

Parameters
directoryThe path of the folder to find files in.
patternThe search pattern for the files. (ex: "*" for any file, "*.*" any file name with any file type, "*.png" any PNG file)
allDirsWhether to search into all folders in the directory.
Returns
Returns an array containing the filepaths as strings.