Loading...
Searching...
No Matches
libdar::cat_signature Class Reference
Private

class cat_signature combines the cat_entree::signature() of the object with its saved_status and read and store this combinason More...

`#include <cat_signature.hpp>`

## Public Member Functions

| cat_signature (unsigned char original, saved_status status)
| set a signature from running libdar
| cat_signature (generic_file &f, const archive_version &reading_ver)
| set a signature from an disk archive
bool | read (generic_file &f, const archive_version &reading_ver)
| read a signature from archive for an existing cat_signature object (overwrite its value)
void | write (generic_file &f)
bool | get_base_and_status (unsigned char &base, saved_status &saved) const
| provide typ and status as read from the archive

## Static Public Member Functions

static bool | compatible_signature (unsigned char a, unsigned char b)

## Private Attributes

unsigned char | field
| stores file type and status information

## Static Private Attributes

static constexpr U_8 | SAVED_FAKE_BIT = 0x80
static constexpr U_8 | SAVED_NON_DELTA_BIT = 0x40

## Detailed Description

class cat_signature combines the cat_entree::signature() of the object with its saved_status and read and store this combinason

historically these two fields were saved on a single byte, but as libdar received new feature it was to narrow where from this class to transparently manage this field evolution

Definition at line 48 of file cat_signature.hpp.

## Member Function Documentation

## get_base_and_status()

bool libdar::cat_signature::get_base_and_status | ( | unsigned char & | base,
|  | saved_status & | saved ) const

provide typ and status as read from the archive

Parameters

  [out] | base | the signature() of the entry
  [out] | saved | the get_saved_status() of the entry

Returns
  false if the field read from the archive is malformed, in which case the returned argument are meaningless

## read()

bool libdar::cat_signature::read | ( | generic_file & | f,
|  | const archive_version & | reading_ver )

read a signature from archive for an existing cat_signature object (overwrite its value)

Parameters

  [in] | f | where to read data from
  [in] | reading_ver | which format to expect

Returns
  true if data could be read, false else.

Note
  the validity of the read data is not checked at that time but a the time get_base_and_status() is called

## Member Data Documentation

## field

unsigned char libdar::cat_signature::field

private

stores file type and status information

Note
  this field "field" stores two types of information: Historically, the type was stored as different letters, then the differential backup has been added and the saved/not_saved status appeared as uppercase for not_saved status and lowercase for saved status (backward compatibility)

adding features after features, the FAKE status used in isolated catalogues used the bit 8 (ASCII used 7 lower bits only).

but while adding the delta-diff feature it has been realized that 3 bits could be used beside information type to store the status thanks to the way ASCI encodes letters: the 5 lower bits encode the letter nature, remains the bits 6, 7 and 8 to encode the status of the inode:

Definition at line 107 of file cat_signature.hpp.

## SAVED_FAKE_BIT

U_8 libdar::cat_signature::SAVED_FAKE_BIT = 0x80

static constexpr private

Definition at line 77 of file cat_signature.hpp.

## SAVED_NON_DELTA_BIT

U_8 libdar::cat_signature::SAVED_NON_DELTA_BIT = 0x40

static constexpr private

Definition at line 78 of file cat_signature.hpp.

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

- cat_signature.hpp