Disk ARchive  2.7.15
Full featured and portable backup and archiving tool
cat_lien.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_LIEN_HPP
27 #define CAT_LIEN_HPP
28 
29 #include "../my_config.h"
30 
31 extern "C"
32 {
33 } // end extern "C"
34 
35 #include "cat_inode.hpp"
36 
37 namespace libdar
38 {
39 
42 
44 
45  class cat_lien : public cat_inode
46  {
47  public :
48  cat_lien(const infinint & uid, const infinint & gid, U_16 perm,
49  const datetime & last_access,
50  const datetime & last_modif,
51  const datetime & last_change,
52  const std::string & name,
53  const std::string & target,
54  const infinint & fs_device);
55  cat_lien(const std::shared_ptr<user_interaction> & dialog,
56  const smart_pointer<pile_descriptor> & pdesc,
57  const archive_version & reading_ver,
59  bool small);
60  cat_lien(const cat_lien & ref) = default;
61  cat_lien(cat_lien && ref) noexcept = default;
62  cat_lien & operator = (const cat_lien & ref) = default;
63  cat_lien & operator = (cat_lien && ref) = default;
64  ~cat_lien() = default;
65 
66 
67  virtual bool operator == (const cat_entree & ref) const override;
68 
69  const std::string & get_target() const;
70  void set_target(std::string x);
71 
72  // using the method is_more_recent_than() from cat_inode
73  // using method has_changed_since() from cat_inode class
74 
76  virtual unsigned char signature() const override { return 'l'; };
77 
79  virtual std::string get_description() const override { return "symlink"; };
80 
82  virtual cat_entree *clone() const override { return new (std::nothrow) cat_lien(*this); };
83 
84  protected :
85  virtual void sub_compare(const cat_inode & other, bool isolated_mode) const override;
86  virtual void inherited_dump(const pile_descriptor & pdesc, bool small) const override;
87 
88  private :
89  std::string points_to;
90  };
91 
93 
94 } // end of namespace
95 
96 #endif
base object for all inode types, managed EA and FSA, dates, permissions, ownership,...
class archive_version manages the version of the archive format
the root class from all other inherite for any entry in the catalogue
Definition: cat_entree.hpp:60
the root class for all cat_inode
Definition: cat_inode.hpp:53
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
the symbolic link inode class
Definition: cat_lien.hpp:46
virtual cat_entree * clone() const override
inherited from cat_entree
Definition: cat_lien.hpp:82
virtual unsigned char signature() const override
inherited from cat_entree
Definition: cat_lien.hpp:76
virtual bool operator==(const cat_entree &ref) const override
returns true if the two object are the same
virtual void inherited_dump(const pile_descriptor &pdesc, bool small) const override
true if object has been created by sequential reading of an archive
virtual std::string get_description() const override
inherited from cat_entree
Definition: cat_lien.hpp:79
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