Loading...
Searching...
No Matches
slice_layout.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 SLICE_LAYOUT_HPP
#define SLICE_LAYOUT_HPP
#include <string>
#include <set>
#include "../my_config.h"
#include "infinint.hpp"
#include "generic_file.hpp"
namespace libdar
{
class slice_layout
{
public:
slice_layout() { clear(); };
slice_layout(const slice_layout & ref) = default;
slice_layout(slice_layout && ref) noexcept = default;
slice_layout & operator = (const slice_layout & ref) = default;
slice_layout & operator = (slice_layout && ref) noexcept = default;
~slice_layout() = default;
// field still exposed (slice_layout was a struct before being a class)
// we keep these fields as is for now
infinint first_size;
infinint other_size;
infinint first_slice_header;
infinint other_slice_header;
bool older_sar_than_v8;
void read(generic_file & f);
void write(generic_file & f) const;
void clear();
void which_slice(const infinint & offset,
infinint & slice_num,
infinint & slice_offset) const;
private:
static const char OLDER_THAN_V8 = '7';
static const char V8 = '8';
};
} // end of namespace
#endif
generic_file.hpp
class generic_file is defined here as well as class fichier
infinint.hpp
switch module to limitint (32 ou 64 bits integers) or infinint
my_config.h
include macro defined by the configure script and some specific additional ones
libdar
libdar namespace encapsulate all libdar symbols
Definition archive.hpp:47