/usr/include/dar/database_options.hpp is in libdar-dev 2.4.8-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | /*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2052 Denis Corbin
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// to contact the author : http://dar.linux.free.fr/email.html
/*********************************************************************/
/// \file database_options.hpp
/// \brief this file holds the options for database operations
/// \ingroup API
#ifndef DATABASE_OPTIONS_HPP
#define DATABASE_OPTIONS_HPP
#include "/usr/include/dar/libdar_my_config.h"
#include <string>
#include <vector>
namespace libdar
{
/// \ingroup API
/// @}
/// options to open a database
class database_open_options
{
public:
database_open_options() { clear(); };
void clear() { x_partial = false; x_partial_read_only = false; x_warn_order = true; };
// setings
/// partial option
/// \param[in] value set to true to only load an manipulate database header
/// \note if value is set to true, the database loading is quick but only some database methods are available (see the database class documentation)
void set_partial(bool value) { x_partial = value; };
/// partial and read only option
/// \param[in] value when set, the database is in partial mode *and* in read-only. It cannot be dumped or modified.
/// \note if value is set to true, all restriction found for partial mode apply, and in addition, the database cannot be dumped (written back to file)
void set_partial_read_only(bool value) { x_partial_read_only = x_partial = value; };
/// warning about file ordering in database
/// \param[in] value whether to warn when file chronological ordering does not respect the order of archives
void set_warn_order(bool value) { x_warn_order = value; };
// gettings
bool get_partial() const { return x_partial; };
bool get_partial_read_only() const { return x_partial_read_only; };
bool get_warn_order() const { return x_warn_order; };
private:
bool x_partial;
bool x_partial_read_only;
bool x_warn_order;
};
/// options to write a database to file
class database_dump_options
{
public:
database_dump_options() { clear(); };
void clear() { x_overwrite = false; };
// settings
/// overwrite option
/// \param[in] value whether we can overwrite the file if it already exists
///
void set_overwrite(bool value) { x_overwrite = value; };
// gettings
bool get_overwrite() const { return x_overwrite; };
private:
bool x_overwrite;
};
/// options to add an archive to base
class database_add_options
{
public:
database_add_options() { clear(); };
void clear() {};
};
/// options to remove an archive from the base
class database_remove_options
{
public:
database_remove_options() { clear(); };
void clear() { x_revert_archive_numbering = false; };
/// defines whether the archive number is counted from the beginning or from the end of the database
void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
private:
bool x_revert_archive_numbering;
};
/// options for changing a given archive's basename
class database_change_basename_options
{
public:
database_change_basename_options() { clear(); };
void clear() { x_revert_archive_numbering = false; };
/// defines whether the archive number is counted from the beginning or from the end of the database
void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
private:
bool x_revert_archive_numbering;
};
/// options for changing a given archive's path
class database_change_path_options
{
public:
database_change_path_options() { clear(); };
void clear() { x_revert_archive_numbering = false; };
/// defines whether the archive number is counted from the beginning or from the end of the database
void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
private:
bool x_revert_archive_numbering;
};
/// options for restoration from database
class database_restore_options
{
public:
database_restore_options() { clear(); };
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(); };
// settings
/// early_release option
/// if early_release is set to true, some memory is released before calling dar
/// \note if early_release is true, this will free almost all memory allocated by the database before calling dar.
/// drawback is that no more action is possible after this call (except destruction)
void set_early_release(bool value) { x_early_release = value; };
/// info_details option
/// if set to true, more detailed informations is displayed
void set_info_details(bool value) { x_info_details = value; };
/// extra options to dar
/// this option is a mean to provide some extra options to dar from dar_manager
void set_extra_options_for_dar(const std::vector<std::string> & value) { x_extra_options_for_dar = value; };
/// ignore options to dar embedded in the database
void set_ignore_dar_options_in_database(bool mode) { x_ignore_dar_options_in_database = mode; };
/// date option
/// informations about files more recent than the given date are ignored. So you can restore file in the most recent state before a certain "date".
/// \note if set to zero, the most recent state available is looked for (this is the default value).
void set_date(const infinint & value) { x_date = value; };
/// find data or EA if they have been removed at the requested data
/// in the case a file has was removed at the request date, the data or EA
/// that will be restored will be the one of it had just before being removed
void set_even_when_removed(bool value) { x_even_when_removed = value; };
// gettings
bool get_early_release() const { return x_early_release; };
bool get_info_details() const { return x_info_details; };
const std::vector<std::string> & get_extra_options_for_dar() const { return x_extra_options_for_dar; };
const infinint & get_date() const { return x_date; };
bool get_ignore_dar_options_in_database() const { return x_ignore_dar_options_in_database; };
bool get_even_when_removed() const { return x_even_when_removed; };
private:
bool x_early_release;
bool x_info_details;
std::vector<std::string> x_extra_options_for_dar;
infinint x_date;
bool x_ignore_dar_options_in_database;
bool x_even_when_removed;
};
/// options for file "used" in archive
class database_used_options
{
public:
database_used_options() { clear(); };
void clear() { x_revert_archive_numbering = false; };
/// defines whether the archive number is counted from the beginning or from the end of the database
void set_revert_archive_numbering(bool revert) { x_revert_archive_numbering = revert; };
bool get_revert_archive_numbering() const { return x_revert_archive_numbering; };
private:
bool x_revert_archive_numbering;
};
/// @}
} // end of namespace
#endif
|