srs-control
0.2.2
Toggle main menu visibility
Loading...
Searching...
No Matches
RawFrameReader.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cstddef>
4
#include <expected>
5
#include <fstream>
6
#include <string>
7
#include <string_view>
8
#include <vector>
9
10
namespace
srs::reader
11
{
12
class
RawFrame
13
{
14
public
:
16
explicit
RawFrame
() =
default
;
17
24
explicit
RawFrame
(
const
std::string& filename);
25
39
auto
read_one_frame
(std::vector<char>& binary_data, std::ifstream& input_file)
40
-> std::expected<std::size_t, std::string>;
41
53
auto
read_one_frame
() -> std::expected<std::string_view, std::string>;
54
56
auto
get_binary_data
() const -> const auto& {
return
input_buffer_
; }
57
58
void
reset
();
59
60
private
:
61
std::string
input_filename_
;
62
std::ifstream
input_file_
;
63
std::vector<char>
input_buffer_
;
64
};
65
}
// namespace srs::reader
srs::reader::RawFrame::read_one_frame
auto read_one_frame(std::vector< char > &binary_data, std::ifstream &input_file) -> std::expected< std::size_t, std::string >
Read one frame of the bianry data to a vector.
Definition
RawFrameReader.cpp:31
srs::reader::RawFrame::input_filename_
std::string input_filename_
Input binary file name.
Definition
RawFrameReader.hpp:61
srs::reader::RawFrame::input_buffer_
std::vector< char > input_buffer_
internal binary data buffer
Definition
RawFrameReader.hpp:63
srs::reader::RawFrame::RawFrame
RawFrame()=default
Default Constructor. No memory allocation.
srs::reader::RawFrame::reset
void reset()
Definition
RawFrameReader.cpp:61
srs::reader::RawFrame::get_binary_data
auto get_binary_data() const -> const auto &
Getter to the internal binary data used by the member function read_one_frame().
Definition
RawFrameReader.hpp:56
srs::reader::RawFrame::input_file_
std::ifstream input_file_
Input binary file handler.
Definition
RawFrameReader.hpp:62
srs::reader
Definition
ProtoMsgReader.cpp:9
backend
srs
readers
RawFrameReader.hpp
Impressum
Datenschutzerklärung
Generated by
1.17.0