Disk ARchive  2.7.13
Full featured and portable backup and archiving tool
Files | Classes | Macros | Typedefs | Enumerations | Functions | Variables
Private

Libdar internal symbols. More...

+ Collaboration diagram for Private:

Files

file  block_compressor.hpp
 provide per block compression/decompression independant from libthreadar but single threaded
 
file  bzip2_module.hpp
 per block encryption using bzip2 algorithm/library
 
file  cache.hpp
 contains the cache class
 
file  cache_global.hpp
 adaptation of the cache class to the fichier_global interface
 
file  candidates.hpp
 helper class for class data_tree to find the list of archive to restore for a given file
 
file  capabilities.hpp
 provide information about current thread (underlying using the widthdrawn POSIX.1e API)
 
file  cat_all_entrees.hpp
 include file gathering all entree found in a catalogue
 
file  cat_blockdev.hpp
 class used to record block special devices in a catalogue
 
file  cat_chardev.hpp
 class used to record character special devices in a catalogue
 
file  cat_delta_signature.hpp
 class used to manage binary delta signature in catalogue and archive
 
file  cat_detruit.hpp
 used to record information in a catalogue about a deleted file (differential backup context)
 
file  cat_device.hpp
 parent class for all special devices inodes
 
file  cat_directory.hpp
 class used to organize objects in tree in catalogue as like directories in a filesystem
 
file  cat_door.hpp
 class used in a catalogue to store solaris door filesystem entries
 
file  cat_entree.hpp
 base class for all object contained in a catalogue
 
file  cat_eod.hpp
 object exchanged with a catalogue (never stored in it) to signal the end of a directory
 
file  cat_etoile.hpp
 class holding an cat_inode object that get pointed by multiple mirage objects (smart pointers) to record hard links in a catalogue
 
file  cat_file.hpp
 class used to record plain files in a catalogue
 
file  cat_ignored.hpp
 class used to remember that an entry has been ignored and shall not be recorded as deleted using a detruit object in a catalogue
 
file  cat_ignored_dir.hpp
 class used to remember in a catalogue that a cat_directory has been ignored
 
file  cat_inode.hpp
 base object for all inode types, managed EA and FSA, dates, permissions, ownership, ...
 
file  cat_lien.hpp
 class used to store symbolic links in a catalogue
 
file  cat_mirage.hpp
 smart pointer to an etoile object. Used to store hard link information inside a catalogue
 
file  cat_nomme.hpp
 base class of all objects contained in a catalogue and that can be named
 
file  cat_prise.hpp
 class to record filesystem (UNIX) sockets in a catalogue
 
file  cat_signature.hpp
 class used to write and read from archive the type and status of each entry in a catalogue
 
file  cat_status.hpp
 the different status of data and EA
 
file  cat_tube.hpp
 class to record named pipes in a catalogue
 
file  catalogue.hpp
 here is defined the classe used to manage catalogue of archives
 
file  compress_block_header.hpp
 block header used for compression per block
 
file  compress_module.hpp
 provides abstracted interface of per-block compression/decompression
 
file  compressor.hpp
 compression engine implementation
 
file  compressor_zstd.hpp
 streaming compression implementation for zstd algorithm
 
file  contextual.hpp
 class contextual adds the information of phases in the generic_file
 
file  crc.hpp
 class crc definition, used to handle Cyclic Redundancy Checks
 
file  crypto_asym.hpp
 the asymetric cryptographical algoritms relying on gpgme
 
file  crypto_module.hpp
 per block cryptography implementation
 
file  crypto_segment.hpp
 defines unit block of information ciphered as once
 
file  crypto_sym.hpp
 class crypto_sym for symetrical cipherings
 
file  cygwin_adapt.h
 thin C adaptation layer to Cygwin specifities
 
file  cygwin_adapt.hpp
 thin C++ adaptation layer to Cygwin specifities
 
file  data_dir.hpp
 classes used to store directory tree information in dar_manager databases
 
file  data_tree.hpp
 base classes used to store entree information in dar_manager databases
 
file  database_header.hpp
 defines the database structure in file
 
file  defile.hpp
 here is defined the defile class
 
file  ea.hpp
 contains a set of routines to manage EA values associated to a file
 
file  ea_filesystem.hpp
 filesystem dependent Extended Attributes operations
 
file  elastic.hpp
 here is defined the elastic class
 
file  entrepot_local.hpp
 defines the implementation for local filesystem entrepot The entrepot_local is the only implementation of an entrepot class present in libdar. It correspond to local filesystems. The reason of existence of the entrepot stuff is to allow external application like webdar to drop/read slices over the network using FTP protocol for example. External applications only have to define Their own implementation of the entrepot interface and file-like objects they generates (inherited from class fichier_global), libdar uses them throught the generic interface. This avoids having network related stuff inside libdar, which for security reason and functions/roles separation would not be a good idea
 
file  erreurs_ext.hpp
 contains some additional exception class thrown by libdar
 
file  escape.hpp
 class escape definition, used for sequential reading of archives
 
file  escape_catalogue.hpp
 class escape_catalogue definition. Used for sequential writing to archives, as well as several other inherited classes from catalogue.hpp
 
file  etage.hpp
 definition of the etage structure is done here
 
file  fichier_global.hpp
 class fichier_global definition. This class is a pure virtual class class fichier_global is an abstraction of files objects whatever is their localisation like local filesystem, remote ftp server, etc. inherited classes (like fichier_local) provide full implementation
 
file  fichier_libcurl.hpp
 class fichier_libcurl definition. This is a full implementation/inherited class of class fichier_global this type of object are generated by entrepot_libcurl.
 
file  fichier_local.hpp
 class fichier_local definition. This is a full implementation/inherited class of class fichier_global this type of object are generated by entrepot_local.
 
file  filesystem_backup.hpp
 filesystem_backup class realizes the interface with the filesystem for backing up
 
file  filesystem_diff.hpp
 class filesystem_diff makes a flow of inode to feed the difference filter routine
 
 
 
file  filesystem_ids.hpp
 gather the ids of different filesystem to provide a filter based on filesystem
 
file  filesystem_restore.hpp
 class filesystem_restores create inodes from a flow of libdar objects
 
file  filesystem_specific_attribute.hpp
 filesystem specific attributes
 
file  filesystem_tools.hpp
 a set of tools used by filesystem_* classes
 
file  filtre.hpp
 here is all the core routines for the operations
 
file  generic_file.hpp
 class generic_file is defined here as well as class fichier
 
file  generic_file_overlay_for_gpgme.hpp
 adaptation class from gpgme data buffer to libdar generic_file interface
 
file  generic_rsync.hpp
 class generic_rsync provides a generic_file interface to librsync
 
file  generic_to_global_file.hpp
 this class provides an fichier_global interface for any type of generic_file object
 
file  gf_mode.hpp
 generic modes to open file
 
file  gzip_module.hpp
 per block encryption using gzip algorithm/library
 
file  hash_fichier.hpp
 class hash_fichier definition.
 
file  header.hpp
 slice header structure is defined here
 
file  header_flags.hpp
 archive header flag field management
 
file  header_version.hpp
 archive global header/trailer structure is defined here
 
file  heap.hpp
 heap data structure (relying on FIFO)
 
file  i_archive.hpp
 the archive class implementation is defined in this module
 
file  i_database.hpp
 this file holds the definition of class database implementation (pimpl idiom)
 
file  i_entrepot_libcurl.hpp
 defines the implementation for remote filesystem entrepot using libcurl
 
file  i_libdar_xform.hpp
 API for dar_xform functionnality.
 
file  int_tools.hpp
 elementary operation for infinint integers
 
file  label.hpp
 define the datastructure "label" used to identify slice membership to an archive
 
file  lz4_module.hpp
 per block encryption using LZ4 algorithm/library
 
file  lzo_module.hpp
 per block encryption using LZO algorithm/library
 
file  macro_tools.hpp
 macroscopic tools for libdar internals
 
file  mem_block.hpp
 structure to hold block of memory and manipulate in coherence with idexes and sizes
 
file  mem_ui.hpp
 class mem_ui definition. This class is to be used as parent class to handle user_interaction object management
 
file  memory_file.hpp
 Memory_file is a generic_file class that only uses virtual memory.
 
file  mycurl_easyhandle_node.hpp
 used to optimize session creation done by libcurl
 
 
file  mycurl_param_list.hpp
 wrapper for element a CURL* object can receive as parameter in order to be put in etherogeneous list
 
file  mycurl_slist.hpp
 wrapper of the curl_slist struct to allow usual copy/move on C++ object
 
file  nls_swap.hpp
 provides a set of macro to change the NLS from user application domaine to libdar domain and viceversa
 
file  null_file.hpp
 /dev/null type file implementation under the generic_file interface
 
file  op_tools.hpp
 contains tools helper for overwriting policy management
 
file  parallel_block_compressor.hpp
 provide per block and parallel compression/decompression
 
file  parallel_tronconneuse.hpp
 defines a block structured file.
 
file  pile.hpp
 class pile definition. Used to manage a stack of generic_file objects
 
file  pile_descriptor.hpp
 optimization structure to quickly access some commonly used layers of a stack of generic_file
 
file  proto_compressor.hpp
 abstracted ancestor class for compressor and parallel_compressor classes
 
file  proto_generic_file.hpp
 precursor class of generic_file used to avoid cyclic dependencies with storage and infinint
 
file  proto_tronco.hpp
 defines common interface for tronconneuse and parallel_tronconneuse
 
file  sar.hpp
 the sar and trivial_sar classes, they manage the slicing layer
 
file  sar_tools.hpp
 a set of tools aims to help Segmentation And Reassemblement (sar) class
 
file  scrambler.hpp
 contains the definition of the scrambler class, a very weak encryption scheme
 
file  secu_memory_file.hpp
 secu_memory_file is a generic_file class that only uses secured memory (not swappable and zeroed after use)
 
file  semaphore.hpp
 definition of class semaphore, used to manage invocation of backup hook for files
 
file  slave_zapette.hpp
 remote control for dar_slave.
 
file  slice_layout.hpp
 object describing the slicing of an archive
 
file  smart_pointer.hpp
 template class implementing memory efficient smart pointer
 
file  sparse_file.hpp
 class sparse_file definition, used to handle holes in files
 
file  storage.hpp
 contains a class that permits arbitrary large data storage
 
file  terminateur.hpp
 the terminateur class which defines the position of the catalogue
 
file  tlv.hpp
 Generic Type Length Value data structures.
 
file  tlv_list.hpp
 List of Generic Type Length Value data structures.
 
file  tools.hpp
 a set of general purpose routines
 
file  trivial_sar.hpp
 the trivial_sar classes manages the slicing layer when single slice is used
 
file  tronc.hpp
 defines a limited segment over another generic_file.
 
file  tronconneuse.hpp
 defines a block structured file.
 
file  trontextual.hpp
 class trontextual is a contextual variant of class tronc
 
file  tuyau.hpp
 defines the implementation of pipe under the generic_file interface.
 
file  tuyau_global.hpp
 seekable pipe on top of another fichier_global
 
file  user_group_bases.hpp
 defines class that speed up the uid to username and gid to group name lookup
 
file  wrapperlib.hpp
 libz and libbz2 wrapper to have identical interface to these libraries.
 
file  xz_module.hpp
 per block encryption using xz algorithm/library
 
file  zapette.hpp
 remote control between dar and dar_slave.
 
file  zapette_protocol.hpp
 protocol management between archive and libdar_slave classes
 
file  zstd_module.hpp
 per block encryption using zstd algorithm/library
 
file  my_config.h
 include macro defined by the configure script and some specific additional ones
 

Classes

class  libdar::cache
 the cache class implements a fixed length read/write caching mechanism More...
 
class  libdar::cache_global
 the cache_global cache is an adaptation of the cache class to the fichier_global interface More...
 
class  libdar::candidates
 helper class for data_tree More...
 
class  libdar::cat_blockdev
 the block device class More...
 
class  libdar::cat_chardev
 the char device class More...
 
class  libdar::cat_delta_signature
 the cat_delta_signature file class More...
 
class  libdar::cat_detruit
 the deleted file entry More...
 
class  libdar::cat_device
 the special cat_device root class More...
 
class  libdar::cat_directory
 the cat_directory inode class More...
 
class  libdar::cat_door
 the class for Door IPC (mainly for Solaris) More...
 
class  libdar::cat_entree
 the root class from all other inherite for any entry in the catalogue More...
 
class  libdar::cat_eod
 the End of Directory entry class More...
 
class  libdar::cat_etoile
 the hard link implementation More...
 
class  libdar::cat_file
 the plain file class More...
 
class  libdar::cat_ignored
 the present file to ignore (not to be recorded as deleted later) More...
 
class  libdar::cat_ignored_dir
 the ignored cat_directory class, to be promoted later as empty cat_directory if needed More...
 
class  libdar::cat_inode
 the root class for all cat_inode More...
 
class  libdar::cat_lien
 the symbolic link inode class More...
 
class  libdar::cat_mirage
 the hard link implementation, cat_mirage is the named entry owned by a directory it points to a common "cat_etoile class" More...
 
class  libdar::cat_nomme
 the base class for all entry that have a name More...
 
class  libdar::cat_prise
 the Unix socket inode class More...
 
class  libdar::cat_signature
 class cat_signature combines the cat_entree::signature() of the object with its saved_status and read and store this combinason More...
 
class  libdar::cat_tube
 the named pipe class More...
 
class  libdar::catalogue
 the catalogue class which gather all objects contained in a give archive More...
 
struct  libdar::compress_block_header
 block header structure used for storing compressed blocks More...
 
class  libdar::compressor
 compression class for gzip and bzip2 algorithms More...
 
class  libdar::compressor_zstd
 compression class for zstd algorithms More...
 
class  libdar::contextual
 the contextual class adds the information of phases in the generic_file More...
 
class  libdar::crc
 pure virtual class defining interface of a CRC object More...
 
class  libdar::crc_i
 crc implementation based on infinint More...
 
class  libdar::crc_n
 crc implementation based on U_I More...
 
class  libdar::crypto_asym
 asymetric ciphering More...
 
class  libdar::crypto_sym
 symetrical strong encryption, interface to grypt library More...
 
class  libdar::data_dir
 the data_dir class inherits from data_tree and holds the directory tree's parent relationship More...
 
class  libdar::data_tree
 the data_tree class stores presence of a given file in a set of archives More...
 
class  libdar::defile
 the defile class keep trace of the real path of files while the flow in the filter routines More...
 
class  libdar::ea_attributs
 the class ea_attributs manages the set of EA that can be associated to an inode More...
 
class  libdar::elastic
 the elastic buffer class More...
 
class  libdar::entrepot_local
 
class  libdar::Ethread_cancel_with_attr
 Ethread_cancel with infinint attribute. More...
 
struct  libdar::etage
 the etage structure keep trace of directory contents More...
 
class  libdar::fichier_global
 abstraction of filesystem files for entrepot More...
 
class  libdar::fichier_local
 filesystem local files More...
 
class  libdar::filesystem_backup
 makes a flow sequence of inode to feed the backup filtering routing More...
 
class  libdar::filesystem_diff
 make a flow of inode to feed the difference filter routine More...
 
class  libdar::filesystem_hard_link_read
 keep trace of hard links when reading the filesystem More...
 
class  libdar::filesystem_hard_link_write
 keep trace of already written inodes to restore hard links More...
 
class  libdar::filesystem_restore
 receive the flow of inode from the restoration filtering routing and promotes these to real filesystem objects More...
 
class  libdar::filesystem_specific_attribute
 Filesystem Specific Attributes (FSA) class. More...
 
class  libdar::filesystem_specific_attribute_list
 interface to fileystem for FSA More...
 
class  libdar::fsa_infinint
 fsa based on integer More...
 
class  libdar::fsa_time
 fsa based on time More...
 
class  libdar::generic_file
 this is the interface class from which all other data transfer classes inherit More...
 
class  libdar::generic_file_overlay_for_gpgme
 generic_file interface for for gpgme More...
 
class  libdar::generic_rsync
 generic_file interface to librsync More...
 
class  libdar::generic_to_global_file
 provides a fichier_global interface for any type of generic_file More...
 
class  libdar::hash_fichier
 manages the generation of a hash More...
 
class  libdar::header
 this class manages the header of each slice More...
 
class  libdar::header_flags
 manages the flag field used for now in the archive header More...
 
class  libdar::header_version
 manages the archive header and trailer More...
 
class  libdar::heap< T >
 the class heap is nothing related to the common heap datastructure this is just a "heap" in the sense of a pool of preallocated objects More...
 
class  libdar::database::i_database
 the class i_database is the implementation of class database More...
 
class  libdar::libdar_xform::i_libdar_xform
 class implementing the dar_xform feature More...
 
class  libdar::label
 manage label data structure used in archive slice headers More...
 
class  libdar::limitint< B >
 
class  libdar::mem_ui
 class mem_ui to keep a copy of a user_interaction object More...
 
class  libdar::memory_file
 generic_file stored in memory More...
 
class  libdar::mycurl_param_element_generic
 the ancestor class of etherogeneous list/map More...
 
class  libdar::mycurl_param_element< T >
 the implemented inherited classes of the abstracted class for etherogeneous list/map More...
 
class  libdar::mycurl_param_list
 
class  libdar::null_file
 the null_file class implements the /dev/null behavior More...
 
class  libdar::parallel_tronconneuse
 this is a partial implementation of the generic_file interface to cypher/decypher data block by block. More...
 
class  libdar::pile
 stores a stack of generic_files writing/reading on each others More...
 
class  libdar::proto_generic_file
 ancestor class of generic_file More...
 
class  libdar::sar
 Sar class stands for Segmentation And Reassembly class. More...
 
class  libdar::scrambler
 scrambler is a very weak encryption scheme More...
 
class  libdar::semaphore
 class semaphore More...
 
class  libdar::slave_zapette
 this class answers to order given by a zapette object More...
 
class  libdar::smart_node< T >
 class which holds the address of the allocated memory for many smart_pointers More...
 
class  libdar::smart_pointer< T >
 smart pointer class to be used to automagically manage multiple time pointed to address More...
 
class  libdar::statistics
 class used by libdar::archive class to give a summary of treated file during and after an operation More...
 
class  libdar::storage
 arbitrary large storage structure More...
 
class  libdar::terminateur
 terminateur class indicates the location of the beginning of the catalogue More...
 
class  libdar::thread_cancellation
 class to be used as parent to provide checkpoints to inherited classes More...
 
class  libdar::tlv
 
class  libdar::trivial_sar
 
class  libdar::tronc
 makes a segment of a generic_file appear like a real generic_file More...
 
class  libdar::tronconneuse
 this is a partial implementation of the generic_file interface to cypher/decypher data block by block. More...
 
class  libdar::trontextual
 trontextual class is a contextual class tronc, that's all. More...
 
class  libdar::tuyau
 pipe implementation under the generic_file interface. More...
 
class  libdar::tuyau_global
 the tuyau_global provides skip()/get_position() features on top of pipe-like object More...
 
class  libdar::wrapperlib
 this class encapsulates calls to libz or libbz2 More...
 
class  libdar::zapette
 zapette emulate a file that is remotely controlled by slave_zapette More...
 

Macros

#define O_TEXT   0
 
#define O_BINARY   0
 

Typedefs

using libdar::magic_number = U_32
 
using libdar::int_tools_bitfield = unsigned char[8]
 
typedef infinint(* libdar::trailing_clear_data_callback) (generic_file &below, const archive_version &reading_ver)
 the trailing_clear_data_callback call back is a mean by which the upper layer cat tell when encrypted data ends More...
 

Enumerations

enum  libdar::capa_status { libdar::capa_set , libdar::capa_clear , capa_unknown }
 the EFFECTIVE set the value of the associated capability for the calling thread More...
 
enum class  libdar::saved_status {
  libdar::saved , libdar::inode_only , libdar::fake , libdar::not_saved ,
  libdar::delta
}
 data saved status for an entry More...
 
enum class  libdar::ea_saved_status {
  libdar::none , libdar::partial , libdar::fake , libdar::full ,
  libdar::removed
}
 EA saved status for an entry. More...
 
enum class  libdar::fsa_saved_status { libdar::none , libdar::partial , libdar::full }
 FSA saved status for an entry. More...
 
enum  libdar::elastic_direction { elastic_forward , elastic_backward }
 reading direction of an elastic buffer
 
enum  libdar::gf_mode { libdar::gf_read_only , libdar::gf_write_only , libdar::gf_read_write }
 generic_file openning modes More...
 
enum  flag_type { flag_type_terminal = 'T' , flag_type_non_terminal = 'N' , flag_type_located_at_end_of_slice = 'E' }
 
enum class  libdar::compressor_block_flags { data = 0 , eof_die = 1 , error = 2 , worker_error = 3 }
 the different flags used to communicate between threads hold by parallel_block_compressor class
 
enum class  libdar::tronco_flags {
  normal = 0 , stop = 1 , eof = 2 , die = 3 ,
  data_error = 4 , exception_below = 5 , exception_worker = 6 , exception_error = 7
}
 status flags used between parallel_tronconneuse and its sub-threads
 
enum  wrapperlib_mode { zlib_mode , bzlib_mode , xz_mode }
 

Functions

capa_status libdar::capability_LINUX_IMMUTABLE (user_interaction &ui, bool verbose)
 
capa_status libdar::capability_SYS_RESOURCE (user_interaction &ui, bool verbose)
 
capa_status libdar::capability_FOWNER (user_interaction &ui, bool verbose)
 
capa_status libdar::capability_CHOWN (user_interaction &ui, bool verbose)
 
const char * libdar::cat_entree_signature2string (unsigned char sign)
 convert a signature char to a human readable string
 
crclibdar::create_crc_from_file (proto_generic_file &f, bool old=false)
 generate a CRC object reading it from file
 
crclibdar::create_crc_from_size (infinint width)
 generate a CRC object with adhoc width based on a file size
 
bool libdar::crypto_min_ver_libgcrypt_no_bug ()
 
generic_filelibdar::database_header_create (const std::shared_ptr< user_interaction > &dialog, const std::string &filename, bool overwrite, compression algozip, U_I compr_level)
 create the header for a dar_manager database More...
 
generic_filelibdar::database_header_open (const std::shared_ptr< user_interaction > &dialog, const std::string &filename, unsigned char &db_version, compression &algozip, U_I &compr_level)
 read the header of a dar_manager database More...
 
const unsigned char libdar::database_header_get_supported_version ()
 
ea_attributslibdar::ea_filesystem_read_ea (const std::string &chemin, const mask &filter)
 read EA associated to a given file More...
 
bool libdar::ea_filesystem_write_ea (const std::string &chemin, const ea_attributs &val, const mask &filter)
 overwrite some attribute to a given file's attribute list More...
 
void libdar::ea_filesystem_clear_ea (const std::string &name, const mask &filter)
 remove all EA of a given file that match a given mask More...
 
bool libdar::ea_filesystem_has_ea (const std::string &name)
 test the presence of EA for a given file More...
 
bool libdar::ea_filesystem_has_ea (const std::string &name, const mask &filter)
 test the presence of EA for a given file More...
 
template<class T >
T * libdar::cloner (const T *x)
 
bool libdar::filesystem_tools_has_immutable (const cat_inode &arg)
 
void libdar::filesystem_tools_set_immutable (const std::string &target, bool val, user_interaction &ui)
 
void libdar::filesystem_tools_supprime (user_interaction &ui, const std::string &ref)
 
void libdar::filesystem_tools_widen_perm (user_interaction &dialog, const cat_inode &ref, const std::string &chem, comparison_fields what_to_check)
 
void libdar::filesystem_tools_make_owner_perm (user_interaction &dialog, const cat_inode &ref, const std::string &chem, comparison_fields what_to_check, const fsa_scope &scope)
 
void libdar::filesystem_tools_make_date (const cat_inode &ref, const std::string &chem, comparison_fields what_to_check, const fsa_scope &scope)
 
void libdar::filesystem_tools_attach_ea (const std::string &chemin, cat_inode *ino, const mask &ea_mask)
 
bool libdar::filesystem_tools_is_nodump_flag_set (user_interaction &dialog, const path &chem, const std::string &filename, bool info)
 
pathlibdar::filesystem_tools_get_root_with_symlink (user_interaction &dialog, const path &root, bool info_details)
 
mode_t libdar::filesystem_tools_get_file_permission (const std::string &path)
 
void libdar::filesystem_tools_make_delta_patch (const std::shared_ptr< user_interaction > &dialog, const cat_file &existing, const std::string &existing_pathname, const cat_file &patcher, const path &directory)
 
fichier_locallibdar::filesystem_tools_create_non_existing_file_based_on (const std::shared_ptr< user_interaction > &dialog, std::string filename, path where, std::string &new_filename)
 create in dirname a brand-new filename which name derives from filename More...
 
void libdar::filesystem_tools_copy_content_from_to (const std::shared_ptr< user_interaction > &dialog, const std::string &source_path, const std::string &destination_path, const crc *expected_crc)
 
bool libdar::filesystem_tools_read_linux_birthtime (const std::string &target, datetime &val)
 read the birthtime of target inode More...
 
void libdar::filtre_restore (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, const catalogue &cat, const path &fs_racine, bool fs_warn_overwrite, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics &st, const mask &ea_mask, bool flat, comparison_fields what_to_check, bool warn_remove_no_match, bool empty, bool empty_dir, const crit_action &x_overwrite, archive_options_extract::t_dirty dirty, bool only_deleted, bool not_deleted, const fsa_scope &scope, bool ignore_unix_sockets)
 
void libdar::filtre_sauvegarde (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, const pile_descriptor &pdesc, catalogue &cat, const catalogue &ref, const path &fs_racine, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool display_finished, statistics &st, bool make_empty_dir, const mask &ea_mask, const mask &compr_mask, const infinint &min_compr_size, bool nodump, const infinint &hourshift, bool alter_time, bool furtive_read_mode, const filesystem_ids &same_fs, comparison_fields what_to_check, bool snapshot, bool cache_directory_tagging, bool security_check, const infinint &repeat_count, const infinint &repeat_byte, const infinint &fixed_date, const infinint &sparse_file_min_size, const std::string &backup_hook_file_execute, const mask &backup_hook_file_mask, bool ignore_unknown, const fsa_scope &scope, const std::string &exclude_by_ea, bool delta_signature, const infinint &delta_sig_min_size, const mask &delta_mask, bool delta_diff, bool auto_zeroing_neg_dates, const std::set< std::string > &ignored_symlinks, modified_data_detection mod_data_detect, const delta_sig_block_size &delta_sig_block_len)
 
void libdar::filtre_difference (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, const catalogue &cat, const path &fs_racine, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics &st, const mask &ea_mask, bool alter_time, bool furtive_read_mode, comparison_fields what_to_check, const infinint &hourshift, bool compare_symlink_date, const fsa_scope &scope, bool isolated_mode)
 
void libdar::filtre_test (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, const catalogue &cat, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool empty, statistics &st)
 
void libdar::filtre_merge (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, const pile_descriptor &pdesc, catalogue &cat, const catalogue *ref1, const catalogue *ref2, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, statistics &st, bool make_empty_dir, const mask &ea_mask, const mask &compr_mask, const infinint &min_compr_size, bool keep_compressed, const crit_action &overwrite, bool warn_overwrite, bool decremental_mode, const infinint &sparse_file_min_size, const fsa_scope &scope, bool delta_signature, bool build_delta_sig, const infinint &delta_sig_min_size, const mask &delta_mask, const delta_sig_block_size &signature_block_size)
 
void libdar::filtre_merge_step0 (const std::shared_ptr< user_interaction > &dialog, const catalogue *ref1, const catalogue *ref2, statistics &st, bool decremental_mode, crit_action *&decr, const crit_action *&overwrite, bool &abort, thread_cancellation &thr_cancel)
 initialize variables used for merging in step1 and step2 More...
 
void libdar::filtre_merge_step1 (const std::shared_ptr< user_interaction > &dialog, const mask &filtre, const mask &subtree, catalogue &cat, const catalogue *ref1, const catalogue *ref2, bool info_details, bool display_treated, bool display_skipped, statistics &st, bool make_empty_dir, bool warn_overwrite, bool decremental_mode, crit_action *&decr, const crit_action *&overwrite, bool &abort, thread_cancellation &thr_cancel)
 builds a catalogue from two refs with the given policy and filters
 
void libdar::filtre_merge_step2 (const std::shared_ptr< user_interaction > &dialog, const pile_descriptor &pdesc, catalogue &cat, bool info_details, bool display_treated, bool display_treated_only_dir, const mask &compr_mask, const infinint &min_compr_size, bool keep_compressed, const infinint &sparse_file_min_size, bool delta_signature, bool build_delta_sig, const infinint &delta_sig_min_size, const mask &delta_mask, bool &abort, thread_cancellation &thr_cancel, bool repair_mode, const delta_sig_block_size &signature_block_size)
 copies data of "cat" catalogue to the pdesc of a brand new archive More...
 
void libdar::filtre_sequentially_read_all_catalogue (catalogue &cat, const std::shared_ptr< user_interaction > &dialog, bool lax_read_mode)
 
const char * libdar::generic_file_get_name (gf_mode mode)
 provides a human readable string defining the gf_mode given in argument
 
 libdar::header_flags::header_flags (generic_file &f)
 
 libdar::header_flags::header_flags (const header_flags &ref)=default
 
 libdar::header_flags::header_flags (header_flags &&ref) noexcept=default
 
header_flagslibdar::header_flags::operator= (const header_flags &ref)=default
 
header_flagslibdar::header_flags::operator= (header_flags &&ref) noexcept=default
 
void libdar::header_flags::set_bits (U_I bitfield)
 add all the bits set to 1 in the argument
 
void libdar::header_flags::unset_bits (U_I bitfield)
 remove all the bits set to in in the argument
 
bool libdar::header_flags::is_set (U_I bitfield) const
 return true if all bits of the argument set to 1, are set in this header_flags
 
void libdar::header_flags::read (generic_file &f)
 set the header_flags from a generic_file
 
void libdar::header_flags::dump (generic_file &f) const
 dump the header_flags to generic_file
 
void libdar::header_flags::clear ()
 clear all flags
 
bool libdar::header_flags::is_all_cleared ()
 whether all bits are cleared
 
static bool libdar::header_flags::has_an_lsb_set (U_I bitfield)
 
 libdar::header_version::header_version (const header_version &ref)
 
 libdar::header_version::header_version (header_version &&ref) noexcept
 
header_versionlibdar::header_version::operator= (const header_version &ref)
 
header_versionlibdar::header_version::operator= (header_version &&ref) noexcept
 
void libdar::header_version::read (generic_file &f, user_interaction &dialog, bool lax_mode)
 read the header or trailer from the archive
 
void libdar::header_version::write (generic_file &f) const
 write down the object to the archive (as header if wrote at the beginning of the archive, as trailer is at the end)
 
void libdar::header_version::set_edition (const archive_version &ed)
 
void libdar::header_version::set_compression_algo (const compression &zip)
 
void libdar::header_version::set_command_line (const std::string &line)
 
void libdar::header_version::set_initial_offset (const infinint &offset)
 
void libdar::header_version::set_sym_crypto_algo (const crypto_algo &algo)
 
void libdar::header_version::set_crypted_key (memory_file *key)
 the object pointed to by key passes to the responsibility of this header_version object
 
void libdar::header_version::clear_crypted_key ()
 
void libdar::header_version::set_slice_layout (slice_layout *layout)
 the object pointed to by layout is passed under the responsibility of this header_version object
 
void libdar::header_version::clear_slice_layout ()
 
void libdar::header_version::set_tape_marks (bool presence)
 
void libdar::header_version::set_signed (bool is_signed)
 
void libdar::header_version::set_salt (const std::string &arg)
 
void libdar::header_version::set_iteration_count (const infinint &arg)
 
void libdar::header_version::set_kdf_hash (hash_algo algo)
 
void libdar::header_version::set_compression_block_size (const infinint &bs)
 
const archive_versionlibdar::header_version::get_edition () const
 
compression libdar::header_version::get_compression_algo () const
 
const std::string & libdar::header_version::get_command_line () const
 
const infinintlibdar::header_version::get_initial_offset () const
 
bool libdar::header_version::is_ciphered () const
 
bool libdar::header_version::is_signed () const
 
crypto_algo libdar::header_version::get_sym_crypto_algo () const
 
std::string libdar::header_version::get_sym_crypto_name () const
 
std::string libdar::header_version::get_asym_crypto_name () const
 
memory_filelibdar::header_version::get_crypted_key () const
 
const slice_layout * libdar::header_version::get_slice_layout () const
 
bool libdar::header_version::get_tape_marks () const
 
const std::string & libdar::header_version::get_salt () const
 
const infinintlibdar::header_version::get_iteration_count () const
 
hash_algo libdar::header_version::get_kdf_hash () const
 
const infinintlibdar::header_version::get_compression_block_size () const
 
void libdar::header_version::display (user_interaction &dialg) const
 
void libdar::header_version::clear ()
 
void libdar::header_version::nullifyptr () noexcept
 
void libdar::header_version::copy_from (const header_version &ref)
 
void libdar::header_version::move_from (header_version &&ref) noexcept
 
void libdar::header_version::detruit ()
 
void libdar::int_tools_swap_bytes (unsigned char &a, unsigned char &b)
 
void libdar::int_tools_swap_bytes (unsigned char *a, U_I size)
 
void libdar::int_tools_expand_byte (unsigned char a, int_tools_bitfield &bit)
 
void libdar::int_tools_contract_byte (const int_tools_bitfield &b, unsigned char &a)
 
template<class T >
libdar::int_tools_rotate_right_one_bit (T v)
 
template<class T >
libdar::int_tools_maxof_aggregate (T unused)
 
trivial_sarlibdar::macro_tools_open_archive_tuyau (const std::shared_ptr< user_interaction > &dialog, S_I fd, gf_mode mode, const label &internal_name, const label &data_name, bool slice_header_format_07, const std::string &execute)
 create an container to write an archive to a pipe
 
void libdar::macro_tools_open_archive (const std::shared_ptr< user_interaction > &dialog, const std::shared_ptr< entrepot > &where, const std::string &basename, const infinint &min_digits, const std::string &extension, crypto_algo crypto, const secu_string &pass, U_32 crypto_size, pile &stack, header_version &ver, const std::string &input_pipe, const std::string &output_pipe, const std::string &execute, infinint &second_terminateur_offset, bool lax, bool has_external_cat, bool sequential_read, bool info_details, std::list< signator > &gnupg_signed, slice_layout &sl, U_I multi_threaded_crypto, U_I multi_threaded_compress, bool header_only)
 setup the given pile object to contain a stack of generic_files suitable to read an archive More...
 
cataloguelibdar::macro_tools_get_derivated_catalogue_from (const std::shared_ptr< user_interaction > &dialog, pile &data_stack, pile &cata_stack, const header_version &ver, bool info_details, infinint &cat_size, const infinint &second_terminateur_offset, std::list< signator > &signatories, bool lax_mode)
 uses terminator to skip to the position where to find the catalogue and read it, taking care of having this catalogue pointing to the real data (context of isolated catalogue — cata_stack — used to rescue an internal archive — data_stack)
 
cataloguelibdar::macro_tools_get_catalogue_from (const std::shared_ptr< user_interaction > &dialog, pile &stack, const header_version &ver, bool info_details, infinint &cat_size, const infinint &second_terminateur_offset, std::list< signator > &signatories, bool lax_mode)
 uses terminator to skip to the position where to find the catalogue and read it
 
cataloguelibdar::macro_tools_read_catalogue (const std::shared_ptr< user_interaction > &dialog, const header_version &ver, const pile_descriptor &cata_pdesc, const infinint &cat_size, std::list< signator > &signatories, bool lax_mode, const label &lax_layer1_data_name, bool only_detruits)
 read the catalogue from cata_stack assuming the cata_stack is positionned at the beginning of the area containing archive's dumped data
 
cataloguelibdar::macro_tools_lax_search_catalogue (const std::shared_ptr< user_interaction > &dialog, pile &stack, const archive_version &edition, compression compr_algo, bool info_details, bool even_partial_catalogues, const label &layer1_data_name)
 
infinint libdar::macro_tools_get_terminator_start (generic_file &f, const archive_version &reading_ver)
 
void libdar::macro_tools_create_layers (const std::shared_ptr< user_interaction > &dialog, pile &layers, header_version &ver, slice_layout &slicing, const slice_layout *ref_slicing, const std::shared_ptr< entrepot > &sauv_path_t, const std::string &filename, const std::string &extension, bool allow_over, bool warn_over, bool info_details, const infinint &pause, compression algo, U_I compression_level, U_I compression_block_size, const infinint &file_size, const infinint &first_file_size, const std::string &execute, crypto_algo crypto, const secu_string &pass, U_32 crypto_size, const std::vector< std::string > &gnupg_recipients, const std::vector< std::string > &gnupg_signatories, bool empty, const std::string &slice_permission, bool add_marks_for_sequential_reading, const std::string &user_comment, hash_algo hash, const infinint &slice_min_digits, const label &internal_name, const label &data_name, const infinint &iteration_count, hash_algo kdf_hash, U_I multi_threaded_crypto, U_I multi_threaded_compress)
 build layers for a new archive More...
 
void libdar::macro_tools_close_layers (const std::shared_ptr< user_interaction > &dialog, pile &layers, const header_version &ver, const catalogue &cat, bool info_details, crypto_algo crypto, compression algo, const std::vector< std::string > &gnupg_recipients, const std::vector< std::string > &gnupg_signatories, bool empty)
 dumps the catalogue and close all the archive layers to terminate the archive More...
 
range libdar::macro_tools_get_slices (const cat_nomme *obj, slice_layout sl)
 gives the location of data EA and FSA (when they are saved) of the object given in argument More...
 
void libdar::macro_tools_open_pipes (const std::shared_ptr< user_interaction > &dialog, const std::string &input, const std::string &output, tuyau *&in, tuyau *&out)
 open a pair of tuyau objects encapsulating two named pipes. More...
 
proto_compressor * libdar::macro_tools_build_streaming_compressor (compression algo, generic_file &base, U_I compression_level, U_I num_workers)
 return a proto_compressor object realizing the desired (de)compression level/aglo on top of "base" in streaming mode More...
 
proto_compressor * libdar::macro_tools_build_block_compressor (compression algo, generic_file &base, U_I compression_level, U_I num_workers, U_I block_size)
 return a proto_compressor object realizing the desired (de)compression level/algo on to of "base" in block mode More...
 
over_action_ea libdar::op_tools_crit_ask_user_for_EA_action (user_interaction &dialog, const std::string &full_name, const cat_entree *already_here, const cat_entree *dolly)
 ask user for EA action More...
 
over_action_ea libdar::op_tools_crit_ask_user_for_FSA_action (user_interaction &dialog, const std::string &full_name, const cat_entree *already_here, const cat_entree *dolly)
 ask user for FSA action More...
 
over_action_data libdar::op_tools_crit_ask_user_for_data_action (user_interaction &dialog, const std::string &full_name, const cat_entree *already_here, const cat_entree *dolly)
 ask user for Data action More...
 
void libdar::op_tools_crit_show_entry_info (user_interaction &dialog, const std::string &full_name, const cat_entree *already_here, const cat_entree *dolly)
 show information suited for user comparison and decision for entry in conflict More...
 
std::string libdar::sar_tools_make_filename (const std::string &base_name, const infinint &num, const infinint &min_digits, const std::string &ext)
 
bool libdar::sar_tools_extract_num (const std::string &filename, const std::string &base_name, const infinint &min_digits, const std::string &ext, infinint &ret)
 
bool libdar::sar_tools_get_higher_number_in_dir (user_interaction &ui, entrepot &entr, const std::string &base_name, const infinint &min_digits, const std::string &ext, infinint &ret)
 
void libdar::sar_tools_remove_higher_slices_than (entrepot &entr, const std::string &base_name, const infinint &min_digits, const std::string &ext, const infinint &higher_slice_num_to_keep, user_interaction &ui)
 
std::string libdar::sar_tools_make_padded_number (const std::string &num, const infinint &min_digits)
 
void libdar::tools_init ()
 libdar internal use only: it is launched from get_version() and initializes tools internal variables
 
void libdar::tools_end ()
 libdar internal use only: it is launched from close_and_clean() and releases tools internal variables
 
void libdar::tools_write_string (generic_file &f, const std::string &s)
 write a string to a file with a '\0' at then end More...
 
void libdar::tools_read_string (generic_file &f, std::string &s)
 read a string from a file expecting it to terminate by '\0' More...
 
void libdar::tools_write_string_all (generic_file &f, const std::string &s)
 write a string to a file, '\0' has no special meaning nor is added at the end More...
 
void libdar::tools_read_string_size (generic_file &f, std::string &s, infinint taille)
 read a string if given size from a file '\0' has no special meaning More...
 
infinint libdar::tools_get_filesize (const path &p)
 retrieve the size in byte of a file More...
 
std::string libdar::tools_display_integer_in_metric_system (infinint number, const std::string &unit, bool binary)
 
std::string::iterator libdar::tools_find_last_char_of (std::string &s, unsigned char v)
 give a pointer to the last character of the given value in the given string More...
 
void libdar::tools_blocking_read (int fd, bool mode)
 set blocking/not blocking mode for reading on a file descriptor More...
 
std::string libdar::tools_name_of_uid (const infinint &uid)
 convert uid to name in regards to the current system's configuration More...
 
std::string libdar::tools_name_of_gid (const infinint &gid)
 convert gid to name in regards of the current system's configuration More...
 
std::string libdar::tools_uword2str (U_16 x)
 convert unsigned word to string More...
 
std::string libdar::tools_int2str (S_I x)
 convert integer to string More...
 
std::string libdar::tools_uint2str (U_I x)
 
std::string libdar::tools_addspacebefore (std::string s, U_I expected_size)
 prepend spaces before the given string More...
 
std::string libdar::tools_display_date (const datetime &date)
 convert a date in second to its human readable representation More...
 
char * libdar::tools_str2charptr (const std::string &x)
 convert a string to a char * More...
 
U_I libdar::tools_str2int (const std::string &x)
 convert an integer written in decimal notation to the corresponding value More...
 
void libdar::tools_system (user_interaction &dialog, const std::vector< std::string > &argvector)
 wrapper to the "system" system call. More...
 
void libdar::tools_system_with_pipe (const std::shared_ptr< user_interaction > &dialog, const std::string &dar_cmd, const std::vector< std::string > &argvpipe)
 wrapper to the "system" system call using anonymous pipe to tranmit arguments to the child process More...
 
void libdar::tools_write_vector (generic_file &f, const std::vector< std::string > &x)
 write a list of string to file More...
 
void libdar::tools_read_vector (generic_file &f, std::vector< std::string > &x)
 read a list of string from a file More...
 
std::string libdar::tools_concat_vector (const std::string &separator, const std::vector< std::string > &x)
 concatenate a vectors of strings in a single string More...
 
std::vector< std::string > libdar::operator+ (std::vector< std::string > a, std::vector< std::string > b)
 concatenate two vectors More...
 
bool libdar::tools_is_equal_with_hourshift (const infinint &hourshift, const datetime &date1, const datetime &date2)
 test if two dates are equal taking care of a integer hour of difference More...
 
template<class T >
std::vector< T > libdar::operator+= (std::vector< T > &a, const std::vector< T > &b)
 template function to add two vectors
 
std::string libdar::tools_readlink (const char *root)
 returns the file pointed to by a symbolic link (or transparent if the file is not a symlink). More...
 
void libdar::tools_noexcept_make_date (const std::string &chem, bool symlink, const datetime &last_acc, const datetime &last_mod, const datetime &birth)
 set dates of a given file, no exception thrown More...
 
void libdar::tools_make_date (const std::string &chemin, bool symlink, const datetime &access, const datetime &modif, const datetime &birth)
 set dates of a given file, may throw exception More...
 
bool libdar::tools_is_case_insensitive_equal (const std::string &a, const std::string &b)
 compare two string in case insensitive manner More...
 
void libdar::tools_to_upper (const std::string &r, std::string &uppered)
 convert a string to upper case More...
 
std::string libdar::tools_printf (const char *format,...)
 make printf-like formating to a std::string More...
 
std::string libdar::tools_vprintf (const char *format, va_list ap)
 make printf-like formating to a std::string More...
 
bool libdar::tools_do_some_files_match_mask_regex (const entrepot &ent, const std::string &file_mask)
 test the presence of files corresponding to a given mask in a directory (regex mask) More...
 
void libdar::tools_unlink_file_mask_regex (user_interaction &dialog, const entrepot &ent, const std::string &file_mask, bool info_details)
 remove files from a given directory More...
 
void libdar::tools_avoid_slice_overwriting_regex (user_interaction &dialog, const entrepot &ent, const std::string &basename, const std::string &extension, bool info_details, bool allow_overwriting, bool warn_overwriting, bool dry_run)
 prevents slice overwriting: check the presence of slice and if necessary ask the user if they can be removed More...
 
bool libdar::tools_are_on_same_filesystem (const std::string &file1, const std::string &file2)
 tells whether two files are on the same mounted filesystem More...
 
path libdar::tools_relative2absolute_path (const path &src, const path &cwd)
 transform a relative path to an absolute one given the current directory value More...
 
void libdar::tools_block_all_signals (sigset_t &old_mask)
 block all signals (based on POSIX sigprocmask) More...
 
void libdar::tools_set_back_blocked_signals (sigset_t old_mask)
 unblock signals according to given mask More...
 
U_I libdar::tools_count_in_string (const std::string &s, const char a)
 counts the number of a given char in a given string More...
 
datetime libdar::tools_get_mtime (user_interaction &dialog, const std::string &s, bool auto_zeroing, bool silent, const std::set< std::string > &ignored_as_symlink=std::set< std::string >())
 returns the last modification date of the given file More...
 
infinint libdar::tools_get_size (const std::string &s)
 returns the size of the given plain file More...
 
infinint libdar::tools_get_extended_size (std::string s, U_I base)
 convert the given string to infinint taking care of multiplication suffixes like k, M, T, etc. More...
 
std::string libdar::tools_substitute (const std::string &hook, const std::map< char, std::string > &corres)
 produce the string resulting from the substition of % macro defined in the map More...
 
std::string libdar::tools_hook_substitute (const std::string &hook, const std::string &path, const std::string &basename, const std::string &num, const std::string &padded_num, const std::string &ext, const std::string &context, const std::string &base_url)
 produces the string resulting from the substitution of %... macro More...
 
void libdar::tools_hook_execute (user_interaction &ui, const std::string &cmd_line)
 execute and retries at user will a given command line More...
 
void libdar::tools_hook_substitute_and_execute (user_interaction &ui, const std::string &hook, const std::string &path, const std::string &basename, const std::string &num, const std::string &padded_num, const std::string &ext, const std::string &context, const std::string &base_url)
 subsititue and execute command line More...
 
std::string libdar::tools_output2xml (const std::string &src)
 convert string for xml output More...
 
U_I libdar::tools_octal2int (const std::string &perm)
 convert octal string to integer More...
 
std::string libdar::tools_int2octal (const U_I &perm)
 convert a number to a string corresponding to its octal representation More...
 
char libdar::tools_cast_type_to_unix_type (char type)
 change the libdar internal type representation to the usual unix char type
 
std::string libdar::tools_get_permission_string (char type, U_32 perm, bool hard)
 convert a permission number into its string representation (rwxrwxrwx)
 
void libdar::tools_set_permission (S_I fd, U_I perm)
 change the permission of the file which descriptor is given More...
 
U_I libdar::tools_get_permission (S_I fd)
 obtain the permission of the file which descriptor is given More...
 
uid_t libdar::tools_ownership2uid (const std::string &user)
 change ownership of the file which descriptor is given More...
 
uid_t libdar::tools_ownership2gid (const std::string &group)
 convert string group name or gid to numeric gid value More...
 
void libdar::tools_set_ownership (S_I filedesc, const std::string &slice_user, const std::string &slice_group)
 change ownership of the file which descriptor is given More...
 
void libdar::tools_memxor (void *dest, const void *src, U_I n)
 Produces in "dest" the XORed value of "dest" and "src". More...
 
tlv_list libdar::tools_string2tlv_list (user_interaction &dialog, const U_16 &type, const std::vector< std::string > &data)
 Produces a list of TLV from a constant type and a list of string. More...
 
U_I libdar::tools_pseudo_random (U_I max)
 Produces a pseudo random number x, where 0 <= x < max. More...
 
template<class N , class B >
std::deque< B > libdar::tools_number_base_decomposition_in_big_endian (N number, const B &base)
 Template for the decomposition of any number in any base (decimal, octal, hexa, etc.) More...
 
std::string libdar::tools_unsigned_char_to_hexa (unsigned char x)
 convert a unsigned char into its hexa decima representation More...
 
std::string libdar::tools_string_to_hexa (const std::string &input)
 convert a string into its hexadecima representation More...
 
infinint libdar::tools_file_size_to_crc_size (const infinint &size)
 Defines the CRC size to use for a given filesize. More...
 
std::string libdar::tools_getcwd ()
 get current working directory
 
std::string libdar::tools_get_compression_ratio (const infinint &storage_size, const infinint &file_size, bool compressed)
 return the string about compression ratio
 
std::string libdar::tools_strerror_r (int errnum)
 wrapper routine to strerror_r
 
void libdar::tools_secu_string_show (user_interaction &dialog, const std::string &msg, const secu_string &key)
 display the content of a secu_string, this function is only for trouble shooting!
 
template<class T >
libdar::tools_max (T a, T b)
 
template<class T >
libdar::tools_min (T a, T b)
 
void libdar::tools_unlink (const std::string &filename)
 remove from filesystem the file which path is given
 
std::string libdar::tools_escape_chars_in_string (const std::string &val, const char *to_escape)
 escape with a anti-slash character a set of chars found in the given string
 
bool libdar::tools_infinint2U_64 (infinint val, U_64 &res)
 convert an infinint to U_64 (aka "uint64_t" or yet "unsigned long long") More...
 
bool libdar::tools_my_atoi (const char *a, U_I &val)
 ascii to integer conversion More...
 
infinint libdar::tools_double2infinint (double arg)
 convert a double (float) to infinint (integer) taking care of rounding it to the closest value
 
template<class T >
void libdar::tools_check_negative_date (T &val, user_interaction &ui, const char *inode_path, const char *nature, bool ask_before, bool silent)
 check the value is not negative, and if asked set it to zero More...
 
infinint libdar::tools_upper_rounded_log2 (const infinint &ref)
 compute an approximate log2 of the argument
 
infinint libdar::tools_lower_rounded_exp2 (const infinint &ref)
 compute an approximate exp2 of the argument
 
infinint libdar::tools_rounded_square_root (const infinint &ref)
 compute an approximate square root of the argument
 
infinint libdar::tools_rounded_cube_root (const infinint &ref)
 compute an approximate cube root of the argument
 
std::string libdar::sar_make_filename (const std::string &base_name, const infinint &num, const infinint &min_digits, const std::string &ext)
 return the name of a slice given the base_name, slice number and extension
 
std::unique_ptr< T > libdar::heap< T >::get ()
 
void libdar::heap< T >::put (std::unique_ptr< T > &&obj)
 
void libdar::heap< T >::put (std::deque< std::unique_ptr< T > > &list)
 
template<class T >
bool libdar::pile::pop_and_close_if_type_is (T *ptr)
 remove the top generic_file and destroy it More...
 
template<class T >
void libdar::pile::find_first_from_top (T *&ref) const
 this template let the class user find out the higher object on the stack of the given type More...
 
template<class T >
void libdar::pile::find_first_from_bottom (T *&ref) const
 this template is similar to the template "find_first_from_top" except that the search is started from the bottom of the stack
 
void libdar::storage::iterator::skip_plus_one ()
 
void libdar::storage::iterator::skip_less_one ()
 

Variables

const U_32 libdar::SAUV_MAGIC_NUMBER = 123
 
U_I libdar::header_flags::bits
 future implementation could rely on infinint for a arbitrary large bitfield
 
archive_version libdar::header_version::edition
 archive format
 
compression libdar::header_version::algo_zip
 compression algorithm used
 
std::string libdar::header_version::cmd_line
 used long ago to store cmd_line, then abandonned, then recycled as a user comment field
 
infinint libdar::header_version::initial_offset
 defines at which offset starts the archive (passed the archive header), this field is obiously only used in the trailer not in the header
 
crypto_algo libdar::header_version::sym
 strong encryption algorithm used for symmetrical encryption
 
memory_filelibdar::header_version::crypted_key
 optional field containing the asymmetrically ciphered key used for strong encryption ciphering
 
slice_layout * libdar::header_version::ref_layout
 optional field used in isolated catalogues to record the slicing layout of their archive of reference
 
bool libdar::header_version::has_tape_marks
 whether the archive contains tape marks aka escape marks aka sequence marks
 
bool libdar::header_version::ciphered
 whether the archive is ciphered, even if we do not know its crypto algorithm (old archives)
 
bool libdar::header_version::arch_signed
 whether the archive is signed
 
bool libdar::header_version::has_kdf_params
 has salt/ineration/kdf_hash fields valid
 
std::string libdar::header_version::salt
 used for key derivation
 
infinint libdar::header_version::iteration_count
 used for key derivation
 
hash_algo libdar::header_version::kdf_hash
 used for key derivation
 
infinint libdar::header_version::compr_bs
 the compression block size (0 for legacy compression mode)
 
static constexpr U_I libdar::header_version::PRE_FORMAT_10_ITERATION = 2000
 fixed value used for key derivation before archive format 10
 
const label libdar::label_zero
 
constexpr U_I libdar::GLOBAL_ELASTIC_BUFFER_SIZE = 51200
 
const archive_version libdar::macro_tools_supported_version
 
const std::string libdar::LIBDAR_STACK_LABEL_UNCOMPRESSED
 
const std::string libdar::LIBDAR_STACK_LABEL_CLEAR
 
const std::string libdar::LIBDAR_STACK_LABEL_UNCYPHERED
 
const std::string libdar::LIBDAR_STACK_LABEL_LEVEL1
 
constexpr const U_I libdar::default_uncompressed_block_size = 102400
 
constexpr const U_I libdar::min_uncompressed_block_size = 100
 
const int libdar::WR_OK = 0
 
const int libdar::WR_MEM_ERROR = 1
 
const int libdar::WR_VERSION_ERROR = 2
 
const int libdar::WR_STREAM_ERROR = 3
 
const int libdar::WR_DATA_ERROR = 4
 
const int libdar::WR_NO_FLUSH = 5
 
const int libdar::WR_BUF_ERROR = 6
 
const int libdar::WR_STREAM_END = 7
 
const int libdar::WR_FINISH = 8
 
constexpr unsigned char libdar::ANSWER_TYPE_DATA = 'D'
 
constexpr unsigned char libdar::ANSWER_TYPE_INFININT = 'I'
 
constexpr U_I libdar::REQUEST_SIZE_SPECIAL_ORDER = 0
 
constexpr U_I libdar::REQUEST_OFFSET_END_TRANSMIT = 0
 
constexpr U_I libdar::REQUEST_OFFSET_GET_FILESIZE = 1
 
constexpr U_I libdar::REQUEST_OFFSET_CHANGE_CONTEXT_STATUS = 2
 
constexpr U_I libdar::REQUEST_IS_OLD_START_END_ARCHIVE = 3
 
constexpr U_I libdar::REQUEST_GET_DATA_NAME = 4
 
constexpr U_I libdar::REQUEST_FIRST_SLICE_HEADER_SIZE = 5
 
constexpr U_I libdar::REQUEST_OTHER_SLICE_HEADER_SIZE = 6
 

Detailed Description

Libdar internal symbols.

Understanding this is not necessary to use libdar through the API. This is libdar internal code documentation

Typedef Documentation

◆ trailing_clear_data_callback

typedef infinint(* libdar::trailing_clear_data_callback) (generic_file &below, const archive_version &reading_ver)

the trailing_clear_data_callback call back is a mean by which the upper layer cat tell when encrypted data ends

Parameters
[in]belowis the generic_file containing the encrypted data that the proto_tronco inherited class is willing to decipher.
[in]reading_veris the archive format version of the archive under operation
Returns
the callback returns the offset of the first non encrypted data at the end of the provided generic_file.
Note
this method should be invoked when decryption failed at or near end of file.
the libdar archive format is ended by a clear trailier which is expected to be read backward, by the end of the archive. The last part of this trailer (see terminateur class) records the offset of the beginning of this trailier (which are all clear clear), it is thus possible outside of the encrypted layer to tail the clear data from the encrypted one and avoid trying to decipher data that is not encrypted. This is the reason of existence for this callback.

Definition at line 58 of file proto_tronco.hpp.

Enumeration Type Documentation

◆ capa_status

the EFFECTIVE set the value of the associated capability for the calling thread

returned by the capability_* routines

Enumerator
capa_set 

current thread has the requested capability

capa_clear 

current thread has not the requested capability

Definition at line 41 of file capabilities.hpp.

◆ ea_saved_status

EA saved status for an entry.

Enumerator
none 

no EA present for this inode in filesystem

partial 

EA present in filesystem but not stored (ctime used to check changes)

fake 

EA present in filesystem but not attached to this inode (isolation context) no more used in archive version "08" and above, ea_partial or ea_full stays a valid status in isolated catalogue because pointers to EA and data are no more removed during isolation process.

full 

EA present in filesystem and attached to this inode.

removed 

EA were present in the reference version, but not present anymore.

Definition at line 55 of file cat_status.hpp.

◆ fsa_saved_status

FSA saved status for an entry.

there is not "remove status for FSA, either the cat_inode contains full copy of FSA or only remembers the families of FSA found in the unchanged cat_inode FSA none is used when the file has no FSA because:

  • either the underlying filesystem has no known FSA
  • or the underlying filesystem FSA support has not been activated at compilation time
  • or the fsa_scope requested at execution time exclude the filesystem FSA families available here
Enumerator
none 

no FSA saved

partial 

FSA unchanged, not fully stored.

full 

FSA saved.

Definition at line 73 of file cat_status.hpp.

◆ gf_mode

generic_file openning modes

Enumerator
gf_read_only 

read only access

gf_write_only 

write only access

gf_read_write 

read and write access

Definition at line 43 of file gf_mode.hpp.

◆ saved_status

enum libdar::saved_status
strong

data saved status for an entry

Enumerator
saved 

inode is saved in the archive

inode_only 

data is not saved but inode meta data has changed since the archive of reference

fake 

inode is not saved in the archive but is in the archive of reference (isolation context) s_fake is no more used in archive format "08" and above: isolated catalogue do keep the data pointers and s_saved stays a valid status in isolated catalogues.

not_saved 

inode is not saved in the archive

delta 

inode is saved but as delta binary from the content (delta signature) of what was found in the archive of reference

Definition at line 44 of file cat_status.hpp.

Function Documentation

◆ database_header_create()

generic_file* libdar::database_header_create ( const std::shared_ptr< user_interaction > &  dialog,
const std::string &  filename,
bool  overwrite,
compression  algozip,
U_I  compr_level 
)

create the header for a dar_manager database

Parameters
[in]dialogis used for user interaction
[in]filenameis the file's name to create/overwrite
[in]overwriteset to true to allow file overwriting (else generates an error if file exists)
[in]algozipcompression algorithm used for the database
[in]compr_levelcompression level
Returns
the database header has been read and checked the database can now be read from the returned generic_file pointed by the returned value then it must be destroyed with the delete operator.

◆ database_header_open()

generic_file* libdar::database_header_open ( const std::shared_ptr< user_interaction > &  dialog,
const std::string &  filename,
unsigned char &  db_version,
compression algozip,
U_I &  compr_level 
)

read the header of a dar_manager database

Parameters
[in]dialogfor user interaction
[in]filenameis the filename to read from
[out]db_versionversion of the database
[out]algozipcompression algorithm used in the database
[out]compr_levelcompression level used in the database
Returns
the generic_file where the database header has been put

◆ ea_filesystem_clear_ea()

void libdar::ea_filesystem_clear_ea ( const std::string &  name,
const mask filter 
)

remove all EA of a given file that match a given mask

Parameters
[in]nameis the filename which EA must be altered
[in]filteris a mask that defines which EA names have to be removed
Note
unless the given mask is logically equivalent to bool_mask(true) some EA may remain associated to the file after the operation.

◆ ea_filesystem_has_ea() [1/2]

bool libdar::ea_filesystem_has_ea ( const std::string &  name)

test the presence of EA for a given file

Parameters
[in]nameis the filename which EA presence must be check against
Returns
true if at least one EA has been found

◆ ea_filesystem_has_ea() [2/2]

bool libdar::ea_filesystem_has_ea ( const std::string &  name,
const mask filter 
)

test the presence of EA for a given file

Parameters
[in]nameis the filename which EA presence must be check against
[in]filteris a mask that defines which attributes names to only consider
Returns
true if at least one EA has been found

◆ ea_filesystem_read_ea()

ea_attributs* libdar::ea_filesystem_read_ea ( const std::string &  chemin,
const mask filter 
)

read EA associated to a given file

Parameters
[in]cheminis the path to the file to read attributes of
[in]filteris a mask that defines which attributes names have to be considered only
Returns
nullptr if no EA have been found under the specified mask, or returns a newly allocated object that the caller has the responsibility to delete when no more needed

◆ ea_filesystem_write_ea()

bool libdar::ea_filesystem_write_ea ( const std::string &  chemin,
const ea_attributs val,
const mask filter 
)

overwrite some attribute to a given file's attribute list

Parameters
[in]cheminis the path of the file to write attribute to
[in]valis a list of attribute amoung which a subset will be added to file's attribute list
[in]filtera mask that define which attribute's names will be written and which will be ignored from the given list
Returns
true if some attribute could be set
Note
if an EA is already present, it is not modified unless the mask covers its name and a value is available for that attribute name in the given list.

◆ filesystem_tools_create_non_existing_file_based_on()

fichier_local* libdar::filesystem_tools_create_non_existing_file_based_on ( const std::shared_ptr< user_interaction > &  dialog,
std::string  filename,
path  where,
std::string &  new_filename 
)

create in dirname a brand-new filename which name derives from filename

Returns
a read-write object the caller has the duty to destroy, exception thrown if no filename could be created

◆ filesystem_tools_read_linux_birthtime()

bool libdar::filesystem_tools_read_linux_birthtime ( const std::string &  target,
datetime val 
)

read the birthtime of target inode

Parameters
[in]targetthe path the the inode to read the birthtime of
[out]valthe birthtime (only valid if the call returned true)
Returns
true if the birthtime could be read with linux specific systemcall

◆ filtre_merge_step0()

void libdar::filtre_merge_step0 ( const std::shared_ptr< user_interaction > &  dialog,
const catalogue ref1,
const catalogue ref2,
statistics st,
bool  decremental_mode,
crit_action *&  decr,
const crit_action *&  overwrite,
bool &  abort,
thread_cancellation thr_cancel 
)

initialize variables used for merging in step1 and step2

Note
also used for repairing

◆ filtre_merge_step2()

void libdar::filtre_merge_step2 ( const std::shared_ptr< user_interaction > &  dialog,
const pile_descriptor &  pdesc,
catalogue cat,
bool  info_details,
bool  display_treated,
bool  display_treated_only_dir,
const mask compr_mask,
const infinint min_compr_size,
bool  keep_compressed,
const infinint sparse_file_min_size,
bool  delta_signature,
bool  build_delta_sig,
const infinint delta_sig_min_size,
const mask delta_mask,
bool &  abort,
thread_cancellation thr_cancel,
bool  repair_mode,
const delta_sig_block_size signature_block_size 
)

copies data of "cat" catalogue to the pdesc of a brand new archive

Note
also used for repairing

◆ filtre_restore()

void libdar::filtre_restore ( const std::shared_ptr< user_interaction > &  dialog,
const mask filtre,
const mask subtree,
const catalogue cat,
const path fs_racine,
bool  fs_warn_overwrite,
bool  info_details,
bool  display_treated,
bool  display_treated_only_dir,
bool  display_skipped,
statistics st,
const mask ea_mask,
bool  flat,
comparison_fields  what_to_check,
bool  warn_remove_no_match,
bool  empty,
bool  empty_dir,
const crit_action x_overwrite,
archive_options_extract::t_dirty  dirty,
bool  only_deleted,
bool  not_deleted,
const fsa_scope scope,
bool  ignore_unix_sockets 
)
Parameters
dialogfor user interaction
filtrewhich filename to restore
subtreewhich directory and paths to restore
cattable of content to extract information from
fs_racineroot path under which to restore directiry tree and files
fs_warn_overwritewhether to warn before overwriting (to be replaced by overwriting policy)
info_detailswhether to display processing messages
display_treatedwhether to display treated files
display_treated_only_dirwhether to only display current directory of treated file
display_skippedwhether to display skipped files
ststatistics result about the operation
ea_maskdefines EA to restore/not restore
flatif true, directories are not restores, all files are placed directly at in fs_racine directory
what_to_checkwhich file properties to restore
warn_remove_no_matchwether to warn for file to remove not matching the expected type
emptydry-run execution
empty_dirwhether to restore directories that do contain any file to restore
x_overwritehow and whether to overwrite files
dirtywhether to restore dirty files
only_deletedwhether to only consider deleted files
not_deletedwether to consider deleted files
scopescope of FSA to take into account
ignore_unix_socketsdo not try to restore unix sockets

◆ find_first_from_top()

template<class T >
void libdar::pile::find_first_from_top ( T *&  ref) const

this template let the class user find out the higher object on the stack of the given type

Parameters
[in,out]refgives the type of the object to look for, and gets the address of the first object found starting from the top
Note
if no object of that type could be found in the stack ref is set to nullptr

Definition at line 204 of file pile.hpp.

◆ macro_tools_build_block_compressor()

proto_compressor* libdar::macro_tools_build_block_compressor ( compression  algo,
generic_file base,
U_I  compression_level,
U_I  num_workers,
U_I  block_size 
)

return a proto_compressor object realizing the desired (de)compression level/algo on to of "base" in block mode

Parameters
[in]algothe compression algorithm to use
[in,out]basethe layer to read from or write to compressed data
[in]compression_levelthe compression level to use (when compressing data)
[in]num_workersfor the few algorithm that allow multi-thread compression (lz4 actually)
[in]block_sizesize of the data block

◆ macro_tools_build_streaming_compressor()

proto_compressor* libdar::macro_tools_build_streaming_compressor ( compression  algo,
generic_file base,
U_I  compression_level,
U_I  num_workers 
)

return a proto_compressor object realizing the desired (de)compression level/aglo on top of "base" in streaming mode

Parameters
[in]algothe compression algorithm to use
[in,out]basethe layer to read from or write to compressed data
[in]compression_levelthe compression level to use (when compressing data)
[in]num_workersfor the few algorithm that allow multi-thread compression (lz4 actually)

◆ macro_tools_close_layers()

void libdar::macro_tools_close_layers ( const std::shared_ptr< user_interaction > &  dialog,
pile layers,
const header_version ver,
const catalogue cat,
bool  info_details,
crypto_algo  crypto,
compression  algo,
const std::vector< std::string > &  gnupg_recipients,
const std::vector< std::string > &  gnupg_signatories,
bool  empty 
)

dumps the catalogue and close all the archive layers to terminate the archive

Parameters
[in]dialogfor user interaction
[in]layersthe archive layers to close
[in]verthe archive "header" to be dropped at end of archive
[in]catthe catalogue to dump in the layer before closing the archive
[in]info_detailswhether to display detailed information
[in]cryptocipher algorithm used in "layers"
[in]gnupg_recipientsused sign the catalog, use an empty vector if there is no signatories (no nedd to sign the hash of the catalogue)
[in]gnupg_signatoriesused to sign the catalog, use an empty vector to disable signning
[in]algocompression algorithm used
[in]emptydry-run execution (null_file at bottom of the stack)

◆ macro_tools_create_layers()

void libdar::macro_tools_create_layers ( const std::shared_ptr< user_interaction > &  dialog,
pile layers,
header_version ver,
slice_layout &  slicing,
const slice_layout *  ref_slicing,
const std::shared_ptr< entrepot > &  sauv_path_t,
const std::string &  filename,
const std::string &  extension,
bool  allow_over,
bool  warn_over,
bool  info_details,
const infinint pause,
compression  algo,
U_I  compression_level,
U_I  compression_block_size,
const infinint file_size,
const infinint first_file_size,
const std::string &  execute,
crypto_algo  crypto,
const secu_string pass,
U_32  crypto_size,
const std::vector< std::string > &  gnupg_recipients,
const std::vector< std::string > &  gnupg_signatories,
bool  empty,
const std::string &  slice_permission,
bool  add_marks_for_sequential_reading,
const std::string &  user_comment,
hash_algo  hash,
const infinint slice_min_digits,
const label internal_name,
const label data_name,
const infinint iteration_count,
hash_algo  kdf_hash,
U_I  multi_threaded_crypto,
U_I  multi_threaded_compress 
)

build layers for a new archive

Parameters
[in]dialogfor user interaction
[out]layersthe resulting stack of generic_file layers ready for use
[out]verthe archive "header/trailer" to be dropped at beginning and end of archive
[out]slicingslicing layout of the created archive (resulting from sar layers if present according to the provided first/file_size provided below)
[in]ref_slicingif not nullptr the pointed to slicing_layout will be stored in the header/trailer version of the archive
[in]sauv_path_twhere to create the archive
[in]filenamearchive base name
[in]extensionarchive extension
[in]allow_overwhether to allow slice overwriting
[in]warn_overwhether to warn before overwriting
[in]info_detailswhether to display detailed information
[in]pausehow many slices to wait before pausing (0 to never wait)
[in]algocompression algorithm
[in]compression_levelcompression level
[in]compression_block_sizeif set to zero use streaming compression else use block compression of the given size
[in]file_sizesize of the slices
[in]first_file_sizesize of the first slice
[in]executecommand to execute after each slice creation
[in]cryptocipher algorithm to use
[in]passpassword/passphrase to use for encryption
[in]crypto_sizesize of crypto blocks
[in]gnupg_recipientslist of email recipients'public keys to encrypt a randomly chosen key with
[in]gnupg_signatorieslist of email which associated signature has to be used to sign the archive
[in]emptydry-run execution (null_file at bottom of the stack)
[in]slice_permissionpermission to set the slices to
[in]add_marks_for_sequential_readingwhether to add an escape layer in the stack
[in]user_commentuser comment to add into the slice header/trailer
[in]hashalgorithm to use for slices hashing
[in]slice_min_digitsminimum number of digits slice number must have
[in]internal_namecommon label to all slices
[in]data_nameto use in slice header
[in]iteration_countused for key derivation when passphrase is human provided
[in]kdf_hashhash algorithm used for the key derivation function
[in]multi_threaded_cryptonumber of worker threads to handle cryptography stuff
[in]multi_threaded_compressnumber of worker threads to handle compression (block mode only)
Note
the stack has the following contents depending on given options

+-top LIBDAR_STACK_LABEL_ +------------------------------------------------------—+------------------—+ | compressor | | +------------------------------------------------------—+------------------—+ | [ escape ] | | +– - - - - - - - - - - - - - - - - - - - - - - - - - - - +------------------—+ | cache | (paralle_)tronconneuse | scrambler | | | [ cache ] |_CACHE_PIPE | | trivial_sar | null_file | sar | | +------------------------------------------------------—+------------------—+ +-bottom

Note
the bottom cache layer is only present when trivial_sar is used to write on a pipe. trivial_sar used to write a non sliced archive does not use a cache layer above it
the top cache is only used in place of crypto_sym or scrambler when no encryption is required and the cache layer labelled _CACHE_PIPE is absent.
escape layer is present by default unless tape marks have been disabled
the generic_thread are inserted in the stack if multi-threading is possible and allowed

◆ macro_tools_get_slices()

range libdar::macro_tools_get_slices ( const cat_nomme obj,
slice_layout  sl 
)

gives the location of data EA and FSA (when they are saved) of the object given in argument

Parameters
[in]obja pointer to the object which data & EFSA is to be located
[in]slslice layout of the archive
Returns
a set of slices which will be required to restore that particular file (over the slice(s) containing the catalogue of course).

◆ macro_tools_open_archive()

void libdar::macro_tools_open_archive ( const std::shared_ptr< user_interaction > &  dialog,
const std::shared_ptr< entrepot > &  where,
const std::string &  basename,
const infinint min_digits,
const std::string &  extension,
crypto_algo  crypto,
const secu_string pass,
U_32  crypto_size,
pile stack,
header_version ver,
const std::string &  input_pipe,
const std::string &  output_pipe,
const std::string &  execute,
infinint second_terminateur_offset,
bool  lax,
bool  has_external_cat,
bool  sequential_read,
bool  info_details,
std::list< signator > &  gnupg_signed,
slice_layout &  sl,
U_I  multi_threaded_crypto,
U_I  multi_threaded_compress,
bool  header_only 
)

setup the given pile object to contain a stack of generic_files suitable to read an archive

Note
the stack has the following contents depending on given options

+-top LIBDAR_STACK_LABEL_ +----------------------------------------------------—+------------------—+ | compressor |v v v | +----------------------------------------------------—+------------------—+ | [ escape ] |v v v | +----------------------------------------------------—+v—v—v---------—+ | [ cache ] | (parallel_)tronconneuse | scrambler |v v v | | [ tronc ] |LEVEL 1 | | trivial_sar | zapette | sar |v v v | +----------------------------------------------------—+------------------—+ +-bottom

Note
escape is present unless tape mark have been disabled at archive creation time
tronc is not present in sequential read mode
cache layer is present only in absence of encryption and when no escape layer is above
_UNCOMPRESSED label is associated to the top of the stack
_CLEAR is associated to the generic_thread below compressor else escape else the cache or crypto_sym or scrambler which then has two Labels (_CLEAR and _UNCYPHERED)
Parameters
dialogfor user interaction
whereslices location
basenameslice basename
min_digitsminimum digits for the slice number
extensionslice extensions
cryptoencryption algorithm
passpass key for crypto/scrambling
crypto_sizecrypto block size
stackthe stack of generic_file resulting of the archive openning
verheader read from raw data
input_pipenamed pipe for input when basename is "-" (dar_slave)
output_pipenamed pipe for output when basename is "-" (dar_slave)
executecommand to execute between slices
second_terminateur_offsetwhere to start looking for the second terminateur (set to zero if there is only one terminateur).
laxwhether we skip&warn the usual verifications
has_external_cattrue if the catalogue will not be read from the current archive (flag used in lax mode only)
sequential_readwhether to use the escape sequence (if present) to get archive contents and proceed to sequential reading
info_detailsbe or not verbose about the archive openning
gnupg_signedlist of existing signature found for that archive (valid or not)
slslicing layout of the archive (read from sar header if present)
multi_threaded_cryptonumber of worker thread to run for cryptography (1 -> tronconneuse object, more -> parallel_tronconneuse object)
multi_threaded_compressnumber of worker threads to compress/decompress (need compression_block_size > 0)
header_onlyif true, stop the process before openning the encryption layer

◆ macro_tools_open_pipes()

void libdar::macro_tools_open_pipes ( const std::shared_ptr< user_interaction > &  dialog,
const std::string &  input,
const std::string &  output,
tuyau *&  in,
tuyau *&  out 
)

open a pair of tuyau objects encapsulating two named pipes.

Parameters
[in,out]dialogfor user interaction
[in]inputpath to the input named pipe
[in]outputpath to the output named pipe
[out]inresulting tuyau object for input
[out]outresulting tuyau object for output
Note
in and out parameters must be released by the caller thanks to the "delete" operator

◆ op_tools_crit_ask_user_for_data_action()

over_action_data libdar::op_tools_crit_ask_user_for_data_action ( user_interaction dialog,
const std::string &  full_name,
const cat_entree already_here,
const cat_entree dolly 
)

ask user for Data action

Parameters
[in]dialogfor user interaction
[in]full_namefull path to the entry do ask decision for
[in]already_herepointer to the object 'in place'
[in]dollypointer to the object 'to be added'
Returns
the action decided by the user. The user may also choose to abort, which will throw an Euser_abort exception

◆ op_tools_crit_ask_user_for_EA_action()

over_action_ea libdar::op_tools_crit_ask_user_for_EA_action ( user_interaction dialog,
const std::string &  full_name,
const cat_entree already_here,
const cat_entree dolly 
)

ask user for EA action

Parameters
[in]dialogfor user interaction
[in]full_namefull path to the entry do ask decision for
[in]already_herepointer to the object 'in place'
[in]dollypointer to the object 'to be added'
Returns
the action decided by the user. The user may also choose to abort, which will throw an Euser_abort exception

◆ op_tools_crit_ask_user_for_FSA_action()

over_action_ea libdar::op_tools_crit_ask_user_for_FSA_action ( user_interaction dialog,
const std::string &  full_name,
const cat_entree already_here,
const cat_entree dolly 
)

ask user for FSA action

Parameters
[in]dialogfor user interaction
[in]full_namefull path to the entry do ask decision for
[in]already_herepointer to the object 'in place'
[in]dollypointer to the object 'to be added'
Returns
the action decided by the user. The user may also choose to abort, which will throw an Euser_abort exception

◆ op_tools_crit_show_entry_info()

void libdar::op_tools_crit_show_entry_info ( user_interaction dialog,
const std::string &  full_name,
const cat_entree already_here,
const cat_entree dolly 
)

show information suited for user comparison and decision for entry in conflict

Parameters
[in]dialogfor user interaction
[in]full_namepath to the entry of the entry to display information
[in]already_herepointer to the object 'in place'
[in]dollypointer to the object 'to be added'

◆ operator+()

std::vector<std::string> libdar::operator+ ( std::vector< std::string >  a,
std::vector< std::string >  b 
)

concatenate two vectors

Parameters
[in]athe first vector
[in]bthe second vector
Returns
a vector containing the elements of a and the element of b

◆ pop_and_close_if_type_is()

template<class T >
bool libdar::pile::pop_and_close_if_type_is ( T *  ptr)

remove the top generic_file and destroy it

Parameters
[in]ptris the type of the object that must be found on the top of the stack, It may also be the type of a parent class. Note that the value of the pointer is ignored.
Returns
true if and only if the object on the top of the stack could be matched to the given type, this object is then poped from the stack and destroyed.

Definition at line 182 of file pile.hpp.

References libdar::pile::top().

◆ tools_addspacebefore()

std::string libdar::tools_addspacebefore ( std::string  s,
U_I  expected_size 
)

prepend spaces before the given string

Parameters
[in]sthe string to append spaces to
[in]expected_sizethe minimum size of the resulting string
Returns
a string at least as much long as expected_size with prepended leading spaces if necessary

◆ tools_are_on_same_filesystem()

bool libdar::tools_are_on_same_filesystem ( const std::string &  file1,
const std::string &  file2 
)

tells whether two files are on the same mounted filesystem

Parameters
[in]file1first file
[in]file2second file
Returns
true if the two files are located under the same mounting point
Note
if one of the file is not present or if the filesystem information is not possible to be read an exception is throw (Erange)

◆ tools_avoid_slice_overwriting_regex()

void libdar::tools_avoid_slice_overwriting_regex ( user_interaction dialog,
const entrepot ent,
const std::string &  basename,
const std::string &  extension,
bool  info_details,
bool  allow_overwriting,
bool  warn_overwriting,
bool  dry_run 
)

prevents slice overwriting: check the presence of slice and if necessary ask the user if they can be removed

Parameters
[in,out]dialogfor user interaction
[in]ententrepot where to check for slice overwriting
[in]basenameis the archive basename
[in]extensionis the archive filename extension
[in]info_detailswhether user must be displayed details of the operation
[in]allow_overwritingwhether overwriting is allowed by the user
[in]warn_overwritingwhether a warning must be issued before overwriting (if allowed)
[in]dry_rundo a dry-run exection (no filesystem modification is performed)
Note
may thow exceptions.

◆ tools_block_all_signals()

void libdar::tools_block_all_signals ( sigset_t &  old_mask)

block all signals (based on POSIX sigprocmask)

Parameters
[out]old_maskis set to the old mask value (for later unmasking signals)
Exceptions
Erangeis thrown if system call failed for some reason

◆ tools_blocking_read()

void libdar::tools_blocking_read ( int  fd,
bool  mode 
)

set blocking/not blocking mode for reading on a file descriptor

Parameters
[in]fdfile descriptor to read on
[in]modeset to true for a blocking read and to false for non blocking read

◆ tools_check_negative_date()

template<class T >
void libdar::tools_check_negative_date ( T &  val,
user_interaction ui,
const char *  inode_path,
const char *  nature,
bool  ask_before,
bool  silent 
)

check the value is not negative, and if asked set it to zero

Parameters
[in,out]valvariable which value to check
[in,out]uifor user interaction if necessary
[in]inode_pathto the inode for message info
[in]naturetype of the date/time (mtime,atime,ctime,birthtime,...)
[in]ask_beforewhether to just warn or ask user for confirmation
[in]silentif set, do not warn nor ask

Definition at line 671 of file tools.hpp.

References libdar::tools_printf().

◆ tools_concat_vector()

std::string libdar::tools_concat_vector ( const std::string &  separator,
const std::vector< std::string > &  x 
)

concatenate a vectors of strings in a single string

Parameters
[in]separatorstring to insert between two elements
[in]xthe list string
Returns
the result of the concatenation of the members of the list with separtor between two consecutive members

◆ tools_count_in_string()

U_I libdar::tools_count_in_string ( const std::string &  s,
const char  a 
)

counts the number of a given char in a given string

Parameters
[in]sstring to look inside of
[in]achar to look for
Returns
the number of char found

◆ tools_display_date()

std::string libdar::tools_display_date ( const datetime date)

convert a date in second to its human readable representation

Parameters
[in]datethe date in second
Returns
the human representation corresponding to the argument

◆ tools_display_integer_in_metric_system()

std::string libdar::tools_display_integer_in_metric_system ( infinint  number,
const std::string &  unit,
bool  binary 
)

convert an integer to its decimal representation with the highest unit of metric system

Parameters
[in]numberis the integer to convert
[in]unitunit symbol (o for octet, m for meter, etc.) to apply metric system to, this may be nullptr
[in]binaryif set to true using the ki, Gi, Mi ... scale instead of the traditional k, G, M, ... prefixes
Returns
the string representing the number in metric system (ex: "1 ko", "200 Mio", ...)

◆ tools_do_some_files_match_mask_regex()

bool libdar::tools_do_some_files_match_mask_regex ( const entrepot ent,
const std::string &  file_mask 
)

test the presence of files corresponding to a given mask in a directory (regex mask)

Parameters
[in]ententrepot where to read filesystem from
[in]file_maskregex expression which designates the files to look for
Returns
true if some files have found matching the file_mask

◆ tools_file_size_to_crc_size()

infinint libdar::tools_file_size_to_crc_size ( const infinint size)

Defines the CRC size to use for a given filesize.

Parameters
[in]sizeis the size of the file to protect by CRC
Returns
crc_size is the size of the crc to use

◆ tools_find_last_char_of()

std::string::iterator libdar::tools_find_last_char_of ( std::string &  s,
unsigned char  v 
)

give a pointer to the last character of the given value in the given string

Parameters
[in]sis the given string
[in]vis the given char value
Returns
a interator on s, pointing on the last char of s equal to v or a pointing to s.end() if no such char could be found is "s"
Note
the arguments are not modified neither the data they are pointing to. However the const statement has not been used to be able to return a iterator on the string (and not a const_interator). There is probably other ways to do that (using const_cast) for example

◆ tools_get_extended_size()

infinint libdar::tools_get_extended_size ( std::string  s,
U_I  base 
)

convert the given string to infinint taking care of multiplication suffixes like k, M, T, etc.

Parameters
[in]sis the string to read
[in]baseis the multiplication factor (base = 1000 for SI, base = 1024 for computer science use)
Returns
the value encoded in the given string

◆ tools_get_filesize()

infinint libdar::tools_get_filesize ( const path p)

retrieve the size in byte of a file

Parameters
[in]pis the path to the file which size is to get
Returns
the size of the file in byte

◆ tools_get_mtime()

datetime libdar::tools_get_mtime ( user_interaction dialog,
const std::string &  s,
bool  auto_zeroing,
bool  silent,
const std::set< std::string > &  ignored_as_symlink = std::set< std::string >() 
)

returns the last modification date of the given file

Parameters
[in,out]dialogfor user interaction
[in]spath of the file to get the last mtime
[in]auto_zeroingwhether to just warn instead of asking user confirmation
[in]silentif set do not warn nor ask
[in]ignored_as_symlinkfor inodes present in this set, get the symlink pointed to date rather than the date of they symlink itself (no impact if the inode is not a symlink)
Returns
the mtime of the given file

◆ tools_get_permission()

U_I libdar::tools_get_permission ( S_I  fd)

obtain the permission of the file which descriptor is given

Parameters
[in]fdfile's descriptor
Returns
permission of the given file
Note
in case of error exception may be thrown

◆ tools_get_size()

infinint libdar::tools_get_size ( const std::string &  s)

returns the size of the given plain file

Parameters
[in]spath of the file to get the size
Returns
the size if the file in byte

◆ tools_hook_execute()

void libdar::tools_hook_execute ( user_interaction ui,
const std::string &  cmd_line 
)

execute and retries at user will a given command line

Parameters
[in]uiwhich way to ask the user whether to continue upon command line error
[in]cmd_linethe command line to execute

◆ tools_hook_substitute()

std::string libdar::tools_hook_substitute ( const std::string &  hook,
const std::string &  path,
const std::string &  basename,
const std::string &  num,
const std::string &  padded_num,
const std::string &  ext,
const std::string &  context,
const std::string &  base_url 
)

produces the string resulting from the substitution of %... macro

Parameters
[in]hookthe string in which to substitute
[in]pathis by what p will be replaced
[in]basenameis by what b will be replaced
[in]numis by what n will be replaced
[in]padded_numis by what N will be replaced
[in]extis by what e will be replaced
[in]contextis by what c will be replaced
[in]base_urlremote repository base URL
Returns
the substitued resulting string
Note
it now relies on tools_substitue

◆ tools_hook_substitute_and_execute()

void libdar::tools_hook_substitute_and_execute ( user_interaction ui,
const std::string &  hook,
const std::string &  path,
const std::string &  basename,
const std::string &  num,
const std::string &  padded_num,
const std::string &  ext,
const std::string &  context,
const std::string &  base_url 
)

subsititue and execute command line

Parameters
[in,out]uithis is the way to contact the user
[in]hookthe string in which to substitute
[in]pathis by what p will be replaced
[in]basenameis by what b will be replaced
[in]numis by what n will be replaced
[in]padded_numis by what N will be replaced
[in]extis by what e will be replaced
[in]contextis by what c will be replaced
[in]base_urlremote repository base URL

◆ tools_infinint2U_64()

bool libdar::tools_infinint2U_64 ( infinint  val,
U_64 &  res 
)

convert an infinint to U_64 (aka "uint64_t" or yet "unsigned long long")

Note
: if the infinint is too large to fit in an U_64 it returns false

◆ tools_int2octal()

std::string libdar::tools_int2octal ( const U_I &  perm)

convert a number to a string corresponding to its octal representation

Parameters
permis the octal number
Returns
the corresponding octal string

◆ tools_int2str()

std::string libdar::tools_int2str ( S_I  x)

convert integer to string

Parameters
[in]xthe integer to convert
Returns
the decimal representation of the given integer

◆ tools_is_case_insensitive_equal()

bool libdar::tools_is_case_insensitive_equal ( const std::string &  a,
const std::string &  b 
)

compare two string in case insensitive manner

Parameters
[in]afirst string to compare
[in]bsecond string to compare
Returns
whether the two string given in argument are equal in case insensitive comparison

◆ tools_is_equal_with_hourshift()

bool libdar::tools_is_equal_with_hourshift ( const infinint hourshift,
const datetime date1,
const datetime date2 
)

test if two dates are equal taking care of a integer hour of difference

Parameters
[in]hourshiftis the number of integer hour more or less two date can be considered equal
[in]date1first date to compare
[in]date2second date to compare to
Returns
whether dates are equal or not

◆ tools_make_date()

void libdar::tools_make_date ( const std::string &  chemin,
bool  symlink,
const datetime access,
const datetime modif,
const datetime birth 
)

set dates of a given file, may throw exception

Parameters
[in]cheminthe path to the file to set
[in]symlinktrue if the file is a symlink
[in]accesslast access date to use
[in]modiflast modification date to use
[in]birthtime of creation of the file
Note
if birth time is not known, it should be set to the value of modif for efficiency

◆ tools_memxor()

void libdar::tools_memxor ( void *  dest,
const void *  src,
U_I  n 
)

Produces in "dest" the XORed value of "dest" and "src".

Parameters
[in,out]destis the area where to write down the result
[in]srcpoints to vector or array of values to convert
[in]nis the number of byte to convert from src to dest
Note
dest must be a valid pointer to an allocated memory area of at least n bytes

◆ tools_my_atoi()

bool libdar::tools_my_atoi ( const char *  a,
U_I &  val 
)

ascii to integer conversion

Parameters
[in]ais the ascii string to convert
[out]valis the resulting value
Returns
true if the conversion could be done false if the given string does not correspond to the decimal representation of an unsigned integer
Note
this call is now a warapper around line_tools_str2int

◆ tools_name_of_gid()

std::string libdar::tools_name_of_gid ( const infinint gid)

convert gid to name in regards of the current system's configuration

Parameters
[in]gidthe Group ID number
Returns
the name of the corresponding group or the gid if none corresponds

◆ tools_name_of_uid()

std::string libdar::tools_name_of_uid ( const infinint uid)

convert uid to name in regards to the current system's configuration

Parameters
[in]uidthe User ID number
Returns
the name of the corresponding user or the uid if none corresponds

◆ tools_noexcept_make_date()

void libdar::tools_noexcept_make_date ( const std::string &  chem,
bool  symlink,
const datetime last_acc,
const datetime last_mod,
const datetime birth 
)

set dates of a given file, no exception thrown

Parameters
[in]chemthe path to the file to set
[in]symlinktrue if the file is a symlink
[in]last_acclast access date to use
[in]last_modlast modification date to use
[in]birthcreation date of the file, if not known, use the value of last_mod for efficiency

◆ tools_number_base_decomposition_in_big_endian()

template<class N , class B >
std::deque<B> libdar::tools_number_base_decomposition_in_big_endian ( number,
const B &  base 
)

Template for the decomposition of any number in any base (decimal, octal, hexa, etc.)

Parameters
[in]numberis the number to decompose
[in]baseis the base to decompose the number into
Returns
a vector of 'digit' int the specified base, the first beeing the less significative
Note
this template does not take care of the possibily existing optimized euclide division to speed up the operation like what exists for infinint. A specific overriden fonction for this type would be better.
, the name "big_endian" is erroneous, it gives a little endian vector

Definition at line 577 of file tools.hpp.

◆ tools_octal2int()

U_I libdar::tools_octal2int ( const std::string &  perm)

convert octal string to integer

Parameters
permis a string representing a number in octal (string must have a leading zero)
Returns
the corresponding value as an integer

◆ tools_output2xml()

std::string libdar::tools_output2xml ( const std::string &  src)

convert string for xml output

Note
any < > & quote and double quote are replaced by adequate sequence for unicode
second point, nothing is done here to replace system native strings to unicode

◆ tools_ownership2gid()

uid_t libdar::tools_ownership2gid ( const std::string &  group)

convert string group name or gid to numeric gid value

Parameters
[in]groupstring username
Returns
uid value

◆ tools_ownership2uid()

uid_t libdar::tools_ownership2uid ( const std::string &  user)

change ownership of the file which descriptor is given

convert string user name or uid to numeric uid value

Parameters
[in]userstring username
Returns
uid value

◆ tools_printf()

std::string libdar::tools_printf ( const char *  format,
  ... 
)

make printf-like formating to a std::string

Parameters
[in]formatthe format string
[in]...list of argument to use against the format string
Returns
the resulting string
Note
the supported masks for the format are:
  • %s %c %d %o %% (usual behavior)
  • %x display an integer under hexadecimal notation
  • %i (matches infinint *)
  • %S (matches std::string *)

Referenced by line_tools_split_in_words(), and libdar::tools_check_negative_date().

◆ tools_pseudo_random()

U_I libdar::tools_pseudo_random ( U_I  max)

Produces a pseudo random number x, where 0 <= x < max.

Parameters
[in]maxdefines the range of the random number to return
Returns
the returned value ranges from 0 (zero) up to max (= including max)

◆ tools_read_string()

void libdar::tools_read_string ( generic_file f,
std::string &  s 
)

read a string from a file expecting it to terminate by '\0'

Parameters
fthe file to read from
sthe string to put the data to (except the ending '\0')

◆ tools_read_string_size()

void libdar::tools_read_string_size ( generic_file f,
std::string &  s,
infinint  taille 
)

read a string if given size from a file '\0' has no special meaning

Parameters
[in]fis the file to read from
[in]sis the string to put read data in
[in]tailleis the size in byte to read

◆ tools_read_vector()

void libdar::tools_read_vector ( generic_file f,
std::vector< std::string > &  x 
)

read a list of string from a file

Parameters
[in]fthe file to read from
[out]xthe list to fill from file

◆ tools_readlink()

std::string libdar::tools_readlink ( const char *  root)

returns the file pointed to by a symbolic link (or transparent if the file is not a symlink).

Parameters
rootthe path to the file to read
Returns
the file pointed to by the symlink or the value given in argument if it is not a symlink
Note
an exception can occur if lack of memory or invalid argument given (nullptr or empty string), system call error...

◆ tools_relative2absolute_path()

path libdar::tools_relative2absolute_path ( const path src,
const path cwd 
)

transform a relative path to an absolute one given the current directory value

Parameters
[in]srcthe relative path to transform
[in]cwdthe value to take for the current directory
Returns
the corresponding absolute path

◆ tools_set_back_blocked_signals()

void libdar::tools_set_back_blocked_signals ( sigset_t  old_mask)

unblock signals according to given mask

Parameters
[in]old_maskvalue to set to blocked signal mask
Exceptions
Erangeis thrown if system call failed for some reason

◆ tools_set_ownership()

void libdar::tools_set_ownership ( S_I  filedesc,
const std::string &  slice_user,
const std::string &  slice_group 
)

change ownership of the file which descriptor is given

Parameters
[in]filedescfile's descriptor
[in]slice_userthe user to set the file to. For empty string, no attempts to change the user ownership is done
[in]slice_groupthe group to set the file to. For empty string, no attempts to change the group ownership is done
Note
this call may throw Erange exception upon system error

◆ tools_set_permission()

void libdar::tools_set_permission ( S_I  fd,
U_I  perm 
)

change the permission of the file which descriptor is given

Parameters
[in]fdfile's descriptor
[in]permfile permission to set the file to

◆ tools_str2charptr()

char* libdar::tools_str2charptr ( const std::string &  x)

convert a string to a char *

Parameters
[in]xis the string to convert
Returns
the address of newly allocated memory containing the equivalent string as the argument
Exceptions
Ememoryis thrown if the memory allocation failed, this call never return nullptr
Note
Do not use this function, use std::string::c_str(). The allocated memory must be released by the caller thanks to the "delete []" operator

◆ tools_str2int()

U_I libdar::tools_str2int ( const std::string &  x)

convert an integer written in decimal notation to the corresponding value

Parameters
[in]xthe decimal representation of the integer
Returns
the value corresponding to the decimal representation given

◆ tools_string2tlv_list()

tlv_list libdar::tools_string2tlv_list ( user_interaction dialog,
const U_16 &  type,
const std::vector< std::string > &  data 
)

Produces a list of TLV from a constant type and a list of string.

Parameters
[in,out]dialogfor user interaction
[in]typeis the type each TLV will have
[in]datais the list of string to convert into a list of TLV
Returns
a tlv_list object. Each TLV in the list correspond to a string in the given list

◆ tools_string_to_hexa()

std::string libdar::tools_string_to_hexa ( const std::string &  input)

convert a string into its hexadecima representation

Parameters
[in]inputinput string to convert
Returns
a string containing an hexadecimal number corresponding to the bytes of the input string

◆ tools_substitute()

std::string libdar::tools_substitute ( const std::string &  hook,
const std::map< char, std::string > &  corres 
)

produce the string resulting from the substition of % macro defined in the map

Parameters
[in]hookis the user's expression in which to proceed to substitution
[in]corresis a map telling which char following a % sign to replace by which string
Returns
the resulting string of the substitution

◆ tools_system()

void libdar::tools_system ( user_interaction dialog,
const std::vector< std::string > &  argvector 
)

wrapper to the "system" system call.

Parameters
[in,out]dialogfor user interaction
[in]argvectorthe equivalent to the argv[] vector

◆ tools_system_with_pipe()

void libdar::tools_system_with_pipe ( const std::shared_ptr< user_interaction > &  dialog,
const std::string &  dar_cmd,
const std::vector< std::string > &  argvpipe 
)

wrapper to the "system" system call using anonymous pipe to tranmit arguments to the child process

Parameters
[in,out]dialogfor user interaction
[in]dar_cmdthe path to the executable to run
[in]argvpipethe list of arguments to pass through anonymous pipe
Note
the command to execute must understand the –pipe-fd option that gives the filedescriptor to read from the command-line options

◆ tools_to_upper()

void libdar::tools_to_upper ( const std::string &  r,
std::string &  uppered 
)

convert a string to upper case

Parameters
[in]rthe string to convert
[out]upperedresulting upper cased string
Note
in case of invalid wide char met in source string, the upper case convertion is done in ASCII mode (byte by byte)

◆ tools_unlink_file_mask_regex()

void libdar::tools_unlink_file_mask_regex ( user_interaction dialog,
const entrepot ent,
const std::string &  file_mask,
bool  info_details 
)

remove files from a given directory

Parameters
[in,out]dialogfor user interaction
[in]ententrepot where to remove files from
[in]file_maskregex expression which designates the files to remove
[in]info_detailswhether user must be displayed details of the operation
Note
This is equivalent to the 'rm' command with regex expression in place of glob one

◆ tools_unsigned_char_to_hexa()

std::string libdar::tools_unsigned_char_to_hexa ( unsigned char  x)

convert a unsigned char into its hexa decima representation

Parameters
[in]xis the byte to convert
Returns
the string representing the value of x written in hexadecimal

◆ tools_uword2str()

std::string libdar::tools_uword2str ( U_16  x)

convert unsigned word to string

Parameters
[in]xthe unsigned word to convert
Returns
the decimal representation of the given integer

◆ tools_vprintf()

std::string libdar::tools_vprintf ( const char *  format,
va_list  ap 
)

make printf-like formating to a std::string

Parameters
[in]formatthe format string
[in]aplist of argument to use against the format string
Returns
the resulting string
Note
the supported masks for the format are:
  • %s %c %d %% (normal behavior)
  • %i (matches infinint *)
  • %S (matches std::string *)

◆ tools_write_string()

void libdar::tools_write_string ( generic_file f,
const std::string &  s 
)

write a string to a file with a '\0' at then end

Parameters
[in]fthe file to write to
[in]sthe string to write to file

◆ tools_write_string_all()

void libdar::tools_write_string_all ( generic_file f,
const std::string &  s 
)

write a string to a file, '\0' has no special meaning nor is added at the end

Parameters
[in]fthe file to write to
[in]sthe string to write to file

◆ tools_write_vector()

void libdar::tools_write_vector ( generic_file f,
const std::vector< std::string > &  x 
)

write a list of string to file

Parameters
[in]fthe file to write to
[in]xthe list of string to write