Disk ARchive  2.5.12
Full featured and portable backup and archiving tool
slice_layout.hpp
Go to the documentation of this file.
1 /*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2052 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 //
19 // to contact the author : http://dar.linux.free.fr/email.html
20 /*********************************************************************/
21 
25 
26 
27 #ifndef SLICE_LAYOUT_HPP
28 #define SLICE_LAYOUT_HPP
29 
30 #include <string>
31 #include <set>
32 
33 #include "../my_config.h"
34 #include "infinint.hpp"
35 #include "generic_file.hpp"
36 #include "on_pool.hpp"
37 
38 namespace libdar
39 {
40 
41  class slice_layout : public on_pool
42  {
43  public:
44  // field still exposed (slice_layout was a struct before being a class)
45  // we keep these fields as is for now
46 
47  infinint first_size; //< size of the first slice
48  infinint other_size; //< maximum size of other slices
49  infinint first_slice_header; //< size of the slice header in the first slice
50  infinint other_slice_header; //< size of the slice header in the other slices
51  bool older_sar_than_v8; //< true if the archive format is older than version 8
52 
53  void read(generic_file & f);
54  void write(generic_file & f) const;
55  void clear();
56 
63  void which_slice(const infinint & offset,
64  infinint & slice_num,
65  infinint & slice_offset) const;
66 
67  private:
68  static const char OLDER_THAN_V8 = '7';
69  static const char V8 = '8';
70  };
71 
72 } // end of namespace
73 
74 #endif
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
switch module to limitint (32 ou 64 bits integers) or infinint
this is the base class of object that can be allocated on a memory pool
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47