An interface to manipulate files in a platform agnostic way. This allow exporters to work on files without knowing what is actually being used to manipulate files (Node.js, browser shims, etc...)
More...
#include <AbstractFileSystem.h>
An interface to manipulate files in a platform agnostic way. This allow exporters to work on files without knowing what is actually being used to manipulate files (Node.js, browser shims, etc...)
◆ CopyFile()
virtual bool gd::AbstractFileSystem::CopyFile |
( |
const gd::String & |
file, |
|
|
const gd::String & |
destination |
|
) |
| |
|
pure virtual |
Copy a file.
- Returns
- true if the operation succeeded.
◆ MakeAbsolute()
virtual bool gd::AbstractFileSystem::MakeAbsolute |
( |
gd::String & |
filename, |
|
|
const gd::String & |
baseDirectory |
|
) |
| |
|
pure virtual |
Change the filename so that it is absolute, using the base directory passed as parameter.
- Returns
- true if the operation succeeded.
◆ MakeRelative()
virtual bool gd::AbstractFileSystem::MakeRelative |
( |
gd::String & |
filename, |
|
|
const gd::String & |
baseDirectory |
|
) |
| |
|
pure virtual |
Change the filename so that it is relative to the base directory passed as parameter.
- Returns
- true if the operation succeeded.
◆ MkDir()
virtual void gd::AbstractFileSystem::MkDir |
( |
const gd::String & |
path | ) |
|
|
pure virtual |
Create the specified directory.
- Parameters
-
path | The directory to create. |
◆ NormalizeSeparator()
Make sure that only slash are used as a path separator: all backslashs are converted to forward slashs.
Use this method when you get a filename from a file dialog for example: it ensures that filenames will be usable from Windows to Linux (as long as the filename is not an absolute path).
- Parameters
-
filename | The filename to normalize |
- Returns
- The normalized filename.
◆ ReadDir()
Return a vector containing the files in the specified path.
- Parameters
-
path | The path to read |
extension | If specified, only file finishing with this extension will be returned |
- Returns
- A vector with all the matched files
◆ ReadFile()
Read the content of a file.
- Returns
- The content of the file.
◆ WriteToFile()
virtual bool gd::AbstractFileSystem::WriteToFile |
( |
const gd::String & |
file, |
|
|
const gd::String & |
content |
|
) |
| |
|
pure virtual |
Write the content of a string to a file.
- Returns
- true if the operation succeeded.
The documentation for this class was generated from the following files: