blob: ee8b3b74c13eaf91f29168329bd905150960d7db [file] [log] [blame]
John Edward Broadbente6ffe702021-10-14 14:03:11 -07001#pragma once
2
3#include "erase.hpp"
John Edward Broadbenta6e3b992022-03-17 14:33:15 -07004#include "util.hpp"
John Edward Broadbente6ffe702021-10-14 14:03:11 -07005
6#include <string_view>
7
John Edward Broadbentd3bfa7b2022-01-13 17:41:32 -08008namespace estoraged
9{
10
John Edward Broadbente6ffe702021-10-14 14:03:11 -070011class VerifyDriveGeometry : public Erase
12{
13 public:
14 /** @brief Creates a verifyDriveGeomentry erase object.
15 *
16 * @param[in] inDevPath - the linux device path for the block device.
17 */
18 VerifyDriveGeometry(std::string_view inDevPath) : Erase(inDevPath)
19 {}
20
21 /** @brief Test if input is in between the max and min expected sizes,
22 * and throws errors accordingly.
23 *
24 * @param[in] bytes - Size of the block device
25 */
John Edward Broadbenta6e3b992022-03-17 14:33:15 -070026 void geometryOkay()
27 {
John Edward Broadbent5d799bb2022-03-22 16:14:24 -070028 geometryOkay(util::findSizeOfBlockDevice(devPath));
John Edward Broadbenta6e3b992022-03-17 14:33:15 -070029 }
John Edward Broadbente6ffe702021-10-14 14:03:11 -070030 void geometryOkay(uint64_t bytes);
31};
John Edward Broadbentd3bfa7b2022-01-13 17:41:32 -080032
33} // namespace estoraged