blob: ea549980cac2edfae4777425bb94b5a1159a575a [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 {
28 geometryOkay(util::Util::findSizeOfBlockDevice(devPath));
29 }
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