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

archive5.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
27 #ifndef ARCHIVE5_HPP
28 #define ARCHIVE5_HPP
29
30 #include "../my_config.h"
31
32 #include "archive.hpp"
33 #include "user_interaction5.hpp"
34 #include "archive_options5.hpp"
35
36 namespace libdar5
37 {
38
41
42
43 // from archive_options.hpp
44 using libdar::path;
45 using libdar::statistics;
46
48
53
54 class archive: public libdar::archive
55 {
56 public:
57 archive(user_interaction & dialog,
58 const path & chem,
59 const std::string & basename,
60 const std::string & extension,
61 const archive_options_read & options):
62 libdar::archive(user_interaction5_clone_to_shared_ptr(dialog),
63 chem,
64 basename,
65 extension,
66 options)
67 {}
68
69 archive(user_interaction & dialog,
70 const path & fs_root,
71 const path & sauv_path,
72 const std::string & filename,
73 const std::string & extension,
74 const archive_options_create & options,
75 statistics * progressive_report):
76 libdar::archive(user_interaction5_clone_to_shared_ptr(dialog),
77 fs_root,
78 sauv_path,
79 filename,
80 extension,
81 options,
82 progressive_report)
83 {}
84
85 archive(user_interaction & dialog,
86 const path & sauv_path,
87 archive *ref_arch1,
88 const std::string & filename,
89 const std::string & extension,
90 const archive_options_merge & options,
91 statistics * progressive_report):
92 libdar::archive(user_interaction5_clone_to_shared_ptr(dialog),
93 sauv_path,
94 std::shared_ptr<archive>(ref_arch1),
95 filename,
96 extension,
97 options,
98 progressive_report)
99 {}
100
101 archive(user_interaction & dialog,
102 const path & chem_src,
103 const std::string & basename_src,
104 const std::string & extension_src,
105 const archive_options_read & options_read,
106 const path & chem_dst,
107 const std::string & basename_dst,
108 const std::string & extension_dst,
109 const archive_options_repair & options_repair):
110 libdar::archive(user_interaction5_clone_to_shared_ptr(dialog),
111 chem_src,
112 basename_src,
113 extension_src,
114 options_read,
115 chem_dst,
116 basename_dst,
117 extension_dst,
118 options_repair)
119 {}
120
121 statistics op_extract(user_interaction & dialog,
122 const path &fs_root,
123 const archive_options_extract & options,
124 statistics *progressive_report)
125 {
126 return libdar::archive::op_extract(fs_root,
127 options,
128 progressive_report);
129 }
130
131 void summary(user_interaction & dialog)
132 {
133 libdar::archive::summary();
134 }
135
137 void op_listing(user_interaction & dialog,
138 const archive_options_listing & options);
139
140 statistics op_diff(user_interaction & dialog,
141 const path & fs_root,
142 const archive_options_diff & options,
143 statistics * progressive_report)
144 {
145 return libdar::archive::op_diff(fs_root,
146 options,
147 progressive_report);
148 }
149
150 statistics op_test(user_interaction & dialog,
151 const archive_options_test & options,
152 statistics * progressive_report)
153 {
154 return libdar::archive::op_test(options,
155 progressive_report);
156 }
157
158 void op_isolate(user_interaction & dialog,
159 const path &sauv_path,
160 const std::string & filename,
161 const std::string & extension,
162 const archive_options_isolate & options)
163 {
164 libdar::archive::op_isolate(sauv_path,
165 filename,
166 extension,
167 options);
168 }
169
171 bool get_children_of(user_interaction & dialog,
172 const std::string & dir);
173
174 void init_catalogue(user_interaction & dialog) const
175 {
176 libdar::archive::init_catalogue();
177 }
178
179 void drop_all_filedescriptors(user_interaction & dialog)
180 {
181 libdar::archive::drop_all_filedescriptors();
182 }
183
184 private:
185
186 static void listing_callback(const std::string & the_path,
187 const libdar::list_entry & entry,
188 void *context);
189 };
190
192
193 } // end of namespace
194
195 #endif
archive.hpp
the archive class is defined in this module
libdar::archive::op_isolate
void op_isolate(const path &sauv_path, const std::string &filename, const std::string &extension, const archive_options_isolate &options)
this methodes isolates the catalogue of a the current archive into a separated archive
libdar5::archive::get_children_of
bool get_children_of(user_interaction &dialog, const std::string &dir)
overloading get_children_of to use the user_interaction object as callback
libdar::archive::op_extract
statistics op_extract(const path &fs_root, const archive_options_extract &options, statistics *progressive_report)
extraction of data from an archive
libdar::archive::init_catalogue
void init_catalogue() const
libdar5::archive
the archive class realizes the most general operations on archives
Definition: archive5.hpp:55
libdar::archive::drop_all_filedescriptors
void drop_all_filedescriptors()
closes all filedescriptors and associated even when in sequential read mode
libdar::archive::op_test
statistics op_test(const archive_options_test &options, statistics *progressive_report)
test the archive integrity
libdar::archive::summary
void summary()
display a summary of the archive
libdar::archive::op_diff
statistics op_diff(const path &fs_root, const archive_options_diff &options, statistics *progressive_report)
archive comparison with filesystem
libdar::archive_options_extract
class holding optional parameters used to extract files from an existing archive
Definition: archive_options.hpp:1194
libdar::list_entry
Definition: list_entry.hpp:60
libdar::archive_options_repair
class holding optional parameters used to create an archive
Definition: archive_options.hpp:1605
libdar::path
the class path is here to manipulate paths in the Unix notation: using'/'
Definition: path.hpp:51
libdar::statistics
class used by libdar::archive class to give a summary of treated file during and after an operation
Definition: statistics.hpp:70
libdar5::user_interaction
This is a pure virtual class that is used by libdar when interaction with the user is required.
Definition: user_interaction5.hpp:88
libdar5
libdar5 namespace encapsulate all libdar symbols
Definition: archive5.hpp:37
libdar::archive_options_test
class holding optional parameters used to test the structure coherence of an existing archive
Definition: archive_options.hpp:1532
libdar5::user_interaction5_clone_to_shared_ptr
std::shared_ptr< user_interaction > user_interaction5_clone_to_shared_ptr(user_interaction &dialog)
convert a user_interaction to a shared_pointer on a clone of that user_interaction
libdar::archive
the archive class realizes the most general operations on archives
Definition: archive.hpp:65
libdar5::archive::op_listing
void op_listing(user_interaction &dialog, const archive_options_listing &options)
overwriting op_listing to use the user_interaction as callback
user_interaction5.hpp
API v5 backward compatible class user_interaction.
archive_options5.hpp
API v5 compatible archive_options_* classes.