Loading...
Searching...
No Matches
escape_catalogue.hpp
Go to the documentation of this file.
/*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2026 Denis Corbin
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// to contact the author, see the AUTHOR file
/*********************************************************************/
#ifndef ESCAPE_CATALOGUE_HPP
#define ESCAPE_CATALOGUE_HPP
#include "../my_config.h"
#include "catalogue.hpp"
#include "escape.hpp"
#include "pile_descriptor.hpp"
#include "smart_pointer.hpp"
#include "header_version.hpp"
namespace libdar
{
class escape_catalogue : public catalogue
{
public:
escape_catalogue(const std::shared_ptr<user_interaction> & dialog,
const pile_descriptor & x_pdesc,
const datetime & root_last_modif,
const label & data_name);
escape_catalogue(const std::shared_ptr<user_interaction> & dialog,
const pile_descriptor & x_pdesc,
const header_version & ver,
const std::list<signator> & known_signatories,
bool lax = false
);
escape_catalogue(const escape_catalogue & ref) : catalogue(ref) { copy_from(ref); };
escape_catalogue(escape_catalogue && ref) = delete;
escape_catalogue & operator = (const escape_catalogue &ref);
escape_catalogue & operator = (escape_catalogue && ref) = delete;
~escape_catalogue() { destroy(); };
// inherited from catalogue
virtual void pre_add(const cat_entree *ref, const pile_descriptor* dest) const override;
virtual void pre_add_ea(const cat_entree *ref, const pile_descriptor* dest) const override;
virtual void pre_add_crc(const cat_entree *ref, const pile_descriptor* dest) const override;
virtual void pre_add_dirty(const pile_descriptor* dest) const override;
virtual void pre_add_ea_crc(const cat_entree *ref, const pile_descriptor* dest) const override;
virtual void pre_add_waste_mark(const pile_descriptor* dest) const override;
virtual void pre_add_failed_mark(const pile_descriptor* dest) const override;
virtual void pre_add_fsa(const cat_entree *ref, const pile_descriptor* dest) const override;
virtual void pre_add_fsa_crc(const cat_entree *ref, const pile_descriptor* dest) const override;
virtual void pre_add_delta_sig(const pile_descriptor* dest) const override;
virtual escape *get_escape_layer() const override { return pdesc.is_null() ? nullptr : pdesc->esc; };
virtual void drop_escape_layer() override { pdesc.assign(nullptr); };
virtual void set_escape_layer(escape* ptr) override { throw SRC_BUG; };
virtual void reset_read() const override;
virtual void end_read() const override;
virtual void skip_read_to_parent_dir() const override;
virtual bool read(const cat_entree * & ref) const override;
virtual bool read_if_present(std::string *name, const cat_nomme * & ref) const override;
virtual void remove_last_read() override;
virtual void tail_catalogue_to_current_read(bool including_last_read) override;
virtual bool read_second_time_dir() const override { return status == ec_detruits; };
virtual void set_in_place(const path & arg) override;
virtual void clear_in_place() override;
private:
enum state
{
ec_init,
ec_marks,
ec_eod,
ec_signature,
ec_detruits,
ec_completed
};
smart_pointer<pile_descriptor> pdesc;
header_version x_ver;
std::list<signator> known_sig;
bool x_lax;
std::map <infinint, cat_etoile *> corres;
state status;
std::string last_added_name;
catalogue *cat_det;
infinint min_read_offset;
infinint depth;
infinint wait_parent_depth;
void set_esc_and_stack(const pile_descriptor & x_pdesc);
void copy_from(const escape_catalogue & ref);
void destroy();
void merge_cat_det();
void reset_reading_process();
};
} // end of namespace
#endif
catalogue.hpp
here is defined the classe used to manage catalogue of archives
libdar::catalogue
the catalogue class which gather all objects contained in a give archive
Definition catalogue.hpp:60
libdar::catalogue::clear_in_place
virtual void clear_in_place()
clear the in_place path
libdar::catalogue::remove_last_read
virtual void remove_last_read()
remove last read entry
escape.hpp
class escape definition, used for sequential reading of archives
header_version.hpp
archive global header/trailer structure is defined here
my_config.h
include macro defined by the configure script and some specific additional ones
libdar
libdar namespace encapsulate all libdar symbols
Definition archive.hpp:47
pile_descriptor.hpp
optimization structure to quickly access some commonly used layers of a stack of generic_file
smart_pointer.hpp
template class implementing memory efficient smart pointer