Disk ARchive  2.7.15
Full featured and portable backup and archiving tool
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
libdar::header Class Reference

this class manages the header of each slice More...

#include <header.hpp>

+ Collaboration diagram for libdar::header:

Public Member Functions

 header (const header &ref)
 
 header (header &&ref) noexcept
 
headeroperator= (const header &ref)
 
headeroperator= (header &&ref) noexcept
 
void read (user_interaction &ui, generic_file &f, bool lax=false)
 
void write (user_interaction &, generic_file &f) const
 
magic_number & get_set_magic ()
 
labelget_set_internal_name ()
 
char & get_set_flag ()
 
labelget_set_data_name ()
 
bool get_first_slice_size (infinint &size) const
 
void set_first_slice_size (const infinint &size)
 
void unset_first_slice_size ()
 
bool get_slice_size (infinint &size) const
 
void set_slice_size (const infinint &size)
 
void unset_slice_size ()
 
bool is_old_header () const
 
void set_format_07_compatibility ()
 

Static Public Member Functions

static U_I min_size ()
 minimal size of a header in an archive More...
 

Private Member Functions

void nullifyptr () noexcept
 
void copy_from (const header &ref)
 
void move_from (header &&ref) noexcept
 
void free_pointers ()
 
void fill_from (user_interaction &ui, const tlv_list &list)
 
tlv_list build_tlv_list (user_interaction &ui) const
 

Private Attributes

magic_number magic
 constant string for all Dar archives
 
label internal_name
 constant string for all slices of a given archive (computed based on date and pid)
 
label data_name
 constant string for a set of data (constant with dar_xform, used to link isolated catalogue to its original data)
 
char flag
 whether slice is the last of the archive or not
 
infinintfirst_size
 size of the first slice
 
infinintslice_size
 size of slices (except first slice if specified else and last if not fulfilled)
 
bool old_header
 true if the header has been read from an old archive (before release 2.4.0, format 07 and below) and if true when writing, create an old slice header (compatible with format 07).
 

Detailed Description

this class manages the header of each slice

this class was a struct before release 2.4.0, now promoted to a class it hides the fields and uses TLV to store the fields in the archive. This makes the header easier to extend by adding new fields, while letting a chance for the old implementation to be able to use more recent archives the main use of TLV is to handle optional fields easily.

Definition at line 65 of file header.hpp.

Member Function Documentation

◆ min_size()

static U_I libdar::header::min_size ( )
inlinestatic

minimal size of a header in an archive

Returns
min size of a header once stored in an archive
Note
since release 2.4.0 the header used for each slice is exactly the same. before this release the header of the first slice might be bigger, it was known that the size of the other header was "min_size" this let dar be able to find the proper slice for a given position. For compatibility with older DAR format, it is thus important to not change the value returned by this class method. This call is only used when reading archive generated by old versions of dar < 2.4.0. (aka archive format <= 7)

Definition at line 91 of file header.hpp.


The documentation for this class was generated from the following file: