# libdar Namespace Reference

libdar namespace encapsulate all libdar symbols More...

## Classes
class | archive
| the archive class realizes the most general operations on archives More...
class | cache
| the cache class implements a very basic read/write caching mechanisme More...
class | entree
| the root class from all other inherite for any entry in the catalogue More...
class | eod
| the End of Directory entry class More...
class | nomme
| the base class for all entry that have a name More...
class | inode
| the root class for all inode More...
class | file
| the plain file class More...
class | etiquette
| the hard link managment interface class (pure virtual class) More...
class | file_etiquette
| the hard linked plain file More...
class | hard_link
| the secondary reference to a hard linked inode More...
class | lien
| the symbolic link inode class More...
class | directory
| the directory inode class More...
class | device
| the special device root class More...
class | chardev
| the char device class More...
class | blockdev
| the block device class More...
class | tube
| the named pipe class More...
class | prise
| the Unix socket inode class More...
class | detruit
| the deleted file entry More...
class | ignored
| the present file to ignore (not to be recorded as deleted later) More...
class | ignored_dir
| the ignored directory class, to be promoted later as empty directory if needed More...
class | catalogue
| the catalogue class which gather all objects contained in a give archive More...
class | compressor
| compression class for gzip and bzip2 algorithms More...
class | blowfish
| blowfish implementation of encryption More...
class | data_tree
| the data_tree class stores presence of a given file in a set of archives More...
class | data_dir
| the data_dir class inherits from data_tree and holds the directory tree's parent relationship More...
class | database
| the database class defines the dar_manager database More...
class | deci
| decimal class, convert infinint from and to decimal represention More...
class | defile
| the defile class keep trace of the real path of files while the flow in the filter routines More...
class | elastic
| the elastic buffer class More...
class | Egeneric
| this is the parent class of all exception classes. More...
class | Ememory
| exception used when memory has been exhausted More...
class | Ebug
| exception used to signal a bug. A bug is triggered when reaching some code that should never be reached More...
class | Einfinint
| exception used when arithmetic error is detected when operating on infinint More...
class | Elimitint
| exception used when a limitint overflow is detected, the maximum value of the limitint has been exceeded More...
class | Erange
| exception used to signal range error More...
class | Edeci
| exception used to signal convertion problem between infinint and string (decimal representation) More...
class | Efeature
| exception used when a requested feature is not (yet) implemented More...
class | Ehardware
| exception used when hardware problem is found More...
class | Euser_abort
| exception used to signal that the user has aborted the operation More...
class | Edata
| exception used when an error concerning the treated data has been met More...
class | Escript
| exception used when error the inter-slice user command returned an error code More...
class | Elibcall
| exception used to signal an error in the argument given to libdar call of the API More...
class | Ecompilation
| exception used when a requested fearture has not beed activated at compilation time More...
class | Ethread_cancel
| exception used when the thread libdar is running in is asked to stop More...
struct | etage
| the etage structure keep trace of directory contents More...
class | filesystem_hard_link_read
| keep trace of hard links when reading the filesystem More...
class | filesystem_backup
| make a flow sequence of inode to feed the backup filtering routing More...
class | filesystem_diff
| make a flow of inode to feed the difference filter routine More...
class | filesystem_hard_link_write
| keep trace of already written inodes to restore hard links More...
class | filesystem_restore
| receive the flow of inode from the restoration filtering routing and promotes these to real filesystem objects More...
class | generic_file
| this is the interface class from which all other data transfer classes inherit More...
class | fichier
| this is a full implementation of a generic_file applied to a plain file More...
class | contextual
| the contextual class adds the information of phases in the generic_file More...
class | limitint
| limitint template class More...
class | mask
| the generic class, parent of all masks More...
class | bool_mask
| boolean mask, either always true or false More...
class | simple_mask
| matches as done on shell command lines (see "man 7 glob") More...
class | regular_mask
| matches regular expressions (see "man 7 regex") More...
class | not_mask
| negation of another mask More...
class | et_mask
| makes an *AND* operator between two or more masks More...
class | ou_mask
| makes the *OR* operator between two or more masks More...
class | simple_path_mask
| string matches if it is subdir of mask or mask is a subdir of expression More...
class | same_path_mask
| matches if string is exactly the given mask (no wilde card expression) More...
class | exclude_dir_mask
| matches if string is the given string or a sub directory of it More...
class | mask_list
| the mask_list class, matches string that are present in a given file More...
class | null_file
| the null_file class implements the /dev/null behavior More...
class | path
| the class path is here to manipulate paths in the Unix notation: using'/' More...
class | infinint
| the arbitrary large positive integer class More...
class | scrambler
| scrambler is a very weak encryption scheme More...
class | statistics
| structure returned by libdar call to give a summary of the operation done in term of file treated More...
class | storage
| arbitrary large storage structure More...
class | string_file
| class string_file emulates a generic_file frome a std::string More...
class | terminateur
| terminateur class indicates the location of the beginning of the catalogue More...
class | thread_cancellation
| class to be used as parent to provide checkpoints to inherited classes More...
class | tronc
| make a segment of a generic_file appear like a real generic_file More...
class | tronconneuse
| this is a partial implementation of the generic_file interface to encrypt/decrypt data block by block. More...
class | tuyau
| pipe implementation under the generic_file interface. More...
class | user_interaction
| This is a pure virtual class that is used by libdar when interaction with the user is required. More...
class | user_interaction_callback
| full implemented class for user_interaction based on callback functions. More...
class | wrapperlib
| this class encapsulates calls to libz or libbz2 More...
class | zapette
| zapette emulate a file that is remotely controlled by slave_zapette More...
class | slave_zapette
| this class answers to order given by a zapette object More...
## Enumerations
enum | compression { none = 'n', zip = 'p', gzip = 'z', bzip2 = 'y' }
| the different compression algorithm available More...
enum | crypto_algo { crypto_none, crypto_scrambling, crypto_blowfish, crypto_blowfish_weak }
| the different cypher available for encryption (strong or weak) More...
enum | gf_mode { gf_read_only, gf_write_only, gf_read_write }
| generic_file openning modes More...
## Functions
generic_file * | database_header_create (user_interaction &dialog, const std::string &filename, bool overwrite)
| create the header for a dar_manager database
generic_file * | database_header_open (user_interaction &dialog, const std::string &filename)
| read the header of a dar_manager database
std::ostream & | operator<< (std::ostream &ref, const infinint &arg)
| specific << operator to use infinint in std::ostream
void | ea_filesystem_read_ea (const std::string &chemin, ea_attributs &val, const mask &filter)
| read EA associated to a given file
bool | 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
void | ea_filesystem_clear_ea (const std::string &name, const mask &filter)
| remove all EA of a given file that match a given mask
bool | ea_filesystem_has_ea (const std::string &name)
| test the presence of EA for a given file
bool | ea_filesystem_has_ea (const std::string &name, const ea_attributs &list, const mask &filter)
| test the presence of EA for a given file
void | get_version (U_I &major, U_I &medium, U_I &minor)
| return the libdar version, and make libdar initialization (may throw Exceptions)
void | get_version_noexcept (U_I &major, U_I &medium, U_I &minor, U_16 &exception, std::string &except_msg)
| return the libdar version, and make libdar initialization (does not throw exceptions)
void | get_compile_time_features (bool &ea, bool &largefile, bool &nodump, bool &special_alloc, U_I &bits, bool &thread_safe, bool &libz, bool &libbz2, bool &libcrypto, bool &new_blowfish)
| return the options activated that have been activated at compilation time
archive * | open_archive_noexcept (user_interaction &dialog, const path &chem, const std::string &basename, const std::string &extension, crypto_algo crypto, const std::string &pass, U_32 crypto_size, const std::string &input_pipe, const std::string &output_pipe, const std::string &execute, bool info_details, U_16 &exception, std::string &except_msg)
| this is a wrapper around the archive constructor known as the "read" constructor
archive * | create_archive_noexcept (user_interaction &dialog, const path &fs_root, const path &sauv_path, archive *ref_arch, const mask &selection, const mask &subtree, const std::string &filename, const std::string &extension, bool allow_over, bool warn_over, bool info_details, const infinint &pause, bool empty_dir, compression algo, U_I compression_level, const infinint &file_size, const infinint &first_file_size, const mask &ea_mask, const std::string &execute, crypto_algo crypto, const std::string &pass, U_32 crypto_size, const mask &compr_mask, const infinint &min_compr_size, bool nodump, inode::comparison_fields what_to_check, const infinint &hourshift, bool empty, bool alter_atime, bool same_fs, bool snapshot, bool cache_directory_tagging, bool display_skipped, const infinint &fixed_date, statistics *progressive_report, U_16 &exception, std::string &except_msg)
| this is a wrapper around the archive constructor known as the "create" constructor
archive * | isolate_archive_noexcept (user_interaction &dialog, const path &sauv_path, archive *ref_arch, 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, const infinint &file_size, const infinint &first_file_size, const std::string &execute, crypto_algo crypto, const std::string &pass, U_32 crypto_size, bool empty, U_16 &exception, std::string &except_msg)
| this is a wrapper around the archive constructor known as the "isolate" constructor
archive * | merge_archive_noexcept (user_interaction &dialog, const path &sauv_path, archive *ref_arch1, archive *ref_arch2, const mask &selection, const mask &subtree, const std::string &filename, const std::string &extension, bool allow_over, bool warn_over, bool info_details, const infinint &pause, bool empty_dir, compression algo, U_I compression_level, const infinint &file_size, const infinint &first_file_size, const mask &ea_mask, const std::string &execute, crypto_algo crypto, const std::string &pass, U_32 crypto_size, const mask &compr_mask, const infinint &min_compr_size, bool empty, bool display_skipped, bool keep_compressed, statistics *progressive_report, U_16 &exception, std::string &except_msg)
| this is a wrapper around the archive constructor known as the "merging" constructor
void | close_archive_noexcept (archive *ptr, U_16 &exception, std::string &except_msg)
| this is wrapper around the archive destructor
statistics | op_extract_noexcept (user_interaction &dialog, archive *ptr, const path &fs_root, const mask &selection, const mask &subtree, bool allow_over, bool warn_over, bool info_details, bool detruire, bool only_more_recent, const mask &ea_mask, bool flat, inode::comparison_fields what_to_check, bool warn_remove_no_match, const infinint &hourshift, bool empty, bool ea_erase, bool display_skipped, statistics *progressive_report, U_16 &exception, std::string &except_msg)
| this is wrapper around the op_extract method
void | op_listing_noexcept (user_interaction &dialog, archive *ptr, bool info_details, archive::listformat list_mode, const mask &selection, bool filter_unsaved, U_16 &exception, std::string &except_msg)
| this is wrapper around the op_listing method
statistics | op_diff_noexcept (user_interaction &dialog, archive *ptr, const path &fs_root, const mask &selection, const mask &subtree, bool info_details, const mask &ea_mask, inode::comparison_fields what_to_check, bool alter_atime, bool display_skipped, statistics *progressive_report, U_16 &exception, std::string &except_msg)
| this is wrapper around the op_diff method
statistics | op_test_noexcept (user_interaction &dialog, archive *ptr, const mask &selection, const mask &subtree, bool info_details, bool display_skipped, statistics *progressive_report, U_16 &exception, std::string &except_msg)
| this is wrapper around the op_test method
bool | get_children_of_noexcept (user_interaction &dialog, archive *ptr, const std::string &dir, U_16 &exception, std::string &except_msg)
| this is wrapper around the get_children_of method
char * | libdar_str2charptr_noexcept (const std::string &x, U_16 &exception, std::string &except_msg)
| routine provided to convert std::string to char *
generic_file * | sar_tools_open_archive_fichier (user_interaction &dialog, const std::string &filename, bool allow_over, bool warn_over)
| create a container for a single sliced archive
generic_file * | sar_tools_open_archive_tuyau (user_interaction &dialog, S_I fd, gf_mode mode)
| create an container to write a archive to a pipe
char * | tools_str2charptr (const std::string &x)
| convert a string to a char *
void | tools_write_string (generic_file &f, const std::string &s)
| write a string to a file with a '\0' at then end
void | tools_read_string (generic_file &f, std::string &s)
| read a string from a file expecting it to terminate by '\0'
void | 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
void | 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
infinint | tools_get_filesize (const path &p)
| retrieve the size in byte of a file
infinint | 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.
void | tools_extract_basename (const char *command_name, std::string &basename)
| extracts the basename of a file (removing path part)
void | tools_split_path_basename (const char *all, path *&chemin, std::string &base)
| split a given full path in path part and basename part
void | tools_split_path_basename (const std::string &all, std::string &chemin, std::string &base)
| split a given full path in path part and basename part
void | tools_open_pipes (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.
void | tools_blocking_read (int fd, bool mode)
| set blocking/not blocking mode for reading on a file descriptor
std::string | tools_name_of_uid (U_16 uid)
| convert uid to name in regards to the current system's configuration
std::string | tools_name_of_gid (U_16 gid)
| convert gid to name in regards of the current system's configuration
std::string | tools_uword2str (U_16 x)
| convert unsigned word to string
std::string | tools_int2str (S_I x)
| convert integer to string
U_32 | tools_str2int (const std::string &x)
| convert an integer written in decimal notation to the corresponding value
std::string | tools_addspacebefore (std::string s, unsigned int expected_size)
| prepend spaces before the given string
std::string | tools_display_date (infinint date)
| convert a date in second to its human readable representation
infinint | tools_convert_date (const std::string &repres)
| convert a human readable date representation in number of second since the system reference date
void | tools_system (user_interaction &dialog, const std::vector< std::string > &argvector)
| wrapper to the "system" system call.
void | tools_write_vector (generic_file &f, const std::vector< std::string > &x)
| write a list of string to file
void | tools_read_vector (generic_file &f, std::vector< std::string > &x)
| read a list of string from a file
std::string | tools_concat_vector (const std::string &separator, const std::vector< std::string > &x)
| concatenate a vectors of strings in a single string
std::vector< std::string > | operator+ (std::vector< std::string > a, std::vector< std::string > b)
| concatenate two vectors
bool | tools_is_member (const std::string &val, const std::vector< std::string > &liste)
| test the presence of a value in a list
void | tools_display_features (user_interaction &dialog, bool ea, bool largefile, bool nodump, bool special_alloc, U_I bits, bool thread_safe, bool libz, bool libbz2, bool libcrypto, bool new_blowfish)
| display the compilation time features of libdar
bool | is_equal_with_hourshift (const infinint &hourshift, const infinint &date1, const infinint &date2)
| test if two dates are equal taking care of a integer hour of difference
bool | tools_my_atoi (char *a, U_I &val)
| ascii to integer conversion
template<class T >
std::vector< T > | operator+= (std::vector< T > &a, const std::vector< T > &b)
| template function to add two vectors
const char * | tools_get_from_env (const char **env, const char *clef)
| isolate the value of a given variable from the environment vector
void | tools_check_basename (user_interaction &dialog, const path &loc, std::string &base, const std::string &extension)
| does sanity checks on a slice name, check presence and detect whether the given basename is not rather a filename
std::string | tools_getcwd ()
| get current working directory
std::string | tools_readlink (const char *root)
| returns the file pointed to by a symbolic link (or transparent if the file is not a symlink).
bool | tools_look_for (const char *argument, S_I argc, char *argv[])
| test the presence of an argument
void | tools_noexcept_make_date (const std::string &chem, const infinint &last_acc, const infinint &last_mod)
| set dates of a given file, no exception thrown
void | tools_make_date (const std::string &chemin, infinint access, infinint modif)
| set dates of a given file, may throw exception
bool | tools_is_case_insensitive_equal (const std::string &a, const std::string &b)
| compare two string in case insensitive manner
void | tools_to_upper (char *nts)
| convert a string to upper case
void | tools_to_upper (std::string &r)
| convert a string to upper case
void | tools_remove_last_char_if_equal_to (char c, std::string &s)
| remove last character of a string is it equal to a given value
void | tools_read_range (const std::string &s, U_I &min, U_I &max)
| from a string with a range notation (min-max) extract the range values
std::string | tools_printf (const char *format,...)
| make printf-like formating to a std::string
std::string | tools_vprintf (const char *format, va_list ap)
| make printf-like formating to a std::string
bool | tools_do_some_files_match_mask (user_interaction &ui, const std::string &c_chemin, const std::string &file_mask)
| test the presence of files corresponding to a given mask in a directory
void | tools_unlink_file_mask (user_interaction &dialog, const std::string &c_chemin, const std::string &file_mask, bool info_details)
| remove files from a given directory
void | tools_avoid_slice_overwriting (user_interaction &dialog, const path &chemin, const std::string &x_file_mask, 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
void | tools_add_elastic_buffer (generic_file &f, U_32 max_size)
| append an elastic buffer of given size to the file
bool | tools_are_on_same_filesystem (const std::string &file1, const std::string &file2)
| tells whether two files are on the same mounted filesystem
path | tools_relative2absolute_path (const path &src, const path &cwd)
| transform a relative path to an absolute one given the current directory value
void | tools_block_all_signals (sigset_t &old_mask)
| block all signals (based on POSIX sigprocmask)
void | tools_set_back_blocked_signals (sigset_t old_mask)
| unblock signals according to given mask
U_I | tools_count_in_string (const std::string &s, const char a)
| counts the number of a given char in a given string
infinint | tools_get_mtime (const std::string &s)
| returns the last modification date of the given file
std::vector< std::string > | tools_split_in_words (generic_file &f)
| read a file and split its contents in words
std::string | tools_build_regex_for_exclude_mask (const std::string &prefix, const std::string &relative_part)
| builds a regex from root directory and user provided regex to be applied to the relative path
std::string | tools_output2xml (const std::string &src)
| convert string for xml output
void | tools_memxor (void *dest, const void *src, size_t n)
| Produces the in "dest" the XORed value of "src" for the 'n' first bytes.
template<class N , class B >
std::vector< B > | 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.).
## Variables
const U_I | LIBDAR_COMPILE_TIME_MAJOR = 4
| libdar Major version defined at compilation time
const U_I | LIBDAR_COMPILE_TIME_MEDIUM = 4
| libdar Medium version defined at compilation time
const U_I | LIBDAR_COMPILE_TIME_MINOR = 4
| libdar Minor version defined at compilation time

## Detailed Description

libdar namespace encapsulate all libdar symbols

## Function Documentation

generic_file* libdar::database_header_create | ( | user_interaction & | dialog,
|  | const std::string & | filename,
|  | bool | overwrite |
| ) |  |  |

create the header for a dar_manager database

Parameters:

  `[in]` | dialog | is used for user interaction
  `[in]` | filename | is the file's name to create/overwrite
  `[in]` | overwrite | set to true to allow file overwriting (else generates an error if file exists)

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.

generic_file* libdar::database_header_open | ( | user_interaction & | dialog,
|  | const std::string & | filename |
| ) |  |  |

read the header of a dar_manager database

Parameters:

  `[in]` | dialog | for user interaction
  `[in]` | filename | is the filename to read from

Returns:
  the generic_file where the database header has been put

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]` | name | is the filename which EA must be altered
  `[in]` | filter | is 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.

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

test the presence of EA for a given file

Parameters:

  `[in]` | name | is the filename which EA presence must be check against
  `[in]` | list | list of attributes
  `[in]` | filter |

Returns:
  true if at least one EA covered by filter and present in the list exists as EA of the given file

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

test the presence of EA for a given file

Parameters:

  `[in]` | name | is the filename which EA presence must be check against

Returns:
  true if at least one EA has been found

void libdar::ea_filesystem_read_ea | ( | const std::string & | chemin,
|  | ea_attributs & | val,
|  | const mask & | filter |
| ) |  |  |

read EA associated to a given file

Parameters:

  `[in]` | chemin | is the path to the file to read attributes of
  `[out]` | val | is the resulting list of EA associated to this file
  `[in]` | filter | is a mask that defines which attributes names have to be considered only

Returns:
  true whether some attribute could be found

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]` | chemin | is the path of the file to write attribute to
  `[in]` | val | is a list of attribute amoung which a subset will be added to file's attribute list
  `[in]` | filter | a 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.