Disk ARchive  2.4.21
Files | Namespaces | Classes | Macros | Enumerations | Functions | Variables
API

APlication Interface. More...

Files

file  archive.hpp
 the archive class is defined in this module
 
file  archive_options.hpp
 this file contains a set of classes used to transmit options to archive operation
 
file  compile_time_features.hpp
 nested namespace containing routines that give features activated at compile time
 
file  criterium.hpp
 contains classes that let the user define the policy for overwriting files
 
file  database.hpp
 this file holds the database class definition
 
file  database_options.hpp
 this file holds the options for database operations
 
file  erreurs.hpp
 contains all the excetion class thrown by libdar
 
file  libdar.hpp
 the main file of the libdar API definitions
 
file  list_entry.hpp
 class of objects describing an entry in the archive, used by archive::get_children_in_table
 
file  mask.hpp
 here lies a collection of mask classes
 
file  mask_list.hpp
 here lies a mask that selects files present in a given listThe mask_list classes defined here is to be used for filtering files in the libdar API calls.
 
file  path.hpp
 here is the definition of the path classthe path class handle path and provide several operation on them
 
file  statistics.hpp
 handle the statistic structure that gives a summary of treated files after each operatio
 
file  thread_cancellation.hpp
 to be able to cancel libdar operation while running in a given thread.the class thread_cancellation implemented in this module permits to define checkpoints where is looked whether the current thread has been marked as to be canceled by the user The advantage of this class is that it then throws a Euser_abort exception which properly terminates the libdar operation in the thread freeing allocated memory and release mutex properly. Note that the thread is not canceled but libdar call in this thread returns as soon as a checkpoint is met during the execution.
 
file  user_interaction.hpp
 defines the interaction between libdar and the user.Three classes are defined
 

Namespaces

 libdar
 libdar namespace encapsulate all libdar symbols
 

Classes

class  libdar::archive
 the archive class realizes the most general operations on archives More...
 
class  libdar::archive_options_read
 class holding optional parameters used to read an existing archive More...
 
class  libdar::archive_options_create
 class holding optional parameters used to create an archive More...
 
class  libdar::archive_options_isolate
 class holding optional parameters used to isolate an existing archive More...
 
class  libdar::archive_options_merge
 class holding optional parameters used to proceed to the merge operation More...
 
class  libdar::archive_options_extract
 class holding optional parameters used to extract files from an existing archive More...
 
class  libdar::archive_options_listing
 class holding optional parameters used to list the contents of an existing archive More...
 
class  libdar::archive_options_test
 class holding optional parameters used to test the structure coherence of an existing archive More...
 
class  libdar::crit_action
 the global action for overwriting More...
 
class  libdar::crit_constant_action
 the basic constant action More...
 
class  libdar::criterium
 the generic criterium class, parent of all criterium More...
 
class  libdar::testing
 the testing class binds criterium to actions More...
 
class  libdar::crit_chain
 the crit_chain class sequences crit_actions up to full definition of the action More...
 
class  libdar::crit_in_place_is_inode
 returns true if the first entry is an inode (whatever is the second) More...
 
class  libdar::crit_in_place_is_dir
 returns true if the first entry is a directory (whatever is the second) More...
 
class  libdar::crit_in_place_is_file
 returns true if the first entry is a plain file (whatever is the second) More...
 
class  libdar::crit_in_place_is_hardlinked_inode
 returns true if the first entry is a inode with several hard links (whatever is the second entry) More...
 
class  libdar::crit_in_place_is_new_hardlinked_inode
 returns true if the first entry is a inode with several hard links (whatever is the second entry) and also if this first entry is the first we meet that points to this hard linked inode More...
 
class  libdar::crit_in_place_data_more_recent
 returns true if the data of the first entry is more recent or of the same date of the one of the second entry More...
 
class  libdar::crit_in_place_data_more_recent_or_equal_to
 returns true if the data of the first entry is more recent or of the same date as the fixed date given in argument to the constructor More...
 
class  libdar::crit_in_place_data_bigger
 returns true if the data of the first entry is bigger or equal to the one of the second entry More...
 
class  libdar::crit_in_place_data_saved
 returns true if the data of the first entry is saved int the archive (not marked as unchanged since the archive of reference) More...
 
class  libdar::crit_in_place_data_dirty
 return true if the entry is a dirty file (or hard linked dirty file) More...
 
class  libdar::crit_in_place_data_sparse
 return true if the entry is a sparse file (or hard linked sparse file) More...
 
class  libdar::crit_in_place_EA_present
 
class  libdar::crit_in_place_EA_more_recent
 returns true if the EA of the first entry is more recent or equal to the one of the second entry More...
 
class  libdar::crit_in_place_EA_more_recent_or_equal_to
 returns true if the EA of the first entry is more recent or equal to the fixed date given in argument to the constructor More...
 
class  libdar::crit_in_place_more_EA
 returns true if the first entry has more or even EA (in number not in size) than the second entry More...
 
class  libdar::crit_in_place_EA_bigger
 returns true if the space used by EA of the first entry is greater or equal to the space used by the EA of the second entry (no EA means 0 byte for EA storage) More...
 
class  libdar::crit_in_place_EA_saved
 returns true if the in place entry has its EA saved (not just marked as saved) in the archve of reference More...
 
class  libdar::crit_same_type
 returns true if the two entries are of the same type (plain-file/char dev/block dev/named pipe/symlink/directory/unix socket) More...
 
class  libdar::crit_not
 realises the negation of the criterium given in argument to its constructor More...
 
class  libdar::crit_and
 realises the AND operator More...
 
class  libdar::database
 the database class defines the dar_manager database More...
 
class  libdar::database_open_options
 
class  libdar::Egeneric
 this is the parent class of all exception classes. More...
 
class  libdar::Ememory
 exception used when memory has been exhausted More...
 
class  libdar::Esecu_memory
 exception used when secure memory has been exhausted More...
 
class  libdar::Ebug
 exception used to signal a bug. A bug is triggered when reaching some code that should never be reached More...
 
class  libdar::Einfinint
 exception used when arithmetic error is detected when operating on infinint More...
 
class  libdar::Elimitint
 exception used when a limitint overflow is detected, the maximum value of the limitint has been exceeded More...
 
class  libdar::Erange
 exception used to signal range error More...
 
class  libdar::Edeci
 exception used to signal convertion problem between infinint and string (decimal representation) More...
 
class  libdar::Efeature
 exception used when a requested feature is not (yet) implemented More...
 
class  libdar::Ehardware
 exception used when hardware problem is found More...
 
class  libdar::Euser_abort
 exception used to signal that the user has aborted the operation More...
 
class  libdar::Edata
 exception used when an error concerning the treated data has been met More...
 
class  libdar::Escript
 exception used when error the inter-slice user command returned an error code More...
 
class  libdar::Elibcall
 exception used to signal an error in the argument given to libdar call of the API More...
 
class  libdar::Ecompilation
 exception used when a requested fearture has not beed activated at compilation time More...
 
class  libdar::Ethread_cancel
 exception used when the thread libdar is running in is asked to stop More...
 
class  libdar::list_entry
 
class  libdar::mask
 the generic class, parent of all masks More...
 
class  libdar::bool_mask
 boolean mask, either always true or false More...
 
class  libdar::simple_mask
 matches as done on shell command lines (see "man 7 glob") More...
 
class  libdar::regular_mask
 matches regular expressions (see "man 7 regex") More...
 
class  libdar::not_mask
 negation of another mask More...
 
class  libdar::et_mask
 makes an AND operator between two or more masks More...
 
class  libdar::ou_mask
 makes the OR operator between two or more masks More...
 
class  libdar::simple_path_mask
 string matches if it is subdir of mask or mask is a subdir of expression More...
 
class  libdar::same_path_mask
 matches if string is exactly the given mask (no wilde card expression) More...
 
class  libdar::exclude_dir_mask
 matches if string is the given constructor string or a sub directory of it More...
 
class  libdar::mask_list
 
class  libdar::path
 the class path is here to manipulate paths in the Unix notation: using'/' More...
 
class  libdar::statistics
 structure returned by libdar call to give a summary of the operation done in term of file treated More...
 
class  libdar::user_interaction
 This is a pure virtual class that is used by libdar when interaction with the user is required. More...
 
class  libdar::user_interaction_callback
 full implemented class for user_interaction based on callback functions. More...
 
class  libdar::user_interaction_blind
 full implementation class for user_interaction, which shows nothing and assumes answer "no" to any question More...
 

Macros

#define SRC_BUG   Ebug(__FILE__, __LINE__)
 
#define LIBDAR_XXXXXXXX
 The following macro are used in the "exception" argument of the *_noexcept() functions.
 
#define LIBDAR_NOEXCEPT   0
 normal return no exception has been thrown
 
#define LIBDAR_EMEMORY   1
 memory has been exhausted
 
#define LIBDAR_EBUG   2
 internal bug error.
 
#define LIBDAR_EINFININT   3
 division by zero or other arithmetic error
 
#define LIBDAR_ELIMITINT   4
 limitint overflow
 
#define LIBDAR_ERANGE   5
 range error
 
#define LIBDAR_EDECI   6
 decimal representation error
 
#define LIBDAR_EFEATURE   7
 feature not (yet) implemented
 
#define LIBDAR_EHARDWARE   8
 hardware failure
 
#define LIBDAR_EUSER_ABORT   9
 user has aborted the operation
 
#define LIBDAR_EDATA   10
 data inconsistency, error concerning the treated data
 
#define LIBDAR_ESCRIPT   11
 inter slice script failure
 
#define LIBDAR_ELIBCALL   12
 libdar invalid call (wrong argument given to call, etc.)
 
#define LIBDAR_UNKNOWN   13
 unknown error
 
#define LIBDAR_ECOMPILATION   14
 feature not activated at compilation time
 
#define LIBDAR_THREAD_CANCEL   15
 thread cancellation has been requested
 

Enumerations

enum  libdar::compression { libdar::none = 'n', libdar::gzip = 'z', libdar::bzip2 = 'y', libdar::lzo = 'l' }
 the different compression algorithm available More...
 
enum  libdar::over_action_data {
  data_preserve, data_overwrite, data_preserve_mark_already_saved, data_overwrite_mark_already_saved,
  data_remove, data_undefined, data_ask
}
 the possible actions for overwriting data
 
enum  libdar::over_action_ea {
  EA_preserve, EA_overwrite, EA_clear, EA_preserve_mark_already_saved,
  EA_overwrite_mark_already_saved, EA_merge_preserve, EA_merge_overwrite, EA_undefined,
  EA_ask
}
 the possible action for overwriting EA
 
enum  libdar::crypto_algo {
  libdar::crypto_none, libdar::crypto_scrambling, libdar::crypto_blowfish, libdar::crypto_aes256,
  libdar::crypto_twofish256, libdar::crypto_serpent256, libdar::crypto_camellia256
}
 the different cypher available for encryption (strong or weak) More...
 
enum  libdar::hash_algo { hash_none, hash_md5, hash_sha1 }
 

Functions

over_action_ea libdar::crit_ask_user_for_EA_action (user_interaction &dialog, const std::string &full_name, const entree *already_here, const entree *dolly)
 ask user for EA action More...
 
over_action_data libdar::crit_ask_user_for_data_action (user_interaction &dialog, const std::string &full_name, const entree *already_here, const entree *dolly)
 ask user for Data action More...
 
void libdar::crit_show_entry_info (user_interaction &dialog, const std::string &full_name, const entree *already_here, const entree *dolly)
 show information suited for user comparison and decision for entry in conflict More...
 
const char * libdar::dar_gettext (const char *)
 a routine to change NLS domaine forth and back for inline routines
 
void libdar::get_version (U_I &major, U_I &medium, U_I &minor, bool init_libgcrypt=true)
 return the libdar version, and make libdar initialization (may throw Exceptions) More...
 
void libdar::get_version_noexcept (U_I &major, U_I &medium, U_I &minor, U_16 &exception, std::string &except_msg, bool init_libgcrypt=true)
 return the libdar version, and make libdar initialization (does not throw exceptions) More...
 
void libdar::close_and_clean ()
 
archivelibdar::open_archive_noexcept (user_interaction &dialog, const path &chem, const std::string &basename, const std::string &extension, const archive_options_read &options, U_16 &exception, std::string &except_msg)
 this is a wrapper around the archive constructor known as the "read" constructor More...
 
archivelibdar::create_archive_noexcept (user_interaction &dialog, const path &fs_root, const path &sauv_path, const std::string &filename, const std::string &extension, const archive_options_create &options, statistics *progressive_report, U_16 &exception, std::string &except_msg)
 this is a wrapper around the archive constructor known as the "create" constructor More...
 
archivelibdar::isolate_archive_noexcept (user_interaction &dialog, const path &sauv_path, archive *ref_arch, const std::string &filename, const std::string &extension, const archive_options_isolate &options, U_16 &exception, std::string &except_msg)
 this is a wrapper around the archive constructor known as the "isolate" constructor More...
 
archivelibdar::merge_archive_noexcept (user_interaction &dialog, const path &sauv_path, archive *ref_arch1, const std::string &filename, const std::string &extension, const archive_options_merge &options, statistics *progressive_report, U_16 &exception, std::string &except_msg)
 this is a wrapper around the archive constructor known as the "merging" constructor More...
 
void libdar::close_archive_noexcept (archive *ptr, U_16 &exception, std::string &except_msg)
 this is wrapper around the archive destructor More...
 
statistics libdar::op_extract_noexcept (user_interaction &dialog, archive *ptr, const path &fs_root, const archive_options_extract &options, statistics *progressive_report, U_16 &exception, std::string &except_msg)
 this is wrapper around the op_extract method More...
 
void libdar::op_listing_noexcept (user_interaction &dialog, archive *ptr, const archive_options_listing &options, U_16 &exception, std::string &except_msg)
 this is wrapper around the op_listing method More...
 
statistics libdar::op_diff_noexcept (user_interaction &dialog, archive *ptr, const path &fs_root, const archive_options_diff &options, statistics *progressive_report, U_16 &exception, std::string &except_msg)
 this is wrapper around the op_diff method More...
 
statistics libdar::op_test_noexcept (user_interaction &dialog, archive *ptr, const archive_options_test &options, statistics *progressive_report, U_16 &exception, std::string &except_msg)
 this is wrapper around the op_test method More...
 
bool libdar::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 More...
 
char * libdar::libdar_str2charptr_noexcept (const std::string &x, U_16 &exception, std::string &except_msg)
 routine provided to convert std::string to char * More...
 

Variables

const U_I libdar::LIBDAR_COMPILE_TIME_MAJOR = 5
 libdar Major version defined at compilation time
 
const U_I libdar::LIBDAR_COMPILE_TIME_MEDIUM = 6
 libdar Medium version defined at compilation time
 
const U_I libdar::LIBDAR_COMPILE_TIME_MINOR = 7
 libdar Minor version defined at compilation time
 

Detailed Description

APlication Interface.

This gather all symbols that may be accessed from an external program. Other symbols are not as much documented, and may change or be removed without any warning or backward compatibility support. So only use the function, macro, types, classes... defined as member of the API module in you external programs.

Enumeration Type Documentation

§ compression

the different compression algorithm available

values to be used as argument of libdar API calls

Enumerator
none 

no compression

gzip 

gzip compression

bzip2 

bzip2 compression

lzo 

lzo compression

Definition at line 43 of file compressor.hpp.

§ crypto_algo

the different cypher available for encryption (strong or weak)

values to be used as argument of libdar API calls

Enumerator
crypto_none 

no encryption

crypto_scrambling 

scrambling weak encryption

crypto_blowfish 

blowfish strong encryption

crypto_aes256 

AES 256 strong encryption.

crypto_twofish256 

twofish 256 strong encryption

crypto_serpent256 

serpent 256 strong encryption

crypto_camellia256 

camellia 256 strong encryption

Definition at line 53 of file crypto.hpp.

§ hash_algo

the available hashing algorithms

Definition at line 54 of file hash_fichier.hpp.

Function Documentation

§ close_archive_noexcept()

void libdar::close_archive_noexcept ( archive ptr,
U_16 &  exception,
std::string &  except_msg 
)

this is wrapper around the archive destructor

check the archive class for details for an explaination of the two extra arguments exception and except_msg check the get_version_noexcept function

§ create_archive_noexcept()

archive* libdar::create_archive_noexcept ( user_interaction dialog,
const path fs_root,
const path sauv_path,
const std::string &  filename,
const std::string &  extension,
const archive_options_create options,
statistics progressive_report,
U_16 &  exception,
std::string &  except_msg 
)

this is a wrapper around the archive constructor known as the "create" constructor

check the archive class for details for an explaination of the two extra arguments exception and except_msg check the get_version_noexcept function

§ crit_ask_user_for_data_action()

over_action_data libdar::crit_ask_user_for_data_action ( user_interaction dialog,
const std::string &  full_name,
const entree already_here,
const 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

Referenced by libdar::crit_and::clone().

§ crit_ask_user_for_EA_action()

over_action_ea libdar::crit_ask_user_for_EA_action ( user_interaction dialog,
const std::string &  full_name,
const entree already_here,
const 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

Referenced by libdar::crit_and::clone().

§ crit_show_entry_info()

void libdar::crit_show_entry_info ( user_interaction dialog,
const std::string &  full_name,
const entree already_here,
const 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'

Referenced by libdar::crit_and::clone().

§ get_children_of_noexcept()

bool libdar::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

check the archive class for details for an explaination of the two extra arguments exception and except_msg check the get_version_noexcept function

§ get_version()

void libdar::get_version ( U_I &  major,
U_I &  medium,
U_I &  minor,
bool  init_libgcrypt = true 
)

return the libdar version, and make libdar initialization (may throw Exceptions)

It is mandatory to call this function (or another one of the get_version* family)

Parameters
[out]majorthe major number of the version
[out]mediumthe medium number of the version
[out]minorthe minor number of the version
[in]init_libgcryptwhether to initialize libgcrypt if not already done (not used if libcrypt is not linked with libdar)
Note
the calling application must match that the major function is the same as the libdar used at compilation time. See API tutorial for a sample code.

§ get_version_noexcept()

void libdar::get_version_noexcept ( U_I &  major,
U_I &  medium,
U_I &  minor,
U_16 &  exception,
std::string &  except_msg,
bool  init_libgcrypt = true 
)

return the libdar version, and make libdar initialization (does not throw exceptions)

It is mandatory to call this function (or another one of the get_version* family)

Parameters
[out]majorthe major number of the version
[out]mediumthe medium number of the version
[out]minorthe minor number of the version
[out]exceptionis to be compared with the LIBDAR_* macro to know whether the call succeeded
[out]except_msgin case exception is not equal to LIBDAR_NOEXCEPT this argument contains
[in]init_libgcryptwhether to initialize libgcrypt if not already done (not used if libcrypt is not linked with libdar) a human readable explaination of the error met.
Note
the calling application must match that the major function is the same as the libdar used at compilation time. See API tutorial for a sample code.

§ isolate_archive_noexcept()

archive* libdar::isolate_archive_noexcept ( user_interaction dialog,
const path sauv_path,
archive ref_arch,
const std::string &  filename,
const std::string &  extension,
const archive_options_isolate options,
U_16 &  exception,
std::string &  except_msg 
)

this is a wrapper around the archive constructor known as the "isolate" constructor

check the archive class for details for an explaination of the two extra arguments exception and except_msg check the get_version_noexcept function

§ libdar_str2charptr_noexcept()

char* libdar::libdar_str2charptr_noexcept ( const std::string &  x,
U_16 &  exception,
std::string &  except_msg 
)

routine provided to convert std::string to char *

Parameters
[in]xthe string to convert
[out]exceptionthe return status of the call
[out]except_msgthe message taken from the caught exception in case of error for an explaination of the two last arguments exception and except_msg check the get_version_noexcept function
Returns
the address of a newly allocated memory which must be released calling the "delete []" operator when no more needed.
NULL in case of error

§ merge_archive_noexcept()

archive* libdar::merge_archive_noexcept ( user_interaction dialog,
const path sauv_path,
archive ref_arch1,
const std::string &  filename,
const std::string &  extension,
const archive_options_merge options,
statistics progressive_report,
U_16 &  exception,
std::string &  except_msg 
)

this is a wrapper around the archive constructor known as the "merging" constructor

check the archive class for details for an explaination of the two extra arguments exception and except_msg check the get_version_noexcept function

§ op_diff_noexcept()

statistics libdar::op_diff_noexcept ( user_interaction dialog,
archive ptr,
const path fs_root,
const archive_options_diff &  options,
statistics progressive_report,
U_16 &  exception,
std::string &  except_msg 
)

this is wrapper around the op_diff method

check the archive class for details for an explaination of the two extra arguments exception and except_msg check the get_version_noexcept function

§ op_extract_noexcept()

statistics libdar::op_extract_noexcept ( user_interaction dialog,
archive ptr,
const path fs_root,
const archive_options_extract options,
statistics progressive_report,
U_16 &  exception,
std::string &  except_msg 
)

this is wrapper around the op_extract method

check the archive class for details for an explaination of the two extra arguments exception and except_msg check the get_version_noexcept function

§ op_listing_noexcept()

void libdar::op_listing_noexcept ( user_interaction dialog,
archive ptr,
const archive_options_listing options,
U_16 &  exception,
std::string &  except_msg 
)

this is wrapper around the op_listing method

check the archive class for details for an explaination of the two extra arguments exception and except_msg check the get_version_noexcept function

§ op_test_noexcept()

statistics libdar::op_test_noexcept ( user_interaction dialog,
archive ptr,
const archive_options_test options,
statistics progressive_report,
U_16 &  exception,
std::string &  except_msg 
)

this is wrapper around the op_test method

check the archive class for details for an explaination of the two extra arguments exception and except_msg check the get_version_noexcept function

§ open_archive_noexcept()

archive* libdar::open_archive_noexcept ( user_interaction dialog,
const path chem,
const std::string &  basename,
const std::string &  extension,
const archive_options_read options,
U_16 &  exception,
std::string &  except_msg 
)

this is a wrapper around the archive constructor known as the "read" constructor

check the archive class for details for an explaination of the two extra arguments exception and except_msg check the get_version_noexcept function