Loading...
Searching...
No Matches
archive_options5.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 ARCHIVE_OPTIONS5_HPP
#define ARCHIVE_OPTIONS5_HPP
#include "archive_options.hpp"
#include "archive_options_listing_shell.hpp"
namespace libdar5
{
// ///////////////////////////////////////////////////////
// //////////// OPTIONS FOR OPENNING AN ARCHIVE //////////
// ///////////////////////////////////////////////////////
using libdar::entrepot;
class archive_options_read: public libdar::archive_options_read
{
public:
void set_entrepot(const entrepot & entr)
{
std::shared_ptr<libdar::entrepot> tmp(entr.clone());
if(!tmp)
throw Ememory("libdar5::archive_options_create::set_entrepot");
libdar::archive_options_read::set_entrepot(tmp);
}
void set_ref_entrepot(const entrepot & entr)
{
std::shared_ptr<libdar::entrepot> tmp(entr.clone());
if(!tmp)
throw Ememory("libdar5::archive_options_create::set_ref_entrepot");
libdar::archive_options_read::set_ref_entrepot(tmp);
}
};
// ///////////////////////////////////////////////////////
// /////// OPTIONS FOR CREATING AN ARCHIVE ///////////////
// ///////////////////////////////////////////////////////
class archive_options_create: public libdar::archive_options_create
{
public:
using libdar::archive_options_create::archive_options_create;
void set_reference(libdar::archive *ref_arch)
{
libdar::archive_options_create::set_reference(
std::shared_ptr<libdar::archive>(ref_arch,
[](libdar::archive* ptr) {} )
// the custom deleter must not delete the object pointed to by
// by ref, this is why it does nothing
);
};
void set_entrepot(const entrepot & entr)
{
std::shared_ptr<libdar::entrepot> tmp(entr.clone());
if(!tmp)
throw Ememory("libdar5::archive_options_create::set_entrepot");
libdar::archive_options_create::set_entrepot(tmp);
}
};
// ///////////////////////////////////////////////////////
// ////////// OPTIONS FOR ISOLATING A CATALOGUE //////////
// ///////////////////////////////////////////////////////
class archive_options_isolate: public libdar::archive_options_isolate
{
void set_entrepot(const entrepot & entr)
{
std::shared_ptr<libdar::entrepot> tmp(entr.clone());
if(!tmp)
throw Ememory("libdar5::archive_options_create::set_entrepot");
libdar::archive_options_isolate::set_entrepot(tmp);
}
};
// ///////////////////////////////////////////////////////
// //////// OPTONS FOR MERGING ARCHIVES //////////////////
// ///////////////////////////////////////////////////////
class archive_options_merge: public libdar::archive_options_merge
{
public:
using libdar::archive_options_merge::archive_options_merge;
void set_auxilliary_ref(libdar::archive *ref)
{
libdar::archive_options_merge::set_auxiliary_ref(
std::shared_ptr<libdar::archive>(ref,
[](libdar::archive* ptr) {})
// the custom deleter must not delete the object pointed to by
// by ref, this is why it does nothing
);
};
void set_entrepot(const entrepot & entr)
{
std::shared_ptr<libdar::entrepot> tmp(entr.clone());
if(!tmp)
throw Ememory("libdar5::archive_options_create::set_entrepot");
libdar::archive_options_merge::set_entrepot(tmp);
}
};
// ///////////////////////////////////////////////////////
// //////// OPTONS FOR EXTRACTING FILES FROM ARCHIVE /////
// ///////////////////////////////////////////////////////
using libdar::archive_options_extract;
// ///////////////////////////////////////////////////////
// //////// OPTIONS FOR LISTING AN ARCHIVE ///////////////
// ///////////////////////////////////////////////////////
class archive_options_listing: public libdar::archive_options_listing_shell
{
public:
using libdar::archive_options_listing_shell::archive_options_listing_shell;
};
// ///////////////////////////////////////////////////////
// //////// OPTONS FOR DIFFING AN ARCHIVE ////////////////
// ///////////////////////////////////////////////////////
using libdar::archive_options_diff;
// ///////////////////////////////////////////////////////
// //////// OPTONS FOR TESTING AN ARCHIVE ////////////////
// ///////////////////////////////////////////////////////
using libdar::archive_options_test;
// ///////////////////////////////////////////////////////
// /////// OPTIONS FOR REPAIRING AN ARCHIVE //////////////
// ///////////////////////////////////////////////////////
using libdar::archive_options_repair;
} // end of namespace
#endif
archive_options.hpp
this file contains a set of classes used to transmit options to archive operation
archive_options_listing_shell.hpp
this file contains shell_interaction options class for listing
libdar5::entrepot::clone
virtual entrepot * clone() const =0
generate a clone of "this"
libdar::archive_options_create::set_entrepot
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
Definition archive_options.hpp:538
libdar::archive_options_create::set_reference
void set_reference(std::shared_ptr< archive > ref_arch)
set the archive to take as reference (nullptr for a full backup)
Definition archive_options.hpp:311
libdar::archive_options_isolate::set_entrepot
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
Definition archive_options.hpp:867
libdar::archive_options_merge::set_entrepot
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
Definition archive_options.hpp:1154
libdar::archive_options_read::set_entrepot
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use to retrieve slices
Definition archive_options.hpp:155
libdar::archive_options_read::set_ref_entrepot
void set_ref_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use to retrieve slices of the reference archive (where the external catalogue...
Definition archive_options.hpp:208
libdar5
libdar5 namespace encapsulate all libdar symbols
Definition archive5.hpp:37