BoosterSeat
0.1
A C++ library that includes common utilities that are used in other projects.
|
Internal inline functions used only in this file. More...
Functions | |
void | assertDoesNotExist (const Path &path) |
Checks if a path exists, otherwise it will throw an exception. More... | |
void | assertExists (const Path &path) |
Checks if a path exists, otherwise it will throw an exception. More... | |
template<typename T > | |
void | assertFileValid (const Path &path, T &file) |
Checks if the file is open and valid, otherwise it will throw an exception with the error code. This function is only for ifstream and ofstream. Used after opening a file. More... | |
void | assertIsDirectory (const Path &path) |
Checks if the path exists and is a directory, otherwise it will throw an exception. More... | |
void | assertIsRegularFile (const Path &path) |
Checks if the path exists and is a regular file, otherwise it will throw an exception. More... | |
void | assertReadPermissions (const Path &path) |
Only works on Linux at the moment, requires the <unistd.h> header. More... | |
void | assertWritePermissions (const Path &path) |
Checks a program has write permissions to the file or directory at the path, if not, throws an exception. Only works on Linux at the moment, requires the <unistd.h> header. More... | |
double | convertMbToUnit (const double size_mb, const fs::units::Size unit) |
bool | exists (const Path &path) |
std::uintmax_t | get_file_size_bytes (const Path &path) |
bool | has_read_permissions (const Path &path) |
Returns true if the program has read permissions. More... | |
bool | has_write_permission (const Path &path) |
Returns true if the path if the program has write permissions. More... | |
bool | is_directory (const Path &path) |
Returns true if the path is a directory. More... | |
bool | is_file (const Path &path) |
Checks if a path is a regular file. More... | |
Internal inline functions used only in this file.
|
inline |
Referenced by assertDoesNotExist(), assertExists(), and TEST().
|
inline |
Checks if a path is a regular file.
path | - The path to check. |
|
inline |
Returns true if the path is a directory.
path | - The path to check. |
Referenced by assertIsDirectory().
|
inline |
Returns true if the path if the program has write permissions.
path | - The path to check. |
Referenced by assertWritePermissions().
|
inline |
Returns true if the program has read permissions.
path | - The path to check. |
Referenced by assertReadPermissions().
|
inline |
|
inline |
|
inline |
Checks if a path exists, otherwise it will throw an exception.
path | - The path to check. |
BoosterSeatException | - If the path does not exist. |
References exists().
Referenced by assertIsDirectory(), and assertIsRegularFile().
|
inline |
Checks if a path exists, otherwise it will throw an exception.
path | - The path to check. |
BoosterSeatException | - If the path does exist. |
References exists().
|
inline |
Checks if the path exists and is a regular file, otherwise it will throw an exception.
path | - The path to check. |
BoosterSeatException | - If the path does not exist or is not a |
References assertExists().
|
inline |
Checks if the path exists and is a directory, otherwise it will throw an exception.
path | - The path to check. |
BoosterSeatException | - If the path does not exist or is not a |
References assertExists(), and is_directory().
|
inline |
Checks if the file is open and valid, otherwise it will throw an exception with the error code. This function is only for ifstream and ofstream. Used after opening a file.
path | - The path to the file. |
file | - The fstream object to check. |
|
inline |
Checks a program has write permissions to the file or directory at the path, if not, throws an exception. Only works on Linux at the moment, requires the <unistd.h> header.
path | - The path to the file. |
BoosterSeatException | - If the file does not have write permissions. |
References has_write_permission().
|
inline |
Only works on Linux at the moment, requires the <unistd.h> header.
path |
BoosterSeatException | - If the file does not have read permissions. |
References has_read_permissions().