File and path utilities.
More...
|
bool | PathExists (const std::string &path) |
| Check if path exists.
|
|
bool | PathIsDirectory (const std::string &path) |
| Check if path is a directory.
|
|
bool | PathIsFile (const std::string &path) |
| Check if path is a regular file.
|
|
bool | PathIsSymlink (const std::string &path) |
| Check if path is a symlink.
|
|
bool | PathIsReadable (const std::string &path) |
| Check if path is readable.
|
|
bool | PathIsWritable (const std::string &path) |
| Check if path is writable.
|
|
bool | PathIsExecutable (const std::string &path) |
| Check if path is executable.
|
|
std::size_t | FileSize (const std::string &path) |
| Get file size.
|
|
bool | FileSlurp (const std::string &path, std::vector< uint8_t > &data) |
| Read entire file into a string.
|
|
bool | FileSpew (const std::string &path, const std::vector< uint8_t > &data) |
| Write string to file.
|
|
◆ PathExists()
bool fpsdk::common::path::PathExists |
( |
const std::string & | path | ) |
|
Check if path exists.
- Parameters
-
[in] | path | Path (file or directory) to check |
- Returns
- true if path exists, false otherwise
◆ PathIsDirectory()
bool fpsdk::common::path::PathIsDirectory |
( |
const std::string & | path | ) |
|
Check if path is a directory.
- Parameters
-
- Returns
- true if path is a directory, false otherwise
◆ PathIsFile()
bool fpsdk::common::path::PathIsFile |
( |
const std::string & | path | ) |
|
Check if path is a regular file.
- Parameters
-
- Returns
- true if path is a regular file, false otherwise
◆ PathIsSymlink()
bool fpsdk::common::path::PathIsSymlink |
( |
const std::string & | path | ) |
|
Check if path is a symlink.
- Parameters
-
- Returns
- true if path is a symlink, false otherwise
◆ PathIsReadable()
bool fpsdk::common::path::PathIsReadable |
( |
const std::string & | path | ) |
|
Check if path is readable.
- Parameters
-
[in] | path | Path (file or directory) to check |
- Returns
- true if path is readable, false otherwise
◆ PathIsWritable()
bool fpsdk::common::path::PathIsWritable |
( |
const std::string & | path | ) |
|
Check if path is writable.
- Parameters
-
[in] | path | Path (file or directory) to check |
- Returns
- true if path is writable, false otherwise
◆ PathIsExecutable()
bool fpsdk::common::path::PathIsExecutable |
( |
const std::string & | path | ) |
|
Check if path is executable.
- Parameters
-
[in] | path | Path (file or directory) to check |
- Returns
- true if path is executable, false otherwise
◆ FileSize()
std::size_t fpsdk::common::path::FileSize |
( |
const std::string & | path | ) |
|
Get file size.
- Parameters
-
- Returns
- the size of the file in bytes, 0 is only valid if file is readable
◆ FileSlurp()
bool fpsdk::common::path::FileSlurp |
( |
const std::string & | path, |
|
|
std::vector< uint8_t > & | data ) |
Read entire file into a string.
- Parameters
-
[in] | path | File path |
[out] | data | The data |
- Returns
- true if data was successfully read from file, false otherwise
◆ FileSpew()
bool fpsdk::common::path::FileSpew |
( |
const std::string & | path, |
|
|
const std::vector< uint8_t > & | data ) |
Write string to file.
- Parameters
-
[in] | path | File path |
[out] | data | The data |
- Returns
- true if data was successfully written to file, false otherwise