Disk ARchive  2.7.15
Full featured and portable backup and archiving tool
cat_chardev.hpp
Go to the documentation of this file.
1 /*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2024 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, see the AUTHOR file
20 /*********************************************************************/
21 
25 
26 #ifndef CAT_CHARDEV_HPP
27 #define CAT_CHARDEV_HPP
28 
29 #include "../my_config.h"
30 
31 extern "C"
32 {
33 } // end extern "C"
34 
35 #include "cat_device.hpp"
36 
37 namespace libdar
38 {
39 
42 
44  class cat_chardev : public cat_device
45  {
46  public:
47  cat_chardev(const infinint & uid, const infinint & gid, U_16 perm,
48  const datetime & last_access,
49  const datetime & last_modif,
50  const datetime & last_change,
51  const std::string & name,
52  U_16 major,
53  U_16 minor,
54  const infinint & fs_device) : cat_device(uid, gid, perm,
55  last_access,
56  last_modif,
57  last_change,
58  name,
59  major, minor, fs_device) {};
60  cat_chardev(const std::shared_ptr<user_interaction> & dialog,
61  const smart_pointer<pile_descriptor> & pdesc,
62  const archive_version & reading_ver,
64  bool small) : cat_device(dialog, pdesc, reading_ver, saved, small) {};
65 
66  cat_chardev(const cat_chardev & ref) = default;
67  cat_chardev(cat_chardev && ref) noexcept = default;
68  cat_chardev & operator = (const cat_chardev & ref) = default;
69  cat_chardev & operator = (cat_chardev && ref) = default;
70  ~cat_chardev() = default;
71 
72 
73  virtual bool operator == (const cat_entree & ref) const override;
74 
75  // using dump from cat_device class
76  // using method is_more_recent_than() from cat_device class
77  // using method has_changed_since() from cat_device class
78  virtual unsigned char signature() const override { return 'c'; };
79  virtual std::string get_description() const override { return "char device"; };
80  virtual cat_entree *clone() const override { return new (std::nothrow) cat_chardev(*this); };
81  };
82 
84 
85 } // end of namespace
86 
87 #endif
parent class for all special devices inodes
class archive_version manages the version of the archive format
the char device class
Definition: cat_chardev.hpp:45
virtual std::string get_description() const override
inherited class designation
Definition: cat_chardev.hpp:79
virtual cat_entree * clone() const override
a way to copy the exact type of an object even if pointed to by a parent class pointer
Definition: cat_chardev.hpp:80
virtual unsigned char signature() const override
inherited class signature
Definition: cat_chardev.hpp:78
virtual bool operator==(const cat_entree &ref) const override
returns true if the two object are the same
the special cat_device root class
Definition: cat_device.hpp:47
the root class from all other inherite for any entry in the catalogue
Definition: cat_entree.hpp:60
U_16 perm
inode's permission
Definition: cat_inode.hpp:179
infinint uid
inode owner's user ID
Definition: cat_inode.hpp:177
infinint gid
inode owner's group ID
Definition: cat_inode.hpp:178
stores time information
Definition: datetime.hpp:59
the arbitrary large positive integer class
saved_status
data saved status for an entry
Definition: cat_status.hpp:45
@ saved
inode is saved in the archive
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47