Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.FileSystem Class Reference

File system. More...

Inheritance diagram for Dragengine.FileSystem:

Static Public Member Functions

Management
static byte getSeparator ()
 Filepath separator character for this operating system.
static byte getPathSeparator ()
 Path list separator character for this operating system.
static String getCurrentPrefix ()
 Current path prefix for this operating system.
static String getGamePath ()
 Path string set by the game.
Virtual file system access
static bool existsFile (String path)
 File exist.
static bool canReadFile (String path)
 File can be read.
static bool canWriteFile (String path)
 File can be written.
static bool canDeleteFile (String path)
 File can be deleted.
static void deleteFile (String path)
 Delete file.
static FileType getTypeOfFile (String path)
 Type of file.
static void searchFiles (String directory, bool recursive, Block ablock)
 Search for files.
static bool pathMatchesPattern (String string, String pattern)
 Path matches a file pattern.
static void browseOverlay (String path)
 Browse overlay path.
static void browseCapture (String path)
 Browse capture path.
static void browseConfig (String path)
 Browse config path.
static Array getFileExtensions (ResourceLoaderType type)
 Get file extension list for resource type for use in file browsing.
static void openUrl (String url)
 Open URL using user defined application.

Detailed Description

File system.

This is a native class. This is a pure static class. The class can not be instantiated

Member Function Documentation

◆ browseCapture()

void Dragengine.FileSystem.browseCapture ( String path)
static

Browse capture path.

Version
1.7

Open operating system native file browser showing the content of path inside the currently running game capture directory. If the directory not exist it is created.

If path is an absolute path it has to start with "/capture" directory. If path is relative it is considered relative to "/capture" directory.

Calling this function switches the focus to another application.

References browseOverlay().

Referenced by browseConfig().

◆ browseConfig()

void Dragengine.FileSystem.browseConfig ( String path)
static

Browse config path.

Version
1.7

Open operating system native file browser showing the content of path inside the currently running game config directory. If the directory not exist it is created.

If path is an absolute path it has to start with "/config" directory. If path is relative it is considered relative to "/config" directory.

Calling this function switches the focus to another application.

References browseCapture().

Referenced by openUrl().

◆ browseOverlay()

void Dragengine.FileSystem.browseOverlay ( String path)
static

Browse overlay path.

Version
1.7

Open operating system native file browser showing the content of path inside the currently running game overlay directory. If the directory not exist it is created.

Calling this function switches the focus to another application.

References pathMatchesPattern(), and searchFiles().

Referenced by browseCapture().

◆ canDeleteFile()

bool Dragengine.FileSystem.canDeleteFile ( String path)
static

File can be deleted.

Referenced by getTypeOfFile().

◆ canReadFile()

bool Dragengine.FileSystem.canReadFile ( String path)
static

File can be read.

Referenced by deleteFile().

◆ canWriteFile()

bool Dragengine.FileSystem.canWriteFile ( String path)
static

File can be written.

References existsFile().

Referenced by getTypeOfFile().

◆ deleteFile()

void Dragengine.FileSystem.deleteFile ( String path)
static

Delete file.

References canReadFile().

Referenced by getTypeOfFile().

◆ existsFile()

bool Dragengine.FileSystem.existsFile ( String path)
static

File exist.

If the filename is relative it is checked against the game path.

Referenced by canWriteFile().

◆ getCurrentPrefix()

String Dragengine.FileSystem.getCurrentPrefix ( )
static

Current path prefix for this operating system.

Referenced by getGamePath().

◆ getFileExtensions()

Array Dragengine.FileSystem.getFileExtensions ( ResourceLoaderType type)
static

Get file extension list for resource type for use in file browsing.

Version
1.7

Returns an Array of FileExtension objects. For each running engine module of the respective type one FileExtension object is created. The FileExtension object contains the display name, an Array of file patterns in the form ".xyz" and a default extension in the form ".xyz".

Referenced by openUrl().

◆ getGamePath()

String Dragengine.FileSystem.getGamePath ( )
static

Path string set by the game.

References getCurrentPrefix(), and getGamePath().

Referenced by getGamePath().

◆ getPathSeparator()

byte Dragengine.FileSystem.getPathSeparator ( )
static

Path list separator character for this operating system.

References getPathSeparator().

Referenced by getPathSeparator().

◆ getSeparator()

byte Dragengine.FileSystem.getSeparator ( )
static

Filepath separator character for this operating system.

References getSeparator().

Referenced by getSeparator().

◆ getTypeOfFile()

FileType Dragengine.FileSystem.getTypeOfFile ( String path)
static

Type of file.

References canDeleteFile(), canWriteFile(), and deleteFile().

Referenced by searchFiles().

◆ openUrl()

void Dragengine.FileSystem.openUrl ( String url)
static

Open URL using user defined application.

Version
1.9

Calling this function switches the focus to another application.

References browseConfig(), getFileExtensions(), and openUrl().

Referenced by openUrl().

◆ pathMatchesPattern()

bool Dragengine.FileSystem.pathMatchesPattern ( String string,
String pattern )
static

Path matches a file pattern.

Referenced by browseOverlay().

◆ searchFiles()

void Dragengine.FileSystem.searchFiles ( String directory,
bool recursive,
Block ablock )
static

Search for files.

Each file entry is visited using the provided block. The block receives as arguments the file name (String) and file type (FileType). The block has to return boolean indicating if the search has to continue(true) or stop(false).

Example code:

FileSystem.searchFiles("/content/models", true, block String path, FileType type
...
return true // continue(true) or stop(false)
end)
File system.
Definition FileSystem.ds:17
static void searchFiles(String directory, bool recursive, Block ablock)
Search for files.

References getTypeOfFile().

Referenced by browseOverlay().


The documentation for this class was generated from the following file: