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

the cat_delta_signature file class More...

#include <cat_delta_signature.hpp>

Public Member Functions

 cat_delta_signature (generic_file &f, bool sequential_read)
 constructor reading the object METADATA (and also its DATA when in sequential mode) from an archive More...
 
 cat_delta_signature ()
 constructor creating a brand new empty object
 
 cat_delta_signature (const cat_delta_signature &ref)
 copy constructor
 
 cat_delta_signature (cat_delta_signature &&ref) noexcept
 move constructor
 
cat_delta_signatureoperator= (const cat_delta_signature &ref)
 assignement operator
 
cat_delta_signatureoperator= (cat_delta_signature &&ref) noexcept
 move assignment operator
 
 ~cat_delta_signature ()
 destructor
 
void read_metadata (generic_file &f, bool sequential_read)
 same action as the first constructor but on an existing object More...
 
void read_data (generic_file &f)
 fetch data assuming the object has already read the metadata More...
 
bool can_obtain_sig ()
 the cat_delta_signature structure can only hold CRC without delta_signature, this call gives the situation about that point
 
memory_fileobtain_sig ()
 provide a memory_file object which the caller has the duty to destroy after use More...
 
void will_have_signature ()
 give the object where to fetch from the delta signature, object must exist up to the next call to dump_data More...
 
void set_sig_ref (memory_file *ptr)
 
void set_sig_ref ()
 variante used when the delta_signature object will only contain CRCs (no delta signature)
 
void dump_data (generic_file &f, bool sequential_mode) const
 write down the data only (only for archive without sequential read mode support)
 
void dump_metadata (generic_file &f) const
 
bool has_patch_base_crc () const
 returns whether the object has a base patch CRC (s_delta status objects)
 
bool get_patch_base_crc (const crc *&c) const
 returns the CRC of the file to base the patch on, for s_delta objects
 
void set_patch_base_crc (const crc &c)
 set the reference CRC of the file to base the patch on, for s_detla objects
 
bool has_patch_result_crc () const
 returns whether the object has a CRC corresponding to data (for s_saved, s_delta, and when delta signature is present)
 
bool get_patch_result_crc (const crc *&c) const
 returns the CRC the file will have once restored or patched (for s_saved, s_delta, and when delta signature is present)
 
void set_patch_result_crc (const crc &c)
 set the CRC the file will have once restored or patched (for s_saved, s_delta, and when delta signature is present)
 
void clear ()
 reset the object
 

Private Member Functions

void init () noexcept
 
void copy_from (const cat_delta_signature &ref)
 
void move_from (cat_delta_signature &&ref) noexcept
 
void clear_sig () noexcept
 
void destroy () noexcept
 

Private Attributes

infinint delta_sig_offset
 where to read data from to setup "sig" (set to zero when read in sequential mode, sig is setup on-fly)
 
infinint delta_sig_size
 size of the data to setup "sig" (set to zero when reading in sequential mode, sig is then setup on-fly)
 
memory_filesig
 the signature data, if set nullptr it will be fetched from f in direct access mode only
 
bool sig_is_ours
 whether sig has been created on our behalf or given as reference by another class
 
crcpatch_base_check
 associated CRC for the file this signature has been computed on
 
crcpatch_result_check
 associated CRC
 
bool just_crc
 whether a delta signature is present or just checksum are stored
 

Detailed Description

the cat_delta_signature file class

this class works in to implicit modes

Definition at line 87 of file cat_delta_signature.hpp.

Constructor & Destructor Documentation

◆ cat_delta_signature()

libdar::cat_delta_signature::cat_delta_signature ( generic_file f,
bool  sequential_read 
)

constructor reading the object METADATA (and also its DATA when in sequential mode) from an archive

Parameters
[in]fwhere to read the data from
[in]sequential_readif true read the whole metadata+data as it was dropped in sequential read mode, else only read the metadata (found in a catalogue)

Member Function Documentation

◆ dump_metadata()

void libdar::cat_delta_signature::dump_metadata ( generic_file f) const

write down the METADATA either in sequential_read mode (data+metadata) or in direct access mode (metadata only)

Referenced by set_sig_ref().

◆ obtain_sig()

memory_file* libdar::cat_delta_signature::obtain_sig ( )

provide a memory_file object which the caller has the duty to destroy after use

Note
to obtain the sig data a second time, one must call read_data() again, then obtain_sig() should succeed

Referenced by can_obtain_sig().

◆ read_data()

void libdar::cat_delta_signature::read_data ( generic_file f)

fetch data assuming the object has already read the metadata

Note
may be called several times if necessary to obtain_sig() another time

Referenced by ~cat_delta_signature().

◆ read_metadata()

void libdar::cat_delta_signature::read_metadata ( generic_file f,
bool  sequential_read 
)

same action as the first constructor but on an existing object

Note
in sequential_read mode the data is also read

Referenced by ~cat_delta_signature().

◆ will_have_signature()

void libdar::cat_delta_signature::will_have_signature ( )
inline

give the object where to fetch from the delta signature, object must exist up to the next call to dump_data

Note
seg_sig_ref() must be called each time before invoking dump_data(), normally it is done once... for can_obtain_sig() to return true before the signature is provided

Definition at line 141 of file cat_delta_signature.hpp.

References just_crc, and set_sig_ref().


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