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

database_options.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 DATABASE_OPTIONS_HPP
27 #define DATABASE_OPTIONS_HPP
28
29 #include "../my_config.h"
30
31 #include <string>
32 #include <vector>
33
34 namespace libdar
35 {
36
39
40
42
43 class database_open_options
44 {
45 public:
46 database_open_options() { clear(); };
47 database_open_options(const database_open_options & ref) = default;
48 database_open_options(database_open_options && ref) noexcept = default;
49 database_open_options & operator = (const database_open_options & ref) = default;
50 database_open_options & operator = (database_open_options && ref) noexcept = default;
51 ~database_open_options() = default;
52
53
54 void clear() { x_partial = false; x_partial_read_only = false; x_warn_order = true; };
55
56 // setings
57
59
62 void set_partial(bool value) { x_partial = value; };
63
64
66
71 void set_partial_read_only(bool value) { x_partial_read_only = value; if(value) x_partial = value; };
72
73
75
77 void set_warn_order(bool value) { x_warn_order = value; };
78
79 // gettings
80 bool get_partial() const { return x_partial; };
81 bool get_partial_read_only() const { return x_partial_read_only; };
82 bool get_warn_order() const { return x_warn_order; };
83
84 private:
85 bool x_partial;
86 bool x_partial_read_only;
87 bool x_warn_order;
88 };
89
91
92 class database_dump_options
93 {
94 public:
95 database_dump_options() { clear(); };
96 database_dump_options(const database_dump_options & ref) = default;
97 database_dump_options(database_dump_options && ref) noexcept = default;
98 database_dump_options & operator = (const database_dump_options & ref) = default;
99 database_dump_options & operator = (database_dump_options && ref) noexcept = default;
100 ~database_dump_options() = default;
101
102 void clear() { x_overwrite = false; };
103
104 // settings
105
107
110 void set_overwrite(bool value) { x_overwrite = value; };
111
112 // gettings
113 bool get_overwrite() const { return x_overwrite; };
114
115 private:
116 bool x_overwrite;
117 };
118
120
122 class database_add_options
123 {
124 public:
125 database_add_options() { clear(); };
126 database_add_options(const database_add_options & ref) = default;
127 database_add_options(database_add_options && ref) noexcept = default;
128 database_add_options & operator = (const database_add_options & ref) = default;
129 database_add_options & operator = (database_add_options && ref) noexcept = default;
130 ~database_add_options() = default;
131
132 void clear() {};
133 };
134
136
137 class database_remove_options
138 {
139 public:
140 database_remove_options() { clear(); };
141 database_remove_options(const database_remove_options & ref) = default;
142 database_remove_options(database_remove_options && ref) noexcept = default;
143 database_remove_options & operator = (const database_remove_options & ref) = default;
144 database_remove_options & operator = (database_remove_options && ref) noexcept = default;
145 ~database_remove_options() = default;
146
147 void clear() { x_revert_archive_numbering = false; };
148
150 void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
151
152 bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
153
154 private:
155 bool x_revert_archive_numbering;
156
157 };
158
160
161 class database_change_basename_options
162 {
163 public:
164 database_change_basename_options() { clear(); };
165 database_change_basename_options(const database_change_basename_options & ref) = default;
166 database_change_basename_options(database_change_basename_options && ref) noexcept = default;
167 database_change_basename_options & operator = (const database_change_basename_options & ref) = default;
168 database_change_basename_options & operator = (database_change_basename_options && ref) noexcept = default;
169 ~database_change_basename_options() = default;
170
171 void clear() { x_revert_archive_numbering = false; };
172
174 void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
175
176 bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
177
178 private:
179 bool x_revert_archive_numbering;
180
181 };
182
183
185
186 class database_change_path_options
187 {
188 public:
189 database_change_path_options() { clear(); };
190 database_change_path_options(const database_change_path_options & ref) = default;
191 database_change_path_options(database_change_path_options && ref) noexcept = default;
192 database_change_path_options & operator = (const database_change_path_options & ref) = default;
193 database_change_path_options & operator = (database_change_path_options && ref) noexcept = default;
194 ~database_change_path_options() = default;
195
196 void clear() { x_revert_archive_numbering = false; };
197
199 void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
200
201 bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
202
203 private:
204 bool x_revert_archive_numbering;
205
206 };
207
209
210 class database_restore_options
211 {
212 public:
213 database_restore_options() { clear(); };
214 database_restore_options(const database_restore_options & ref) = default;
215 database_restore_options(database_restore_options && ref) noexcept = default;
216 database_restore_options & operator = (const database_restore_options & ref) = default;
217 database_restore_options & operator = (database_restore_options && ref) noexcept = default;
218 ~database_restore_options() = default;
219
220 void clear() { x_early_release = x_info_details = x_ignore_dar_options_in_database = x_even_when_removed = false; x_date = 0; x_extra_options_for_dar.clear(); };
221
222 // settings
223
224
226
230
231 void set_early_release(bool value) { x_early_release = value; };
232
234
236 void set_info_details(bool value) { x_info_details = value; };
237
239
241 void set_extra_options_for_dar(const std::vector<std::string> & value) { x_extra_options_for_dar = value; };
242
244
245 void set_ignore_dar_options_in_database(bool mode) { x_ignore_dar_options_in_database = mode; };
246
248
251 void set_date(const infinint & value) { x_date = value; };
252
254
257 void set_even_when_removed(bool value) { x_even_when_removed = value; };
258
259
260 // gettings
261 bool get_early_release() const { return x_early_release; };
262 bool get_info_details() const { return x_info_details; };
263 const std::vector<std::string> & get_extra_options_for_dar() const { return x_extra_options_for_dar; };
264 const infinint & get_date() const { return x_date; };
265 bool get_ignore_dar_options_in_database() const { return x_ignore_dar_options_in_database; };
266 bool get_even_when_removed() const { return x_even_when_removed; };
267
268 private:
269 bool x_early_release;
270 bool x_info_details;
271 std::vector<std::string> x_extra_options_for_dar;
272 infinint x_date;
273 bool x_ignore_dar_options_in_database;
274 bool x_even_when_removed;
275 };
276
277
279
280 class database_used_options
281 {
282 public:
283 database_used_options() { clear(); };
284 database_used_options(const database_used_options & ref) = default;
285 database_used_options(database_used_options && ref) noexcept = default;
286 database_used_options & operator = (const database_used_options & ref) = default;
287 database_used_options & operator = (database_used_options && ref) noexcept = default;
288 ~database_used_options() = default;
289
290 void clear() { x_revert_archive_numbering = false; };
291
293 void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
294
295 bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
296
297 private:
298 bool x_revert_archive_numbering;
299
300 };
301
302
304
305
306 } // end of namespace
307 #endif
libdar::database_open_options::set_partial_read_only
void set_partial_read_only(bool value)
partial and read only option
Definition: database_options.hpp:71
libdar::database_restore_options::set_info_details
void set_info_details(bool value)
info_details option
Definition: database_options.hpp:236
libdar::database_restore_options
options for restoration from database
Definition: database_options.hpp:211
libdar::database_remove_options::set_revert_archive_numbering
void set_revert_archive_numbering(bool revert)
defines whether the archive number is counted from the beginning or from the end of the database
Definition: database_options.hpp:150
libdar::database_restore_options::set_ignore_dar_options_in_database
void set_ignore_dar_options_in_database(bool mode)
ignore options to dar embedded in the database
Definition: database_options.hpp:245
libdar::database_change_path_options
options for changing a given archive's path
Definition: database_options.hpp:187
libdar::infinint
the arbitrary large positive integer class
Definition: real_infinint.hpp:62
libdar::database_restore_options::set_even_when_removed
void set_even_when_removed(bool value)
find data or EA if they have been removed at the requested data
Definition: database_options.hpp:257
libdar::database_change_basename_options::set_revert_archive_numbering
void set_revert_archive_numbering(bool revert)
defines whether the archive number is counted from the beginning or from the end of the database
Definition: database_options.hpp:174
libdar::database_open_options::set_partial
void set_partial(bool value)
partial option
Definition: database_options.hpp:62
libdar::database_open_options
options to open a database
Definition: database_options.hpp:44
libdar::database_dump_options::set_overwrite
void set_overwrite(bool value)
overwrite option
Definition: database_options.hpp:110
libdar::database_restore_options::set_date
void set_date(const infinint &value)
date option
Definition: database_options.hpp:251
libdar::database_restore_options::set_extra_options_for_dar
void set_extra_options_for_dar(const std::vector< std::string > &value)
extra options to dar
Definition: database_options.hpp:241
libdar::database_restore_options::set_early_release
void set_early_release(bool value)
early_release option
Definition: database_options.hpp:231
libdar::database_dump_options
options to write a database to file
Definition: database_options.hpp:93
libdar::database_add_options
options to add an archive to base
Definition: database_options.hpp:123
libdar::database_used_options
options for file "used" in archive
Definition: database_options.hpp:281
libdar::database_open_options::set_warn_order
void set_warn_order(bool value)
warning about file ordering in database
Definition: database_options.hpp:77
libdar::database_remove_options
options to remove an archive from the base
Definition: database_options.hpp:138
libdar::database_change_basename_options
options for changing a given archive's basename
Definition: database_options.hpp:162
libdar::database_used_options::set_revert_archive_numbering
void set_revert_archive_numbering(bool revert)
defines whether the archive number is counted from the beginning or from the end of the database
Definition: database_options.hpp:293
libdar::database_change_path_options::set_revert_archive_numbering
void set_revert_archive_numbering(bool revert)
defines whether the archive number is counted from the beginning or from the end of the database
Definition: database_options.hpp:199
libdar
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47