Disk ARchive 2.7.16
Full featured and portable backup and archiving tool
filesystem_backup.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
27#ifndef FILESYSTEM_BACKUP_HPP
28#define FILESYSTEM_BACKUP_HPP
29
30#include "../my_config.h"
31
32extern "C"
33{
34#if HAVE_UNISTD_H
35#include <unistd.h>
36#endif
37
38#if HAVE_SYS_STAT_H
39#include <sys/stat.h>
40#endif
41} // end extern "C"
42
43#include <deque>
44#include "infinint.hpp"
45#include "etage.hpp"
46#include "cat_entree.hpp"
48
49#include <set>
50
51namespace libdar
52{
55
57
59 {
60 public:
61 filesystem_backup(const std::shared_ptr<user_interaction> & dialog,
62 const path &root,
63 bool x_info_details,
64 const mask & x_ea_mask,
65 bool check_no_dump_flag,
66 bool alter_atime,
67 bool furtive_read_mode,
68 bool x_cache_directory_tagging,
69 infinint & root_fs_device,
70 bool x_ignore_unknown,
71 const fsa_scope & scope);
72 filesystem_backup(const filesystem_backup & ref) = delete;
73 filesystem_backup(filesystem_backup && ref) = delete;
74 filesystem_backup & operator = (const filesystem_backup & ref) = delete;
75 filesystem_backup & operator = (filesystem_backup && ref) = delete;
76 ~filesystem_backup() { detruire(); };
77
78 void reset_read(infinint & root_fs_device);
79 bool read(cat_entree * & ref, infinint & errors, infinint & skipped_dump);
80 void skip_read_to_parent_dir();
81 // continue reading in parent directory and
82 // ignore all entry not yet read of current directory
83 private:
84
85 path *fs_root; //< filesystem's root to consider
86 bool info_details; //< detailed information returned to the user
87 mask *ea_mask; //< mask defining the EA to consider
88 bool no_dump_check; //< whether to check against the nodump flag presence
89 bool alter_atime; //< whether to set back atime or not
90 bool furtive_read_mode; //< whether to use furtive read mode (if true, alter_atime is ignored)
91 bool cache_directory_tagging; //< whether to consider cache directory taggin standard
92 path *current_dir; //< needed to translate from an hard linked inode to an already allocated object
93 std::deque<etage> pile; //< to store the contents of a directory
94 bool ignore_unknown; //< whether to ignore unknown inode types
95
96 void detruire();
97 };
98
100
101} // end of namespace
102
103#endif
base class for all object contained in a catalogue
the root class from all other inherite for any entry in the catalogue
Definition: cat_entree.hpp:60
makes a flow sequence of inode to feed the backup filtering routing
the arbitrary large positive integer class
the generic class, parent of all masks
Definition: mask.hpp:62
the class path is here to manipulate paths in the Unix notation: using'/'
Definition: path.hpp:51
stores a stack of generic_files writing/reading on each others
Definition: pile.hpp:44
definition of the etage structure is done here
std::set< fsa_family > fsa_scope
set of fsa families
Definition: fsa_family.hpp:70
switch module to limitint (32 ou 64 bits integers) or infinint
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47