summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2016-12-24 16:13:42 +0100
committerFelix Morgner <felix.morgner@gmail.com>2016-12-24 16:13:42 +0100
commit54b15f3fd651ffb09260cee598f458c1fb29ce60 (patch)
treed4d975631a2d5e64a6d99dbdee6ee564975348d2 /include
parentd6c74fdea16c70a93c70449317d75c5445c7522e (diff)
downloadextfs-54b15f3fd651ffb09260cee598f458c1fb29ce60.tar.xz
extfs-54b15f3fd651ffb09260cee598f458c1fb29ce60.zip
extfs: Add label retrieval
Diffstat (limited to 'include')
-rw-r--r--include/fs/extfs.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/fs/extfs.hpp b/include/fs/extfs.hpp
index 6430fe2..fb8f044 100644
--- a/include/fs/extfs.hpp
+++ b/include/fs/extfs.hpp
@@ -52,6 +52,31 @@ namespace fs
*/
bool open() const;
+ /**
+ * @brief Get the label of the file system
+ *
+ * The ext2/3/4 file systems allow the use of a label for human readable identification of a file system. Because they are
+ * user configurable, there are no guarantees on whether or not the label is unique. Thus, a file system should never be
+ * identified solely by its label.
+ *
+ * @return A #std::string containing the file system label. The string might be empty if no label is set.
+ *
+ * @since 1.0
+ */
+ std::string label() const;
+
+ /**
+ * @brief Check if the file system has a label
+ *
+ * ext2/3/4 file systems may or may not have a label. If a label is present, it has a maximum length of 15 character in
+ * ISO-Latin-1 encoding.
+ *
+ * @return @p true, iff. the file system has a @p non-null label configured, @p false otherwise
+ *
+ * @since 1.0
+ */
+ bool has_label() const;
+
private:
std::fstream m_stream{};
detail::extfs_superblock m_primarySuperblock{};