Class Filesystem
Defined in File filesystem.hpp
Inheritance Relationships
Base Type
public husarion_ugv_diagnostics::FilesystemInterface(Class FilesystemInterface)
Class Documentation
-
class Filesystem : public husarion_ugv_diagnostics::FilesystemInterface
A class that provides functionality for interacting with the filesystem.
This class inherits from the
FilesystemInterfaceand implements its methods. It provides a simplified, facade-type way to interact with thestd::filesystemlibrary.Public Functions
-
inline virtual uintmax_t GetSpaceCapacity(const std::string &filesystem_path) const override
Returns the space capacity in bytes of the filesystem at the specified path.
- Parameters:
filesystem_path – The path to the filesystem.
- Returns:
The space capacity in bytes.
-
inline virtual uintmax_t GetSpaceAvailable(const std::string &filesystem_path) const override
Returns the available space in bytes of the filesystem at the specified path.
- Parameters:
filesystem_path – The path to the filesystem.
- Returns:
The available space in bytes.
-
inline virtual std::string ReadFile(const std::string &file_path) const override
Reads the contents of the file specified by the given file path.
- Parameters:
file_path – The path to the file to be read.
- Throws:
<tt>std::invalid_argument</tt> – If the file doesn’t exist.
<tt>std::runtime_error</tt> – If the file fails to open.
- Returns:
The contents of the file as a string.
-
inline virtual uintmax_t GetSpaceCapacity(const std::string &filesystem_path) const override