|
wavelength 1.0.0
|
#include "utl/Str.h"

Go to the source code of this file.
Classes | |
| class | File |
| Open file of the host or the disc. More... | |
Enumerations | |
| enum | FileOpenMode { FILE_OPEN_WRITE = 1 , FILE_OPEN_READ = 2 , FILE_OPEN_CREATE = 0x100 , FILE_OPEN_TRUNCATE = 0x200 } |
| Bits of the open mode of NewFile(). More... | |
Functions | |
| File * | NewFile (const char *name, int mode, int flags) |
| Open a file from the archive or the host. | |
| void | FileLogInit (const char *file) |
| Open the file log, which lists every file the program reads. | |
| void | FileInit () |
| Read the asynchronous file configuration. | |
| void | FileTerminate () |
| Close the file log. | |
| void | FileMakeLocalPath (String &out, const char *path) |
| Store a path as the host opens it. | |
| void | FileCopyPath (char *out, int size, const char *path) |
| Copy a path, or store an empty string for a null path. | |
| const char * | FileRoot () |
| Report the working directory at the first call, normalised. | |
| const char * | FileNormalizePath (const char *path) |
| Lower-case a path, turn backslashes into slashes, and resolve .
| |
| const char * | FileRelativePath (const char *path, const char *root) |
| Express a path relative to a directory, both normalised. | |
| bool | FileIsAbsolute (const char *path) |
| Report whether a path is absolute. | |
| const char * | FileGetPath (const char *path) |
| Report the directory of a path. | |
| const char * | FileGetExt (const char *path) |
| Report the extension of a path. | |
| const char * | FileGetBase (const char *path) |
| Report the file name of a path without its directory or extension. | |
| const char * | FileLocalize (const char *path) |
| Express a path relative to the root, as the archive indexes it. | |
| enum FileOpenMode |
Bits of the open mode of NewFile().
The low bits pass through to _open.
| Enumerator | |
|---|---|
| FILE_OPEN_WRITE | Open for writing. |
| FILE_OPEN_READ | Open for reading. |
| FILE_OPEN_CREATE | Create the file when it does not exist. |
| FILE_OPEN_TRUNCATE | Discard the contents of an existing file. |
| File * NewFile | ( | const char * | name, |
| int | mode, | ||
| int | flags ) |
Open a file from the archive or the host.
A read from the disc comes from the archive unless the flags are 1. When the file log is open, each read appends the file's path relative to the root to the log.
| name | The path. |
| mode | The open mode, a combination of FileOpenMode bits. |
| flags | 1 to bypass the archive. |
| void FileLogInit | ( | const char * | file | ) |
Open the file log, which lists every file the program reads.
| file | The path of the log, or null or empty for no log. |
| void FileInit | ( | ) |
Read the asynchronous file configuration.
| void FileTerminate | ( | ) |
Close the file log.
| void FileMakeLocalPath | ( | String & | out, |
| const char * | path ) |
Store a path as the host opens it.
On Windows the path is unchanged.
| out | Receives the path. |
| path | The path. |
| void FileCopyPath | ( | char * | out, |
| int | size, | ||
| const char * | path ) |
Copy a path, or store an empty string for a null path.
| out | Receives the path. |
| size | The size of #out. The copy does not limit itself to it. |
| path | The path, or null. |
| const char * FileRoot | ( | ) |
Report the working directory at the first call, normalised.
| const char * FileNormalizePath | ( | const char * | path | ) |
Lower-case a path, turn backslashes into slashes, and resolve .
and .. components.
Every component that starts with a dot and is not .. is dropped. A path that ends in .. normalises to the empty string.
| path | The path. |
| const char * FileRelativePath | ( | const char * | path, |
| const char * | root ) |
Express a path relative to a directory, both normalised.
| path | The path. |
| root | The directory. |
| bool FileIsAbsolute | ( | const char * | path | ) |
Report whether a path is absolute.
| path | The path, or null. |
| const char * FileGetPath | ( | const char * | path | ) |
Report the directory of a path.
| path | The path, or null. |
| const char * FileGetExt | ( | const char * | path | ) |
Report the extension of a path.
| path | The path. |
| const char * FileGetBase | ( | const char * | path | ) |
Report the file name of a path without its directory or extension.
| path | The path. |
| const char * FileLocalize | ( | const char * | path | ) |
Express a path relative to the root, as the archive indexes it.
| path | The path, absolute or relative to the root. |