|
|
|
Functions allowing you to search for files, read them, write them, and access their properties. More...
Classes | |
| class | FileDialog |
| Base class responsible for displaying an OS file browser. More... | |
| class | FileObject |
| This class is responsible opening, reading, creating, and saving file contents. More... | |
| class | FileStreamObject |
| A wrapper around StreamObject for parsing text and data from files. More... | |
| class | OpenFileDialog |
| Derived from FileDialog, this class is responsible for opening a file browser with the intention of opening a file. More... | |
| class | OpenFolderDialog |
| OS level dialog used for browsing folder structures. More... | |
| class | SaveFileDialog |
| Derived from FileDialog, this class is responsible for opening a file browser with the intention of saving a file. More... | |
| class | SimXMLDocument |
| File I/O object used for creating, reading, and writing XML documents. More... | |
| class | StreamObject |
| Base class for working with streams. More... | |
| class | ZipObject |
| Provides access to a zip file. More... | |
Modules | |
| File Searching | |
Functions for searching files by name patterns. | |
Functions | |
| bool | createPath (string path) |
| Create the given directory or the path leading to the given filename. | |
| string | expandFilename (string filename) |
| Grabs the full path of a specified file. | |
| string | expandOldFilename (string filename) |
| Retrofits a filepath that uses old Torque style. | |
| String | fileBase (string fileName) |
| Get the base of a file name (removes extension). | |
| String | fileCreatedTime (string fileName) |
| Returns a platform specific formatted string with the creation time for the file. | |
| bool | fileDelete (string path) |
| Delete a file from the hard drive. | |
| String | fileExt (string fileName) |
| Get the extension of a file. | |
| String | fileModifiedTime (string fileName) |
| Returns a platform specific formatted string with the last modified time for the file. | |
| String | fileName (string fileName) |
| Get the file name of a file (removes extension and path). | |
| String | filePath (string fileName) |
| Get the path of a file (removes name and extension). | |
| int | fileSize (string fileName) |
| Determines the size of a file on disk. | |
| String | getCurrentDirectory () |
| Return the current working directory. | |
| String | getDirectoryList (string path, int depth=0) |
| Gathers a list of directories starting at the given path. | |
| String | getExecutableName () |
| Gets the name of the game's executable. | |
| int | getFileCRC (string fileName) |
| Provides the CRC checksum of the given file. | |
| String | getMainDotCsDir () |
| Get the absolute path to the directory that contains the main.cs script from which the engine was started. | |
| String | getWorkingDirectory () |
| Reports the current directory. | |
| bool | IsDirectory (string directory) |
| Determines if a specified directory exists or not. | |
| bool | isFile (string fileName) |
| Determines if the specified file exists or not. | |
| bool | isWriteableFileName (string fileName) |
| Determines if a file name can be written to using File I/O. | |
| String | makeFullPath (string path, string cwd="") |
| Converts a relative file path to a full path. | |
| String | makeRelativePath (string path, string to="") |
| Turns a full or local path to a relative one. | |
| void | openFile (string file) |
| Open the given file through the system. This will usually open the file in its associated application. | |
| void | openFolder (string path) |
| Open the given folder in the system's file manager. | |
| String | pathConcat (string path, string file) |
| Combines two separate strings containing a file path and file name together into a single string. | |
| bool | pathCopy (string fromFile, string toFile, bool noOverwrite=true) |
| Copy a file to a new location. | |
| bool | setCurrentDirectory (string path) |
| Set the current working directory. | |
| void | startFileChangeNotifications () |
| Start watching resources for file changes. | |
| void | stopFileChangeNotifications () |
| Stop watching resources for file changes. | |
Variables | |
| string | $Con::File |
| The currently executing script file. | |
| string | $Con::Root |
| The mod folder for the currently executing script file. | |
Functions allowing you to search for files, read them, write them, and access their properties.
| bool createPath | ( | string | path | ) |
Create the given directory or the path leading to the given filename.
If path ends in a trailing slash, then all components in the given path will be created as directories (if not already in place). If path, does not end in a trailing slash, then the last component of the path is taken to be a file name and only the directory components of the path will be created.
| path | The path to create. |
| string expandFilename | ( | string | filename | ) |
Grabs the full path of a specified file.
| filename | Name of the local file to locate |
| string expandOldFilename | ( | string | filename | ) |
Retrofits a filepath that uses old Torque style.
| String fileBase | ( | string | fileName | ) |
Get the base of a file name (removes extension).
| fileName | Name and path of file to check |
| String fileCreatedTime | ( | string | fileName | ) |
Returns a platform specific formatted string with the creation time for the file.
| fileName | Name and path of file to check |
| bool fileDelete | ( | string | path | ) |
Delete a file from the hard drive.
| path | Name and path of the file to delete |
| String fileExt | ( | string | fileName | ) |
Get the extension of a file.
| fileName | Name and path of file |
| String fileModifiedTime | ( | string | fileName | ) |
Returns a platform specific formatted string with the last modified time for the file.
| fileName | Name and path of file to check |
| String fileName | ( | string | fileName | ) |
Get the file name of a file (removes extension and path).
| fileName | Name and path of file to check |
| String filePath | ( | string | fileName | ) |
Get the path of a file (removes name and extension).
| fileName | Name and path of file to check |
| int fileSize | ( | string | fileName | ) |
Determines the size of a file on disk.
| fileName | Name and path of the file to check |
| String getCurrentDirectory | ( | ) |
Return the current working directory.
| String getDirectoryList | ( | string | path, | |
| int | depth = 0 | |||
| ) |
Gathers a list of directories starting at the given path.
| path | String containing the path of the directory | |
| depth | Depth of search, as in how many subdirectories to parse through |
| String getExecutableName | ( | ) |
Gets the name of the game's executable.
| int getFileCRC | ( | string | fileName | ) |
Provides the CRC checksum of the given file.
| fileName | The path to the file. |
| String getMainDotCsDir | ( | ) |
Get the absolute path to the directory that contains the main.cs script from which the engine was started.
This directory will usually contain all the game assets and, in a user-side game installation, will usually be read-only.
| String getWorkingDirectory | ( | ) |
Reports the current directory.
| bool IsDirectory | ( | string | directory | ) |
Determines if a specified directory exists or not.
| directory | String containing path in the form of "foo/bar" |
| bool isFile | ( | string | fileName | ) |
Determines if the specified file exists or not.
| fileName | The path to the file. |
| bool isWriteableFileName | ( | string | fileName | ) |
Determines if a file name can be written to using File I/O.
| fileName | Name and path of file to check |
| String makeFullPath | ( | string | path, | |
| string | cwd = "" | |||
| ) |
Converts a relative file path to a full path.
For example, "./console.log" becomes "C:/Torque/t3d/examples/FPS Example/game/console.log"
| path | Name of file or path to check | |
| cwd | Optional current working directory from which to build the full path. |
| String makeRelativePath | ( | string | path, | |
| string | to = "" | |||
| ) |
Turns a full or local path to a relative one.
For example, "./game/art" becomes "game/art"
| path | Full path (may include a file) to convert | |
| to | Optional base path used for the conversion. If not supplied the current working directory is used. |
| void openFile | ( | string | file | ) |
Open the given file through the system. This will usually open the file in its associated application.
| file | Path of the file to open. |
| void openFolder | ( | string | path | ) |
Open the given folder in the system's file manager.
| path | full path to a directory. |
| String pathConcat | ( | string | path, | |
| string | file | |||
| ) |
Combines two separate strings containing a file path and file name together into a single string.
| path | String containing file path | |
| file | String containing file name |
| bool pathCopy | ( | string | fromFile, | |
| string | toFile, | |||
| bool | noOverwrite = true | |||
| ) |
Copy a file to a new location.
| fromFile | Path of the file to copy. | |
| toFile | Path where to copy fromFile to. | |
| noOverwrite | If true, then fromFile will not overwrite a file that may already exist at toFile. |
| bool setCurrentDirectory | ( | string | path | ) |
Set the current working directory.
| path | The absolute or relative (to the current working directory) path of the directory which should be made the new working directory. |
| void startFileChangeNotifications | ( | ) |
Start watching resources for file changes.
Typically this is called during initializeCore().
| void stopFileChangeNotifications | ( | ) |
Stop watching resources for file changes.
Typically this is called during shutdownCore().
| string $Con::File |
The currently executing script file.
| string $Con::Root |
The mod folder for the currently executing script file.