| Disk ARchive 2.6.11 Full featured and portable backup and archiving tool

cat_device.hpp
Go to the documentation of this file.
1 /*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2020 Denis Corbin
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 //
19 // to contact the author : http://dar.linux.free.fr/email.html
20 /*********************************************************************/
21
25
26 #ifndef CAT_DEVICE_HPP
27 #define CAT_DEVICE_HPP
28
29 #include "../my_config.h"
30
31 extern "C"
32 {
33 } // end extern "C"
34
35 #include "cat_inode.hpp"
36 #include "integers.hpp"
37
38 namespace libdar
39 {
40
43
45
46 class cat_device : public cat_inode
47 {
48 public :
49 cat_device(const infinint & uid, const infinint & gid, U_16 perm,
50 const datetime & last_access,
51 const datetime & last_modif,
52 const datetime &last_change,
53 const std::string & name,
54 U_16 major,
55 U_16 minor,
56 const infinint & fs_device);
57 cat_device(const std::shared_ptr<user_interaction> & dialog,
58 const smart_pointer<pile_descriptor> & pdesc,
59 const archive_version & reading_ver,
60 saved_status saved,
61 bool small);
62 cat_device(const cat_device & ref) = default;
63 cat_device(cat_device && ref) noexcept = default;
64 cat_device & operator = (const cat_device & ref) = default;
65 cat_device & operator = (cat_device && ref) noexcept = default;
66 ~cat_device() = default;
67
68 virtual bool operator == (const cat_entree & ref) const override;
69
70 int get_major() const { if(get_saved_status() != saved_status::saved) throw SRC_BUG; else return xmajor; };
71 int get_minor() const { if(get_saved_status() != saved_status::saved) throw SRC_BUG; else return xminor; };
72 void set_major(int x) { xmajor = x; };
73 void set_minor(int x) { xminor = x; };
74
75 // using method is_more_recent_than() from cat_inode class
76 // using method has_changed_since() from cat_inode class
77 // signature is left pure abstract
78
79 protected :
80 virtual void sub_compare(const cat_inode & other, bool isolated_mode) const override;
81 virtual void inherited_dump(const pile_descriptor & pdesc, bool small) const override;
82
83 private :
84 U_16 xmajor, xminor;
85 };
86
88
89 } // end of namespace
90
91 #endif
libdar::cat_device
the special cat_device root class
Definition: cat_device.hpp:47
integers.hpp
are defined here basic integer types that tend to be portable
libdar::saved_status
saved_status
data saved status for an entry
Definition: cat_status.hpp:45
libdar::infinint
the arbitrary large positive integer class
Definition: real_infinint.hpp:62
cat_inode.hpp
base object for all inode types, managed EA and FSA, dates, permissions, ownership,...
libdar::cat_entree
the root class from all other inherite for any entry in the catalogue
Definition: cat_entree.hpp:60
libdar::cat_inode
the root class for all cat_inode
Definition: cat_inode.hpp:53
libdar::archive_version
class archive_version manages the version of the archive format
Definition: archive_version.hpp:47
libdar::cat_inode::perm
U_16 perm
inode's permission
Definition: cat_inode.hpp:179
libdar::saved_status::saved
@ saved
inode is saved in the archive
libdar::cat_device::operator==
virtual bool operator==(const cat_entree &ref) const override
returns true if the two object are the same
libdar::datetime
stores time information
Definition: datetime.hpp:59
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_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_entree::get_saved_status
saved_status get_saved_status() const
obtain the saved status of the object
Definition: cat_entree.hpp:164
libdar::smart_pointer< pile_descriptor >
libdar::cat_inode::uid
infinint uid
inode owner's user ID
Definition: cat_inode.hpp:177
libdar::cat_inode::gid
infinint gid
inode owner's group ID
Definition: cat_inode.hpp:178
libdar
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47