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

filesystem_diff.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 FILESYSTEM_DIFF_HPP
27 #define FILESYSTEM_DIFF_HPP
28
29 #include "../my_config.h"
30
31 extern "C"
32 {
33 #if HAVE_UNISTD_H
34 #include <unistd.h>
35 #endif
36
37 #if HAVE_SYS_STAT_H
38 #include <sys/stat.h>
39 #endif
40 } // end extern "C"
41
42 #include <deque>
43 #include "cat_nomme.hpp"
44 #include "filesystem_hard_link_read.hpp"
45
46 #include <set>
47
48 namespace libdar
49 {
52
54
55 class filesystem_diff : public filesystem_hard_link_read
56 {
57 public:
58 filesystem_diff(const std::shared_ptr<user_interaction> & dialog,
59 const path &root,
60 bool x_info_details,
61 const mask & x_ea_mask,
62 bool alter_atime,
63 bool furtive_read_mode,
64 const fsa_scope & scope);
65 filesystem_diff(const filesystem_diff & ref) = delete;
66 filesystem_diff(filesystem_diff && ref) = delete;
67 filesystem_diff & operator = (const filesystem_diff & ref) = delete;
68 filesystem_diff & operator = (filesystem_diff && ref) = delete;
69 ~filesystem_diff() { detruire(); };
70
71 void reset_read();
72 bool read_filename(const std::string & name, cat_nomme * &ref);
73 // looks for a file of name given in argument, in current reading directory
74 // if this is a directory, subsequent read take place in it
75
76 void skip_read_filename_in_parent_dir();
77 // subsequent calls to read_filename will take place in parent directory.
78
79 private:
80 struct filename_struct
81 {
82 datetime last_acc;
83 datetime last_mod;
84 };
85
86 path *fs_root;
87 bool info_details;
88 mask *ea_mask;
89 bool alter_atime;
90 bool furtive_read_mode;
91 path *current_dir;
92 std::deque<filename_struct> filename_pile;
93
94 void detruire();
95 };
96
98
99 } // end of namespace
100
101 #endif
cat_nomme.hpp
base class of all objects contained in a catalogue and that can be named
libdar::cat_nomme
the base class for all entry that have a name
Definition: cat_nomme.hpp:45
libdar::mask
the generic class, parent of all masks
Definition: mask.hpp:62
libdar::filesystem_hard_link_read
keep trace of hard links when reading the filesystem
Definition: filesystem_hard_link_read.hpp:58
filesystem_hard_link_read.hpp
filesystem_hard_link_read classes manages hardlinked inode read from filesystem
libdar::path
the class path is here to manipulate paths in the Unix notation: using'/'
Definition: path.hpp:51
libdar::datetime
stores time information
Definition: datetime.hpp:59
libdar::filesystem_diff
make a flow of inode to feed the difference filter routine
Definition: filesystem_diff.hpp:56
libdar::fsa_scope
std::set< fsa_family > fsa_scope
set of fsa families
Definition: fsa_family.hpp:70
libdar
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47