30 #include "../my_config.h"
54 pile & operator = (const
pile & ref) = delete;
55 pile & operator = (
pile && ref) noexcept = delete;
56 ~
pile() { detruit(); };
68 void push(
generic_file *f,
const std::string & label =
"",
bool extend_mode =
false);
84 generic_file *
top()
const {
if(stack.empty())
return nullptr;
else return stack.back().ptr; };
90 U_I
size()
const {
return stack.size(); };
93 bool is_empty()
const {
return stack.empty(); };
147 virtual bool skippable(skippability direction,
const infinint & amount)
override;
170 std::list<std::string> labels;
175 std::deque<face> stack;
178 std::deque<face>::iterator look_for_label(
const std::string & label);
188 top = stack.back().ptr;
189 ptr =
dynamic_cast<T *
>(
top);
207 for(std::deque<face>::const_reverse_iterator it = stack.rbegin(); it != stack.rend() && ref ==
nullptr; ++it)
208 ref = dynamic_cast<T *>(it->ptr);
215 for(std::deque<face>::const_iterator it = stack.begin(); it != stack.end() && ref ==
nullptr; ++it)
216 ref = dynamic_cast<T *>(it->ptr);
generic_file * pop()
remove the top generic_file from the top
virtual bool skippable(skippability direction, const infinint &amount) override
whether the implementation is able to skip
generic_file * bottom() const
returns the address of the bottom generic_file
void flush_read_above(generic_file *ptr)
call the generic_file::flush_read() method of all objects found above ptr in the stack ...
generic_file * get_below(const generic_file *ref)
return the generic_file object just below the given object or nullptr if the object is at the bottom ...
void add_label(const std::string &label)
associate a additional label to the object currently at the top of the stack
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
virtual void inherited_flush_read() override
reset internal engine, flush caches in order to read the data at current position ...
virtual bool skip_to_eof() override
skip to the end of file
bool pop_and_close_if_type_is(T *ptr)
remove the top generic_file and destroy it
U_I size() const
returns the number of objects in the stack
void push(generic_file *f, const std::string &label="", bool extend_mode=false)
add a generic_file on the top
generic_file * top() const
returns the address of the top generic_file
generic_file * get_above(const generic_file *ref)
return the generic_file object just above the given object or nullptr if the object is at the bottom ...
bool is_empty() const
returns true if the stack is empty, false otherwise.
virtual void inherited_sync_write() override
write down any pending data
virtual void inherited_write(const char *a, U_I size) override
implementation of the write() operation
void find_first_from_top(T *&ref) const
this template let the class user find out the higher object on the stack of the given type ...
stores a stack of generic_files writing/reading on each others
void find_first_from_bottom(T *&ref) const
this template is similar to the template "find_first_from_top" except that the search is started from...
virtual infinint get_position() const override
get the current read/write position
generic_file(gf_mode m)
main constructor
void copy_to(generic_file &ref) override
copy all data from current position to the object in argument
virtual void inherited_read_ahead(const infinint &amount) override
tells the object that several calls to read() will follow to probably obtain at least the given amoun...
this is the interface class from which all other data transfer classes inherit
generic_file * get_by_label(const std::string &label)
find the object associated to a given label
virtual bool skip_relative(S_I x) override
skip relatively to the current position
manage label data structure used in archive slice headers
virtual bool truncatable(const infinint &amount) const override
whether the implementation is able to truncate to the given position
virtual bool skip(const infinint &pos) override
skip at the absolute position
void sync_write_above(generic_file *ptr)
call the generic_file::sync_write() method of all object found above ptr in the stack ...
the arbitrary large positive integer class
void clear_label(const std::string &label)
if label is associated to a member of the stack, makes this member of the stack an anoymous member (t...
void clear()
clears the stack
pure virtual class defining interface of a CRC object
libdar namespace encapsulate all libdar symbols
virtual U_I inherited_read(char *a, U_I size) override
implementation of read() operation
virtual void inherited_terminate() override
destructor-like call, except that it is allowed to throw exceptions
virtual void inherited_truncate(const infinint &pos) override
truncate file at the give offset