Refactor findsize into util away from erase
At first the size was only needed for erase, now it is needed for the
drives interface. The code needed to be refactored to make drive
interface implementation possible.
Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: I0a23ee23a0de3fd89a9e776b4854e8da9a8ff2e4
diff --git a/include/util.hpp b/include/util.hpp
new file mode 100644
index 0000000..1d706ce
--- /dev/null
+++ b/include/util.hpp
@@ -0,0 +1,21 @@
+#pragma once
+#include <string_view>
+
+namespace estoraged
+{
+namespace util
+{
+
+class Util
+{
+ public:
+ /** @brief finds the size of the linux block device in bytes
+ * @param[in] devpath - the name of the linux block device
+ * @return size of a block device using the devPath
+ */
+ static uint64_t findSizeOfBlockDevice(const std::string& devPath);
+};
+
+} // namespace util
+
+} // namespace estoraged