17#ifndef __image_io_base_h__
18#define __image_io_base_h__
29#define MAX_FILES_PER_IMAGE 256U
59 void open (const
Header& header,
size_t buffer_size = 0);
92 for (
size_t n = 0; n < B.
files.size(); ++n)
99 <<
", is " << (B.
is_new ?
"" :
"NOT ") <<
"new, " << (B.
writable ?
"read/write" :
"read-only");
111 virtual void load (
const Header& header,
size_t buffer_size) = 0;
vector< std::unique_ptr< uint8_t[]> > addresses
void open(const Header &header, size_t buffer_size=0)
vector< File::Entry > files
void close(const Header &header)
Base(const Header &header)
bool is_image_readwrite() const
bool is_image_new() const
Base(Base &&) noexcept=default
size_t segment_size() const
friend std::ostream & operator<<(std::ostream &stream, const Base &B)
void set_image_is_new(bool image_is_new)
void set_readwrite_if_existing(bool readwrite)
virtual void load(const Header &header, size_t buffer_size)=0
void set_readwrite(bool readwrite)
uint8_t * segment(size_t n) const
void merge(const Base &B)
virtual void unload(const Header &header)=0
virtual bool is_file_backed() const
std::string str(const T &value, int precision=0)