1 #ifndef FILESYSTEM_HPP_
2 #define FILESYSTEM_HPP_
47 void appendToFile(
const std::string &file_path,
const std::string &content,
48 const bool new_line_after =
true);
59 void overwriteFile(
const std::string &file_path,
const std::string &content);
163 const std::string &destination_path,
bool overwrite =
false);
176 const std::string &destination_path,
bool overwrite =
false);
Size
Definition: filesystem.hpp:10
Type
Definition: filesystem.hpp:12
void moveFile(const std::string &source_path, const std::string &destination_path, bool overwrite=false)
Move a file from one location to another.
void copyFile(const std::string &source_path, const std::string &destination_path, bool overwrite=false)
Move a file from one location to another.
double getDirectorySize(const std::string &directory_path, units::Size unit=units::Size::BYTES)
Get the size of a directory. Only includes regular files.
bool doesFileExist(const std::string &file_path)
Returns a boolean indicating whether or not the file exists. If it's a directory an exception will be...
std::string getFileName(const std::string &file_path)
Get the File Name from a path. Does not need to exist.
uintmax_t getFileSizeBytes(const std::string &file_path)
Get the size of a file.
void deleteFile(const std::string &file_path)
Delete a file.
void createFile(const std::string &file_path)
Create a File.
void overwriteFile(const std::string &file_path, const std::string &content)
Overwrite a files with a string.
double getFileSize(const std::string &file_path, units::Size size_unit=units::Size::BYTES)
Get the size of a file.
void appendToFile(const std::string &file_path, const std::string &content, const bool new_line_after=true)
Append a string to a file.
bool doesDirectoryExist(const std::string &directory_path)
Returns a boolean indicating whether or not the directory exists.
void createDirectory(const std::string &directory_path)
Create a Directory at the specified path.
bool hasReadPermission(const std::string &path)
If a program has read permissions to a file or directory, it will return true. Otherwise,...
bool hasWritePermission(const std::string &path)
If a program has write permissions to a file or directory, it will return true. Otherwise,...
Definition: filesystem.cpp:34