30 #include "../my_config.h"
54 pile & operator = (
const pile & ref) =
delete;
55 pile & operator = (
pile && ref) noexcept =
delete;
56 ~
pile() { detruit(); };
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(); };
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);
pure virtual class defining interface of a CRC object
this is the interface class from which all other data transfer classes inherit
the arbitrary large positive integer class
manage label data structure used in archive slice headers
stores a stack of generic_files writing/reading on each others
void push(generic_file *f, const std::string &label="", bool extend_mode=false)
add a generic_file on the top
U_I size() const
returns the number of objects in the stack
void add_label(const std::string &label)
associate a additional label to the object currently at the top of the stack
virtual void inherited_flush_read() override
reset internal engine, flush caches in order to read the data at current position
virtual bool skippable(skippability direction, const infinint &amount) override
whether the implementation is able to skip
virtual bool skip_to_eof() override
skip to the end of file
virtual void inherited_write(const char *a, U_I size) override
implementation of the write() operation
virtual U_I inherited_read(char *a, U_I size) override
implementation of read() operation
virtual bool truncatable(const infinint &amount) const override
whether the implementation is able to truncate to the given position
virtual bool skip_relative(S_I x) override
skip relatively to the current position
void copy_to(generic_file &ref, const infinint &crc_size, crc *&value) override
copy all data from the current position to the object in argument and computes a CRC value of the tra...
virtual void inherited_terminate() override
destructor-like call, except that it is allowed to throw exceptions
virtual void inherited_sync_write() override
write down any pending data
void sync_write_above(generic_file *ptr)
call the generic_file::sync_write() method of all object 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 ...
virtual infinint get_position() const override
get the current read/write position
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 ...
generic_file * bottom() const
returns the address of the bottom generic_file
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...
void flush_read_above(generic_file *ptr)
call the generic_file::flush_read() method of all objects found above ptr in the stack
bool is_empty() const
returns true if the stack is empty, false otherwise.
generic_file * pop()
remove the top generic_file from the top
void copy_to(generic_file &ref) override
copy all data from current position to the object in argument
generic_file * top() const
returns the address of the top generic_file
void clear()
clears the stack
virtual void inherited_truncate(const infinint &pos) override
truncate file at the give offset
generic_file * get_by_label(const std::string &label)
find the object associated to a given label
virtual bool skip(const infinint &pos) override
skip at the absolute position
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...
class generic_file is defined here as well as class fichier
bool pop_and_close_if_type_is(T *ptr)
remove the top generic_file and destroy it
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
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...
@ gf_read_only
read only access
libdar namespace encapsulate all libdar symbols