Loading...
Searching...
No Matches
cat_detruit.hpp
Go to the documentation of this file.
/*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2025 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 CAT_DETRUIT_HPP
#define CAT_DETRUIT_HPP
#include "../my_config.h"
extern "C"
{
} // end extern "C"
#include "cat_nomme.hpp"
#include "datetime.hpp"
#include "archive_version.hpp"
namespace libdar
{
class cat_detruit : public cat_nomme
{
public :
cat_detruit(const std::string & name, unsigned char firm, const datetime & date) : cat_nomme(name, saved_status::saved) , del_date(date) { signe = firm; };
cat_detruit(const smart_pointer<pile_descriptor> & pdesc, const archive_version & reading_ver, bool small);
cat_detruit(const cat_nomme & ref): cat_nomme(ref), del_date(0) { signe = ref.signature(); };
cat_detruit(const cat_detruit & ref) = default;
cat_detruit(cat_detruit && ref) noexcept = default;
cat_detruit & operator = (const cat_detruit & ref) = default;
cat_detruit & operator = (cat_detruit && ref) = default;
~cat_detruit() = default;
virtual bool operator == (const cat_entree & ref) const override;
unsigned char get_signature() const { return signe; };
void set_signature(unsigned char x) { signe = x; };
const datetime & get_date() const { return del_date; };
void set_date(const datetime & ref) { del_date = ref; };
virtual unsigned char signature() const override { return 'x'; };
virtual std::string get_description() const override { return "deleted file"; };
virtual cat_entree *clone() const override { return new (std::nothrow) cat_detruit(*this); };
protected:
virtual void inherited_dump(const pile_descriptor & pdesc, bool small) const override;
private :
unsigned char signe;
datetime del_date;
};
} // end of namespace
#endif
archive_version.hpp
class archive_version that rules which archive format to follow
cat_nomme.hpp
base class of all objects contained in a catalogue and that can be named
libdar::archive_version
class archive_version manages the version of the archive format
Definition archive_version.hpp:47
libdar::cat_detruit
the deleted file entry
Definition cat_detruit.hpp:49
libdar::cat_detruit::clone
virtual cat_entree * clone() const override
inherited from cat_entree
Definition cat_detruit.hpp:75
libdar::cat_detruit::operator==
virtual bool operator==(const cat_entree &ref) const override
returns true if the two object are the same
libdar::cat_detruit::get_description
virtual std::string get_description() const override
inherited from cat_entree
Definition cat_detruit.hpp:72
libdar::cat_detruit::inherited_dump
virtual void inherited_dump(const pile_descriptor &pdesc, bool small) const override
inherited class may overload this method but shall first call the parent's inherited_dump() in the ov...
libdar::cat_detruit::signature
virtual unsigned char signature() const override
inherited from cat_entree
Definition cat_detruit.hpp:69
libdar::cat_entree
the root class from all other inherite for any entry in the catalogue
Definition cat_entree.hpp:60
libdar::cat_entree::signature
virtual unsigned char signature() const =0
inherited class signature
libdar::cat_nomme
the base class for all entry that have a name
Definition cat_nomme.hpp:45
libdar::datetime
stores time information
Definition datetime.hpp:59
libdar::smart_pointer
smart pointer class to be used to automagically manage multiple time pointed to address
Definition smart_pointer.hpp:79
datetime.hpp
this file contains the definition of class datetime that stores unix times in a portable way
libdar::saved_status::saved
@ saved
inode is saved in the archive
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