pattern.hpp (d3bfa7bb99d0609657a13b8ec410eb4396607e58) pattern.hpp (a6e3b99df73312c465b4b174b167bb785e886a71)
1#pragma once
2
3#include "erase.hpp"
1#pragma once
2
3#include "erase.hpp"
4#include "util.hpp"
4
5#include <stdplus/fd/create.hpp>
6#include <stdplus/fd/managed.hpp>
7
8#include <span>
9#include <string>
10
11namespace estoraged

--- 10 unchanged lines hidden (view full) ---

22 Pattern(std::string_view inDevPath) : Erase(inDevPath)
23 {}
24
25 /** @brief writes an uncompressible random pattern to the drive
26 * and throws errors accordingly.
27 *
28 * @param[in] bytes - Size of the block device
29 */
5
6#include <stdplus/fd/create.hpp>
7#include <stdplus/fd/managed.hpp>
8
9#include <span>
10#include <string>
11
12namespace estoraged

--- 10 unchanged lines hidden (view full) ---

23 Pattern(std::string_view inDevPath) : Erase(inDevPath)
24 {}
25
26 /** @brief writes an uncompressible random pattern to the drive
27 * and throws errors accordingly.
28 *
29 * @param[in] bytes - Size of the block device
30 */
31 void writePattern()
32 {
33 writePattern(util::Util::findSizeOfBlockDevice(devPath));
34 }
35
30 void writePattern(uint64_t driveSize);
31
32 /** @brief verifies the uncompressible random pattern is on the drive
33 * and throws errors accordingly.
34 *
35 * @param[in] bytes - Size of the block device
36 */
36 void writePattern(uint64_t driveSize);
37
38 /** @brief verifies the uncompressible random pattern is on the drive
39 * and throws errors accordingly.
40 *
41 * @param[in] bytes - Size of the block device
42 */
43
44 void verifyPattern()
45 {
46 verifyPattern(util::Util::findSizeOfBlockDevice(devPath));
47 }
37 void verifyPattern(uint64_t driveSize);
38};
39
40} // namespace estoraged
48 void verifyPattern(uint64_t driveSize);
49};
50
51} // namespace estoraged