Skip to content
API Documentation
BastionGuard™
rescue_imager.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "bad_block_map.hpp"
5
6#include <cstdint>
7#include <functional>
8#include <string>
9#include <vector>
10
12 std::string image_path;
13 std::string map_path;
14 uint64_t bytes_requested {0};
15 uint64_t bytes_written {0};
16 uint64_t bad_ranges {0};
17 std::vector<std::string> logs;
18};
19
21public:
22 using ProgressCallback = std::function<void(uint64_t, uint64_t)>;
23 using CancelCallback = std::function<bool()>;
24
25 static bool create_image(
26 const std::string& device_path,
27 const std::string& image_path,
28 RescueImageReport& report,
29 std::string& error,
30 ProgressCallback progress_cb = {},
31 CancelCallback cancel_cb = {});
32};
std::function< bool()> CancelCallback
static bool create_image(const std::string &device_path, const std::string &image_path, RescueImageReport &report, std::string &error, ProgressCallback progress_cb={}, CancelCallback cancel_cb={})
std::function< void(uint64_t, uint64_t)> ProgressCallback
std::string image_path
std::vector< std::string > logs