1#include <spdlog/spdlog.h>
14 throw std::runtime_error{ fmt::format(
"Cannot open the file {:?}",
input_filename_) };
21 if (not input_file.is_open())
23 spdlog::critical(
"The input file is not open!");
31 spdlog::info(
"End of the binary file.");
35 input_file.read(size_buffer.data(),
static_cast<int64_t
>(size_buffer.size()));
36 auto serialize_to = zpp::bits::in{ size_buffer, zpp::bits::endian::big{} };
37 serialize_to(size).or_throw();
38 binary_data.resize(size, 0);
39 auto read_size =
static_cast<std::size_t
>(input_file.read(binary_data.data(), size).gcount());
41 if (read_size != size)
43 spdlog::warn(
"Binary Data is not extracted correctly from the input file");
auto read_one_frame() -> std::string_view
Read one frame of the binary data from a file specified by the constructor RawFrame(conststd::string&...
static auto read_one_frame(std::vector< char > &binary_data, std::ifstream &input_file) -> std::size_t
Read one frame of the bianry data to a vector.
std::string input_filename_
Input binary file name.
std::vector< char > input_buffer_
internal binary data buffer
RawFrame()=default
Default Constructor. No memory allocation.
std::ifstream input_file_
Input binary file handler.
uint32_t RawDelimSizeType
constexpr auto LARGE_READ_MSG_BUFFER_SIZE
size of the data array for reading a UDP package