From 31bb7fd29bca88f86860bdc8aa7f09c3e8e3f111 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 23 Dec 2016 22:19:13 +0100 Subject: Initial commit --- include/fs/extfs.hpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 include/fs/extfs.hpp (limited to 'include/fs/extfs.hpp') 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 +#include + +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 -- cgit v1.2.3