summaryrefslogtreecommitdiff
path: root/diskman/partition.hh
diff options
context:
space:
mode:
Diffstat (limited to 'diskman/partition.hh')
-rw-r--r--diskman/partition.hh46
1 files changed, 46 insertions, 0 deletions
diff --git a/diskman/partition.hh b/diskman/partition.hh
index e69de29..93090d8 100644
--- a/diskman/partition.hh
+++ b/diskman/partition.hh
@@ -0,0 +1,46 @@
+/*
+ * partition.hh - Definition of the Partition class
+ * diskman, the Disk Manipulation library for
+ * Project Horizon
+ *
+ * Copyright (c) 2020 Adélie Linux and contributors. All rights reserved.
+ * This code is licensed under the AGPL 3.0 license, as noted in the
+ * LICENSE-code file in the root directory of this repository.
+ *
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+#ifndef DISKMAN__PARTITION_HH
+#define DISKMAN__PARTITION_HH
+
+#include <cstdint>
+#include <string>
+
+namespace Horizon {
+namespace DiskMan {
+
+class Disk;
+
+class Partition {
+public:
+ /*! Retrieve the size of the partition in bytes. */
+ uint64_t size() const { return this->_size; };
+ /*! Retrieve the file system type of this partition. */
+ const std::string fstype() const { return this->_fs_type; }
+ /*! Retrieve the label of the file system on this partition. */
+ const std::string label() const { return this->_label; }
+private:
+ /*! The size of the partition, in bytes. */
+ uint64_t _size;
+ /*! The type of the file system on this partition (if any) */
+ std::string _fs_type;
+ /*! The label of the file system on this partition (if any) */
+ std::string _label;
+ Partition(Disk &d, void *creation, int type);
+ friend class Disk;
+};
+
+}
+}
+
+#endif /* !DISKMAN__PARTITION_HH */