File management utility class.
More...
#include <Files.hpp>
|
static std::string | toAbsolute (const std::string &filepath_string) |
| STD wrapper to convert a filepath to absolute format.
|
|
static std::fstream * | load (const std::string &filepath_string, bool write) |
| Add given file to the cache and open it.
|
|
static std::string | read (const std::string &filepath_string) |
| Load a file in memory, then read and return its contents.
|
|
static bool | exists (const std::string &filepath_string) |
| Check whether a given file exists, based on its filepath.
|
|
static void | write (const std::string &filepath_string, const std::string &contents) |
| Write contents to a specified file by its filepath.
|
|
File management utility class.
◆ exists()
bool linc::Files::exists |
( |
const std::string & | filepath_string | ) |
|
|
static |
Check whether a given file exists, based on its filepath.
- Parameters
-
filepath_string | The filepath to read in string format. |
- Returns
- Boolean corresponding to the result of the test.
◆ load()
std::fstream * linc::Files::load |
( |
const std::string & | filepath_string, |
|
|
bool | write = false ) |
|
static |
Add given file to the cache and open it.
- Parameters
-
filepath_string | The filepath to read in string format. |
write | Whether to open the file with write permissions. |
- Returns
- Pointer to the file's file-stream object.
◆ read()
std::string linc::Files::read |
( |
const std::string & | filepath_string | ) |
|
|
static |
Load a file in memory, then read and return its contents.
- Parameters
-
filepath_string | The filepath to read in string format. |
- Returns
- The contents of the file.
◆ toAbsolute()
std::string linc::Files::toAbsolute |
( |
const std::string & | filepath_string | ) |
|
|
static |
STD wrapper to convert a filepath to absolute format.
- Parameters
-
filepath_string | The relative filepath. |
- Returns
- The absolute equivalent of the given filepath.
◆ write()
void linc::Files::write |
( |
const std::string & | filepath_string, |
|
|
const std::string & | contents ) |
|
static |
Write contents to a specified file by its filepath.
- Parameters
-
filepath_string | The filepath to write to in string format. |
contents | The new contents of the file. |
The documentation for this class was generated from the following files: