Loading...
Searching...
No Matches
database_options.hpp
Go to the documentation of this file.
/*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2025 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// to contact the author, see the AUTHOR file
/*********************************************************************/
#ifndef DATABASE_OPTIONS_HPP
#define DATABASE_OPTIONS_HPP
#include "../my_config.h"
#include <string>
#include <vector>
namespace libdar
{
class database_open_options
{
public:
database_open_options() { clear(); };
database_open_options(const database_open_options & ref) = default;
database_open_options(database_open_options && ref) noexcept = default;
database_open_options & operator = (const database_open_options & ref) = default;
database_open_options & operator = (database_open_options && ref) noexcept = default;
~database_open_options() = default;
void clear() { x_partial = false; x_partial_read_only = false; x_warn_order = true; };
// setings
void set_partial(bool value) { x_partial = value; };
void set_partial_read_only(bool value) { x_partial_read_only = value; if(value) x_partial = value; };
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;
};
class database_dump_options
{
public:
database_dump_options() { clear(); };
database_dump_options(const database_dump_options & ref) = default;
database_dump_options(database_dump_options && ref) noexcept = default;
database_dump_options & operator = (const database_dump_options & ref) = default;
database_dump_options & operator = (database_dump_options && ref) noexcept = default;
~database_dump_options() = default;
void clear() { x_overwrite = false; };
// settings
void set_overwrite(bool value) { x_overwrite = value; };
// gettings
bool get_overwrite() const { return x_overwrite; };
private:
bool x_overwrite;
};
class database_add_options
{
public:
database_add_options() { clear(); };
database_add_options(const database_add_options & ref) = default;
database_add_options(database_add_options && ref) noexcept = default;
database_add_options & operator = (const database_add_options & ref) = default;
database_add_options & operator = (database_add_options && ref) noexcept = default;
~database_add_options() = default;
void clear() {};
};
class database_remove_options
{
public:
database_remove_options() { clear(); };
database_remove_options(const database_remove_options & ref) = default;
database_remove_options(database_remove_options && ref) noexcept = default;
database_remove_options & operator = (const database_remove_options & ref) = default;
database_remove_options & operator = (database_remove_options && ref) noexcept = default;
~database_remove_options() = default;
void clear() { x_revert_archive_numbering = false; };
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;
};
class database_change_basename_options
{
public:
database_change_basename_options() { clear(); };
database_change_basename_options(const database_change_basename_options & ref) = default;
database_change_basename_options(database_change_basename_options && ref) noexcept = default;
database_change_basename_options & operator = (const database_change_basename_options & ref) = default;
database_change_basename_options & operator = (database_change_basename_options && ref) noexcept = default;
~database_change_basename_options() = default;
void clear() { x_revert_archive_numbering = false; };
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;
};
class database_change_path_options
{
public:
database_change_path_options() { clear(); };
database_change_path_options(const database_change_path_options & ref) = default;
database_change_path_options(database_change_path_options && ref) noexcept = default;
database_change_path_options & operator = (const database_change_path_options & ref) = default;
database_change_path_options & operator = (database_change_path_options && ref) noexcept = default;
~database_change_path_options() = default;
void clear() { x_revert_archive_numbering = false; };
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;
};
class database_restore_options
{
public:
database_restore_options() { clear(); };
database_restore_options(const database_restore_options & ref) = default;
database_restore_options(database_restore_options && ref) noexcept = default;
database_restore_options & operator = (const database_restore_options & ref) = default;
database_restore_options & operator = (database_restore_options && ref) noexcept = default;
~database_restore_options() = default;
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
void set_early_release(bool value) { x_early_release = value; };
void set_info_details(bool value) { x_info_details = value; };
void set_extra_options_for_dar(const std::vector<std::string> & value) { x_extra_options_for_dar = value; };
void set_ignore_dar_options_in_database(bool mode) { x_ignore_dar_options_in_database = mode; };
void set_date(const infinint & value) { x_date = value; };
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;
};
class database_used_options
{
public:
database_used_options() { clear(); };
database_used_options(const database_used_options & ref) = default;
database_used_options(database_used_options && ref) noexcept = default;
database_used_options & operator = (const database_used_options & ref) = default;
database_used_options & operator = (database_used_options && ref) noexcept = default;
~database_used_options() = default;
void clear() { x_revert_archive_numbering = false; };
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
libdar::database_add_options
options to add an archive to base
Definition database_options.hpp:133
libdar::database_change_basename_options
options for changing a given archive's basename
Definition database_options.hpp:172
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:184
libdar::database_change_path_options
options for changing a given archive's path
Definition database_options.hpp:197
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:209
libdar::database_dump_options
options to write a database to file
Definition database_options.hpp:103
libdar::database_dump_options::set_overwrite
void set_overwrite(bool value)
overwrite option
Definition database_options.hpp:120
libdar::database_open_options
options to open a database
Definition database_options.hpp:54
libdar::database_open_options::set_partial_read_only
void set_partial_read_only(bool value)
partial and read only option
Definition database_options.hpp:81
libdar::database_open_options::set_partial
void set_partial(bool value)
partial option
Definition database_options.hpp:72
libdar::database_open_options::set_warn_order
void set_warn_order(bool value)
warning about file ordering in database
Definition database_options.hpp:87
libdar::database_remove_options
options to remove an archive from the base
Definition database_options.hpp:148
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:160
libdar::database_restore_options
options for restoration from database
Definition database_options.hpp:221
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:267
libdar::database_restore_options::set_info_details
void set_info_details(bool value)
info_details option
Definition database_options.hpp:246
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:251
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:255
libdar::database_restore_options::set_early_release
void set_early_release(bool value)
early_release option
Definition database_options.hpp:241
libdar::database_restore_options::set_date
void set_date(const infinint &value)
date option
Definition database_options.hpp:261
libdar::database_used_options
options for file "used" in archive
Definition database_options.hpp:291
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:303
libdar::infinint
the arbitrary large positive integer class
Definition real_infinint.hpp:62
my_config.h
include macro defined by the configure script and some specific additional ones
libdar
libdar namespace encapsulate all libdar symbols
Definition archive.hpp:47