Disk ARchive  2.6.8
Full featured and portable backup and archiving tool
archive_options5.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 #ifndef ARCHIVE_OPTIONS5_HPP
27 #define ARCHIVE_OPTIONS5_HPP
28 
29 #include "archive_options.hpp"
31 
32 namespace libdar5
33 {
34 
35  // ///////////////////////////////////////////////////////
36  // //////////// OPTIONS FOR OPENNING AN ARCHIVE //////////
37  // ///////////////////////////////////////////////////////
38 
41 
42  using libdar::entrepot;
43 
44  class archive_options_read: public libdar::archive_options_read
45  {
46  public:
47  void set_entrepot(const entrepot & entr)
48  {
49  std::shared_ptr<libdar::entrepot> tmp(entr.clone());
50  if(!tmp)
51  throw Ememory("libdar5::archive_options_create::set_entrepot");
53  }
54 
55  void set_ref_entrepot(const entrepot & entr)
56  {
57  std::shared_ptr<libdar::entrepot> tmp(entr.clone());
58  if(!tmp)
59  throw Ememory("libdar5::archive_options_create::set_ref_entrepot");
61  }
62  };
63 
64 
65  // ///////////////////////////////////////////////////////
66  // /////// OPTIONS FOR CREATING AN ARCHIVE ///////////////
67  // ///////////////////////////////////////////////////////
68 
69  class archive_options_create: public libdar::archive_options_create
70  {
71  public:
72  using libdar::archive_options_create::archive_options_create;
73 
75 
89  void set_reference(libdar::archive *ref_arch)
90  {
92  std::shared_ptr<libdar::archive>(ref_arch,
93  [](libdar::archive* ptr) {} )
94  // the custom deleter must not delete the object pointed to by
95  // by ref, this is why it does nothing
96  );
97  };
98 
99  void set_entrepot(const entrepot & entr)
100  {
101  std::shared_ptr<libdar::entrepot> tmp(entr.clone());
102  if(!tmp)
103  throw Ememory("libdar5::archive_options_create::set_entrepot");
105  }
106 
107  };
108 
109  // ///////////////////////////////////////////////////////
110  // ////////// OPTIONS FOR ISOLATING A CATALOGUE //////////
111  // ///////////////////////////////////////////////////////
112 
113 
114  class archive_options_isolate: public libdar::archive_options_isolate
115  {
116  void set_entrepot(const entrepot & entr)
117  {
118  std::shared_ptr<libdar::entrepot> tmp(entr.clone());
119  if(!tmp)
120  throw Ememory("libdar5::archive_options_create::set_entrepot");
122  }
123  };
124 
125  // ///////////////////////////////////////////////////////
126  // //////// OPTONS FOR MERGING ARCHIVES //////////////////
127  // ///////////////////////////////////////////////////////
128 
129  class archive_options_merge: public libdar::archive_options_merge
130  {
131  public:
132 
133  using libdar::archive_options_merge::archive_options_merge;
134 
135  void set_auxilliary_ref(libdar::archive *ref)
136  {
137  libdar::archive_options_merge::set_auxiliary_ref(
138  std::shared_ptr<libdar::archive>(ref,
139  [](libdar::archive* ptr) {})
140  // the custom deleter must not delete the object pointed to by
141  // by ref, this is why it does nothing
142  );
143  };
144 
145  void set_entrepot(const entrepot & entr)
146  {
147  std::shared_ptr<libdar::entrepot> tmp(entr.clone());
148  if(!tmp)
149  throw Ememory("libdar5::archive_options_create::set_entrepot");
151  }
152  };
153 
154 
155  // ///////////////////////////////////////////////////////
156  // //////// OPTONS FOR EXTRACTING FILES FROM ARCHIVE /////
157  // ///////////////////////////////////////////////////////
158 
160 
161 
162  // ///////////////////////////////////////////////////////
163  // //////// OPTIONS FOR LISTING AN ARCHIVE ///////////////
164  // ///////////////////////////////////////////////////////
165 
166  class archive_options_listing: public libdar::archive_options_listing_shell
167  {
168  public:
169  using libdar::archive_options_listing_shell::archive_options_listing_shell;
170  };
171 
172 
173  // ///////////////////////////////////////////////////////
174  // //////// OPTONS FOR DIFFING AN ARCHIVE ////////////////
175  // ///////////////////////////////////////////////////////
176 
177  using libdar::archive_options_diff;
178 
179 
180  // ///////////////////////////////////////////////////////
181  // //////// OPTONS FOR TESTING AN ARCHIVE ////////////////
182  // ///////////////////////////////////////////////////////
183 
185 
186 
187  // ///////////////////////////////////////////////////////
188  // /////// OPTIONS FOR REPAIRING AN ARCHIVE //////////////
189  // ///////////////////////////////////////////////////////
190 
192 
194 
195 } // end of namespace
196 
197 #endif
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:489
archive_options_listing_shell.hpp
this file contains shell_interaction options class for listing
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:1049
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:154
libdar::archive_options_extract
class holding optional parameters used to extract files from an existing archive
Definition: archive_options.hpp:1193
libdar::archive_options_repair
class holding optional parameters used to create an archive
Definition: archive_options.hpp:1604
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:793
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:299
archive_options.hpp
this file contains a set of classes used to transmit options to archive operation
libdar5
libdar5 namespace encapsulate all libdar symbols
Definition: archive5.hpp:36
libdar::archive_options_read
class holding optional parameters used to read an existing archive
Definition: archive_options.hpp:63
libdar::archive_options_test
class holding optional parameters used to test the structure coherence of an existing archive
Definition: archive_options.hpp:1531
libdar::archive_options_merge
class holding optional parameters used to proceed to the merge operation
Definition: archive_options.hpp:900
libdar::entrepot
the Entrepot interface
Definition: entrepot.hpp:56
libdar::archive
the archive class realizes the most general operations on archives
Definition: archive.hpp:64
libdar::archive_options_create
class holding optional parameters used to create an archive
Definition: archive_options.hpp:275
libdar::archive_options_isolate
class holding optional parameters used to isolate an existing archive
Definition: archive_options.hpp:691
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:47
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:198