Disk ARchive 2.8.0
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-2025 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
34
35
36#ifndef DATABASE_OPTIONS_HPP
37#define DATABASE_OPTIONS_HPP
38
39#include "../my_config.h"
40
41#include <string>
42#include <vector>
43
44namespace libdar
45{
46
49
50
52
54 {
55 public:
56 database_open_options() { clear(); };
57 database_open_options(const database_open_options & ref) = default;
58 database_open_options(database_open_options && ref) noexcept = default;
59 database_open_options & operator = (const database_open_options & ref) = default;
60 database_open_options & operator = (database_open_options && ref) noexcept = default;
61 ~database_open_options() = default;
62
63
64 void clear() { x_partial = false; x_partial_read_only = false; x_warn_order = true; };
65
66 // setings
67
69
72 void set_partial(bool value) { x_partial = value; };
73
74
76
81 void set_partial_read_only(bool value) { x_partial_read_only = value; if(value) x_partial = value; };
82
83
85
87 void set_warn_order(bool value) { x_warn_order = value; };
88
89 // gettings
90 bool get_partial() const { return x_partial; };
91 bool get_partial_read_only() const { return x_partial_read_only; };
92 bool get_warn_order() const { return x_warn_order; };
93
94 private:
95 bool x_partial;
96 bool x_partial_read_only;
97 bool x_warn_order;
98 };
99
101
103 {
104 public:
105 database_dump_options() { clear(); };
106 database_dump_options(const database_dump_options & ref) = default;
107 database_dump_options(database_dump_options && ref) noexcept = default;
108 database_dump_options & operator = (const database_dump_options & ref) = default;
109 database_dump_options & operator = (database_dump_options && ref) noexcept = default;
110 ~database_dump_options() = default;
111
112 void clear() { x_overwrite = false; };
113
114 // settings
115
117
120 void set_overwrite(bool value) { x_overwrite = value; };
121
122 // gettings
123 bool get_overwrite() const { return x_overwrite; };
124
125 private:
126 bool x_overwrite;
127 };
128
130
133 {
134 public:
135 database_add_options() { clear(); };
136 database_add_options(const database_add_options & ref) = default;
137 database_add_options(database_add_options && ref) noexcept = default;
138 database_add_options & operator = (const database_add_options & ref) = default;
139 database_add_options & operator = (database_add_options && ref) noexcept = default;
140 ~database_add_options() = default;
141
142 void clear() {};
143 };
144
146
148 {
149 public:
150 database_remove_options() { clear(); };
152 database_remove_options(database_remove_options && ref) noexcept = default;
153 database_remove_options & operator = (const database_remove_options & ref) = default;
154 database_remove_options & operator = (database_remove_options && ref) noexcept = default;
155 ~database_remove_options() = default;
156
157 void clear() { x_revert_archive_numbering = false; };
158
160 void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
161
162 bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
163
164 private:
165 bool x_revert_archive_numbering;
166
167 };
168
170
172 {
173 public:
177 database_change_basename_options & operator = (const database_change_basename_options & ref) = default;
178 database_change_basename_options & operator = (database_change_basename_options && ref) noexcept = default;
180
181 void clear() { x_revert_archive_numbering = false; };
182
184 void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
185
186 bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
187
188 private:
189 bool x_revert_archive_numbering;
190
191 };
192
193
195
197 {
198 public:
199 database_change_path_options() { clear(); };
202 database_change_path_options & operator = (const database_change_path_options & ref) = default;
203 database_change_path_options & operator = (database_change_path_options && ref) noexcept = default;
205
206 void clear() { x_revert_archive_numbering = false; };
207
209 void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
210
211 bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
212
213 private:
214 bool x_revert_archive_numbering;
215
216 };
217
219
221 {
222 public:
223 database_restore_options() { clear(); };
225 database_restore_options(database_restore_options && ref) noexcept = default;
226 database_restore_options & operator = (const database_restore_options & ref) = default;
227 database_restore_options & operator = (database_restore_options && ref) noexcept = default;
228 ~database_restore_options() = default;
229
230 void clear() { x_early_release = x_info_details = x_ignore_dar_options_in_database = x_even_when_removed = false; x_date = datetime(0); x_extra_options_for_dar.clear(); };
231
232 // settings
233
234
236
240
241 void set_early_release(bool value) { x_early_release = value; };
242
244
246 void set_info_details(bool value) { x_info_details = value; };
247
249
251 void set_extra_options_for_dar(const std::vector<std::string> & value) { x_extra_options_for_dar = value; };
252
254
255 void set_ignore_dar_options_in_database(bool mode) { x_ignore_dar_options_in_database = mode; };
256
258
261 void set_date(const infinint & value) { x_date = datetime(value); };
262
264 void set_date(const datetime & value) { x_date = value; };
265
267
270 void set_even_when_removed(bool value) { x_even_when_removed = value; };
271
272
273 // gettings
274 bool get_early_release() const { return x_early_release; };
275 bool get_info_details() const { return x_info_details; };
276 const std::vector<std::string> & get_extra_options_for_dar() const { return x_extra_options_for_dar; };
277 const datetime & get_date() const { return x_date; };
278 bool get_ignore_dar_options_in_database() const { return x_ignore_dar_options_in_database; };
279 bool get_even_when_removed() const { return x_even_when_removed; };
280
281 private:
282 bool x_early_release;
283 bool x_info_details;
284 std::vector<std::string> x_extra_options_for_dar;
285 datetime x_date;
286 bool x_ignore_dar_options_in_database;
287 bool x_even_when_removed;
288 };
289
290
292
294 {
295 public:
296 database_used_options() { clear(); };
297 database_used_options(const database_used_options & ref) = default;
298 database_used_options(database_used_options && ref) noexcept = default;
299 database_used_options & operator = (const database_used_options & ref) = default;
300 database_used_options & operator = (database_used_options && ref) noexcept = default;
301 ~database_used_options() = default;
302
303 void clear() { x_revert_archive_numbering = false; };
304
306 void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
307
308 bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
309
310 private:
311 bool x_revert_archive_numbering;
312
313 };
314
315
317
318
319} // end of namespace
320#endif
options to add an archive to base
options for changing a given archive's basename
void set_revert_archive_numbering(bool revert)
defines whether the archive number is counted from the beginning or from the end of the database
options for changing a given archive's path
void set_revert_archive_numbering(bool revert)
defines whether the archive number is counted from the beginning or from the end of the database
options to write a database to file
void set_overwrite(bool value)
overwrite option
options to open a database
void set_partial_read_only(bool value)
partial and read only option
void set_partial(bool value)
partial option
void set_warn_order(bool value)
warning about file ordering in database
options to remove an archive from the base
void set_revert_archive_numbering(bool revert)
defines whether the archive number is counted from the beginning or from the end of the database
options for restoration from database
void set_even_when_removed(bool value)
find data or EA if they have been removed at the requested date
void set_info_details(bool value)
info_details option
void set_extra_options_for_dar(const std::vector< std::string > &value)
extra options to dar
void set_ignore_dar_options_in_database(bool mode)
ignore options to dar embedded in the database
void set_early_release(bool value)
early_release option
void set_date(const infinint &value)
date option
void set_date(const datetime &value)
date option in the new form of a datetime (eventually providing sub second precision)
options for file "used" in archive
void set_revert_archive_numbering(bool revert)
defines whether the archive number is counted from the beginning or from the end of the database
stores time information
Definition: datetime.hpp:59
the arbitrary large positive integer class
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47