Loading...
Searching...
No Matches
archive_options5.hpp
Go to the documentation of this file.
/*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2024 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
libdar::archive_options_create
class holding optional parameters used to create an archive
Definition archive_options.hpp:288
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:530
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_extract
class holding optional parameters used to extract files from an existing archive
Definition archive_options.hpp:1294
libdar::archive_options_isolate
class holding optional parameters used to isolate an existing archive
Definition archive_options.hpp:750
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:859
libdar::archive_options_listing_shell
class holding optional shell specific parameters used to list the contents of an existing archive
Definition archive_options_listing_shell.hpp:48
libdar::archive_options_merge
class holding optional parameters used to proceed to the merge operation
Definition archive_options.hpp:981
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:1136
libdar::archive_options_read
class holding optional parameters used to read an existing archive
Definition archive_options.hpp:65
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
libdar::archive_options_repair
class holding optional parameters used to create an archive
Definition archive_options.hpp:1720
libdar::archive_options_test
class holding optional parameters used to test the structure coherence of an existing archive
Definition archive_options.hpp:1647
libdar::archive
the archive class realizes the most general operations on archives
Definition archive.hpp:65
libdar::entrepot
the Entrepot interface
Definition entrepot.hpp:56
libdar5
libdar5 namespace encapsulate all libdar symbols
Definition archive5.hpp:37