Loading...
Searching...
No Matches
cat_device.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 CAT_DEVICE_HPP
#define CAT_DEVICE_HPP
#include "../my_config.h"
extern "C"
{
} // end extern "C"
#include "cat_inode.hpp"
#include "integers.hpp"
namespace libdar
{
class cat_device : public cat_inode
{
public :
cat_device(const infinint & uid, const infinint & gid, U_16 perm,
const datetime & last_access,
const datetime & last_modif,
const datetime &last_change,
const std::string & name,
U_16 major,
U_16 minor,
const infinint & fs_device);
cat_device(const std::shared_ptr<user_interaction> & dialog,
const smart_pointer<pile_descriptor> & pdesc,
const archive_version & reading_ver,
saved_status saved,
bool small);
cat_device(const cat_device & ref) = default;
cat_device(cat_device && ref) noexcept = default;
cat_device & operator = (const cat_device & ref) = default;
cat_device & operator = (cat_device && ref) = default;
~cat_device() = default;
virtual bool operator == (const cat_entree & ref) const override;
int get_major() const { if(get_saved_status() != saved_status::saved) throw SRC_BUG; else return xmajor; };
int get_minor() const { if(get_saved_status() != saved_status::saved) throw SRC_BUG; else return xminor; };
void set_major(int x) { xmajor = x; };
void set_minor(int x) { xminor = x; };
// using method is_more_recent_than() from cat_inode class
// using method has_changed_since() from cat_inode class
// signature is left pure abstract
protected :
virtual void sub_compare(const cat_inode & other,
bool isolated_mode,
bool seq_read_mode) const override;
virtual void inherited_dump(const pile_descriptor & pdesc, bool small) const override;
private :
U_16 xmajor, xminor;
};
} // end of namespace
#endif
cat_inode.hpp
base object for all inode types, managed EA and FSA, dates, permissions, ownership,...
libdar::archive_version
class archive_version manages the version of the archive format
Definition archive_version.hpp:47
libdar::cat_device::operator==
virtual bool operator==(const cat_entree &ref) const override
returns true if the two object are the same
libdar::cat_device::inherited_dump
virtual void inherited_dump(const pile_descriptor &pdesc, bool small) const override
true if object has been created by sequential reading of an archive
libdar::cat_entree
the root class from all other inherite for any entry in the catalogue
Definition cat_entree.hpp:60
libdar::cat_entree::get_saved_status
saved_status get_saved_status() const
obtain the saved status of the object
Definition cat_entree.hpp:164
libdar::cat_inode::perm
U_16 perm
inode's permission
Definition cat_inode.hpp:183
libdar::cat_inode::uid
infinint uid
inode owner's user ID
Definition cat_inode.hpp:181
libdar::cat_inode::cat_inode
cat_inode(const infinint &xuid, const infinint &xgid, U_16 xperm, const datetime &last_access, const datetime &last_modif, const datetime &last_change, const std::string &xname, const infinint &device)
flag used to only consider certain fields when comparing/restoring inodes
libdar::cat_inode::gid
infinint gid
inode owner's group ID
Definition cat_inode.hpp:182
libdar::datetime
stores time information
Definition datetime.hpp:59
libdar::infinint
the arbitrary large positive integer class
Definition real_infinint.hpp:62
libdar::smart_pointer
smart pointer class to be used to automagically manage multiple time pointed to address
Definition smart_pointer.hpp:79
libdar::saved_status
saved_status
data saved status for an entry
Definition cat_status.hpp:44
libdar::saved_status::saved
@ saved
inode is saved in the archive
Definition cat_status.hpp:45
integers.hpp
are defined here basic integer types that tend to be portable
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