Loading...
Searching...
No Matches
contextual.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 CONTEXTUAL_HPP
#define CONTEXTUAL_HPP
#include "../my_config.h"
extern "C"
{
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
} // end extern "C"
#include "erreurs.hpp"
#include "label.hpp"
#include <string>
namespace libdar
{
#define CONTEXT_INIT "init"
#define CONTEXT_OP "operation"
#define CONTEXT_LAST_SLICE "last_slice"
class contextual
{
public :
contextual() { status = ""; };
contextual(const contextual & ref) = default;
contextual(contextual && ref) noexcept = default;
contextual & operator = (const contextual & ref) = default;
contextual & operator = (contextual && ref) noexcept = default;
virtual ~contextual() noexcept(false) {};
virtual void set_info_status(const std::string & s) { status = s; };
virtual std::string get_info_status() const { return status; };
virtual bool is_an_old_start_end_archive() const = 0;
virtual const label & get_data_name() const = 0;
private:
std::string status;
};
} // end of namespace
#endif
libdar::contextual
the contextual class adds the information of phases in the generic_file
Definition contextual.hpp:74
libdar::contextual::get_info_status
virtual std::string get_info_status() const
get the current contextual value
Definition contextual.hpp:91
libdar::contextual::get_data_name
virtual const label & get_data_name() const =0
obtain the data_name of the archive (label associated with the archive's data)
libdar::contextual::is_an_old_start_end_archive
virtual bool is_an_old_start_end_archive() const =0
returns whether the archive is a old archive (format < 8)
libdar::contextual::set_info_status
virtual void set_info_status(const std::string &s)
defines the new contextual value
Definition contextual.hpp:88
libdar::label
manage label data structure used in archive slice headers
Definition label.hpp:43
erreurs.hpp
contains all the excetion class thrown by libdar
label.hpp
define the datastructure "label" used to identify slice membership to an archive
libdar
libdar namespace encapsulate all libdar symbols
Definition archive.hpp:47