| Disk ARchive 2.6.12 Full featured and portable backup and archiving tool

contextual.hpp
Go to the documentation of this file.
1 /*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2020 Denis Corbin
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 //
19 // to contact the author : http://dar.linux.free.fr/email.html
20 /*********************************************************************/
21
25
26
27 #ifndef CONTEXTUAL_HPP
28 #define CONTEXTUAL_HPP
29
30
31 #include "../my_config.h"
32
33 extern "C"
34 {
35 #if HAVE_UNISTD_H
36 #include <unistd.h>
37 #endif
38 } // end extern "C"
39
40 #include "erreurs.hpp"
41 #include "label.hpp"
42
43 #include <string>
44
45 namespace libdar
46 {
47
48 #define CONTEXT_INIT "init"
49 #define CONTEXT_OP "operation"
50 #define CONTEXT_LAST_SLICE "last_slice"
51
52
55
57
72
73 class contextual
74 {
75 public :
76 contextual() { status = ""; };
77 contextual(const contextual & ref) = default;
78 contextual(contextual && ref) noexcept = default;
79 contextual & operator = (const contextual & ref) = default;
80 contextual & operator = (contextual && ref) noexcept = default;
81 virtual ~contextual() noexcept(false) {};
82
84
88 virtual void set_info_status(const std::string & s) { status = s; };
89
91 virtual std::string get_info_status() const { return status; };
92
94 virtual bool is_an_old_start_end_archive() const = 0;
95
97
100 virtual const label & get_data_name() const = 0;
101
102 private:
103 std::string status;
104 };
105
107
108 } // end of namespace
109
110 #endif
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
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::get_info_status
virtual std::string get_info_status() const
get the current contextual value
Definition: contextual.hpp:91
label.hpp
define the datastructure "label" used to identify slice membership to an archive
erreurs.hpp
contains all the excetion class thrown by libdar
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
the contextual class adds the information of phases in the generic_file
Definition: contextual.hpp:74
libdar
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47