 |
Disk ARchive
2.6.8
Full featured and portable backup and archiving tool
|
Go to the documentation of this file.
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;
168 std::list<std::string> labels;
173 std::deque<face> stack;
176 std::deque<face>::iterator look_for_label(
const std::string & label);
186 top = stack.back().ptr;
187 ptr = dynamic_cast<T *>(
top);
205 for(std::deque<face>::const_reverse_iterator it = stack.rbegin(); it != stack.rend() && ref ==
nullptr; ++it)
206 ref = dynamic_cast<T *>(it->ptr);
213 for(std::deque<face>::const_iterator it = stack.begin(); it != stack.end() && ref ==
nullptr; ++it)
214 ref = dynamic_cast<T *>(it->ptr);
generic_file * top() const
returns the address of the top 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(gf_mode m)
main constructor
manage label data structure used in archive slice headers
stores a stack of generic_files writing/reading on each others
generic_file * get_by_label(const std::string &label)
find the object associated to a given label
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 ...
the arbitrary large positive integer class
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 bool skip_relative(S_I x) override
skip relatively to the current position
virtual void inherited_write(const char *a, U_I size) override
implementation of the write() operation
bool pop_and_close_if_type_is(T *ptr)
remove the top generic_file and destroy it
pure virtual class defining interface of a CRC object
void add_label(const std::string &label)
associate a additional label to the object currently at the top of the stack
void sync_write_above(generic_file *ptr)
call the generic_file::sync_write() method of all object found above ptr in the stack
void clear()
clears the stack
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
virtual bool skip(const infinint &pos) override
skip at the absolute position
virtual void inherited_sync_write() override
write down any pending data
class generic_file is defined here as well as class fichier
bool is_empty() const
returns true if the stack is empty, false otherwise.
virtual void inherited_terminate() override
destructor-like call, except that it is allowed to throw exceptions
generic_file * bottom() const
returns the address of the bottom generic_file
this is the interface class from which all other data transfer classes inherit
void push(generic_file *f, const std::string &label="", bool extend_mode=false)
add a generic_file on the top
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...
U_I size() const
returns the number of objects in the stack
void copy_to(generic_file &ref) override
copy all data from current position to the object in argument
virtual bool skippable(skippability direction, const infinint &amount) override
whether the implementation is able to skip
virtual infinint get_position() const override
get the current read/write 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...
generic_file * pop()
remove the top generic_file from the top
virtual U_I inherited_read(char *a, U_I size) override
implementation of read() operation
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...
virtual bool skip_to_eof() override
skip to the end of file
virtual void inherited_flush_read() override
reset internal engine, flush caches in order to read the data at current position
libdar namespace encapsulate all libdar symbols