summaryrefslogtreecommitdiff
path: root/include/fs/extfs.hpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2016-12-23 22:19:13 +0100
committerFelix Morgner <felix.morgner@gmail.com>2016-12-23 23:22:22 +0100
commit31bb7fd29bca88f86860bdc8aa7f09c3e8e3f111 (patch)
tree4e98d54eb2ec60d9536c8fe2b322440a7b4dbf78 /include/fs/extfs.hpp
downloadextfs-31bb7fd29bca88f86860bdc8aa7f09c3e8e3f111.tar.xz
extfs-31bb7fd29bca88f86860bdc8aa7f09c3e8e3f111.zip
Initial commit
Diffstat (limited to 'include/fs/extfs.hpp')
-rw-r--r--include/fs/extfs.hpp41
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