diff options
Diffstat (limited to 'include/fs/extfs.hpp')
| -rw-r--r-- | include/fs/extfs.hpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/fs/extfs.hpp b/include/fs/extfs.hpp new file mode 100644 index 0000000..0075572 --- /dev/null +++ b/include/fs/extfs.hpp @@ -0,0 +1,41 @@ +#ifndef EXTFS_EXTFS_HPP +#define EXTFS_EXTFS_HPP + +#include "fs/detail/superblock.hpp" + +#include <fstream> +#include <string> + +namespace fs + { + + struct extfs + { + enum struct mode : char + { + read_only, + writeable + }; + + /** + * Open the filesystem at a given path + * + * @param path The path to a device/file containing an ext* file system. + * @param openMode Whether to open the file system in read_only or writeable mode. + * @since 1.0 + */ + explicit extfs(std::string const & path, mode const openMode = mode::read_only); + + /** + * Check if the filesystem is valid + */ + operator bool() const; + + private: + std::fstream m_stream{}; + detail::extfs_superblock m_primarySuperblock{}; + }; + + } + +#endif |
