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

class implementing the dar_xform feature More...

#include <libdar_xform.hpp>

+ Collaboration diagram for libdar::libdar_xform:

Classes

class  i_libdar_xform
 class implementing the dar_xform feature More...
 

Public Member Functions

 libdar_xform (const std::shared_ptr< user_interaction > &ui, const std::string &chem, const std::string &basename, const std::string &extension, const infinint &min_digits, const std::string &execute)
 the archive to transform is read from a set of slices More...
 
 libdar_xform (const std::shared_ptr< user_interaction > &dialog, const std::string &pipename)
 the archive to transform is read from a named pipe More...
 
 libdar_xform (const std::shared_ptr< user_interaction > &dialog, int filedescriptor)
 < if pipename is set to "-" reading from standard input More...
 
 libdar_xform (const libdar_xform &ref)=delete
 copy constructor is not allowed
 
 libdar_xform (libdar_xform &&ref) noexcept
 move constructor
 
libdar_xformoperator= (const libdar_xform &ref)=delete
 assignment operator is not allowed
 
libdar_xformoperator= (libdar_xform &&ref) noexcept
 move assignment operator
 
 ~libdar_xform ()
 destructor
 
void xform_to (const std::string &path, const std::string &basename, const std::string &extension, bool allow_over, bool warn_over, const infinint &pause, const infinint &first_slice_size, const infinint &slice_size, const std::string &slice_perm, const std::string &slice_user, const std::string &slice_group, hash_algo hash, const infinint &min_digits, const std::string &execute)
 the resulting archive is a written to disk possibly multi-sliced More...
 
void xform_to (int filedescriptor, const std::string &execute)
 the resulting archive is a single sliced archive sent to a filedescriptor More...
 

Private Attributes

std::unique_ptr< i_libdar_xformpimpl
 

Detailed Description

class implementing the dar_xform feature

Definition at line 44 of file libdar_xform.hpp.

Constructor & Destructor Documentation

◆ libdar_xform() [1/3]

libdar::libdar_xform::libdar_xform ( const std::shared_ptr< user_interaction > &  ui,
const std::string &  chem,
const std::string &  basename,
const std::string &  extension,
const infinint min_digits,
const std::string &  execute 
)

the archive to transform is read from a set of slices

Parameters
[in]uifor user interaction, may be set to std::nullptr
[in]chemthe path where resides the archive
[in]basenamethe basename of the archive
[in]extensionshould be set to "dar" as always
[in]min_digitsthe way slice number is written in files, use 0 if this feature was not used at creation time
[in]executecommand to execute before each new slice same substitution is available as archive_options_create::set_execute()

◆ libdar_xform() [2/3]

libdar::libdar_xform::libdar_xform ( const std::shared_ptr< user_interaction > &  dialog,
const std::string &  pipename 
)

the archive to transform is read from a named pipe

Parameters
[in]dialogfor user interaction, may be set to std::nullptr
[in]pipenamenamed pipe where to read the archive from (single sliced one)

◆ libdar_xform() [3/3]

libdar::libdar_xform::libdar_xform ( const std::shared_ptr< user_interaction > &  dialog,
int  filedescriptor 
)

< if pipename is set to "-" reading from standard input

the archive to transform is read from a file descriptor open in read mode

Parameters
[in]dialogfor user interaction, may be set to std::nullptr
[in]filedescriptorthe filedescriptor to reading the archive from

Member Function Documentation

◆ xform_to() [1/2]

void libdar::libdar_xform::xform_to ( const std::string &  path,
const std::string &  basename,
const std::string &  extension,
bool  allow_over,
bool  warn_over,
const infinint pause,
const infinint first_slice_size,
const infinint slice_size,
const std::string &  slice_perm,
const std::string &  slice_user,
const std::string &  slice_group,
hash_algo  hash,
const infinint min_digits,
const std::string &  execute 
)

the resulting archive is a written to disk possibly multi-sliced

Parameters
[in]pathdirectory where to write the new archive to
[in]basenamearchive base name to create
[in]extensionshould be set to "dar" as always
[in]allow_overwhether to allow slice overwriting
[in]warn_overwhether to warn before overwriting a slice
[in]pausethe number of slice to pause asking the user for continuation. Set to zero to disable pausing
[in]first_slice_sizesize of the first slice if different of the other. Set to zero to have the first slice having the same size as others
[in]slice_sizesize of slices (except the first slice which may be different). set to zero if slicing is not wanted
[in]slice_permnumber written in octal corresponding to the permission of slices to create. if set to an empty string the slice permission will not be overriden and will follow the umask() value
[in]slice_useruser name or UID to assign slice to. Assuming the process has the permission/capabilities to change UID of files
[in]slice_groupgroup name or GID to assign slice to. Assuming the process has the permission/capabilities to change GID of files
[in]hashhashing algorithm to rely on generate hash file for each slice. Use libdar::hash_algo::hash_none to disable this feature
[in]min_digitsnumbering of slices in filename should be padded by as much zero to have no less than this number of digit. Use zero to disable this feature
[in]executecommand to execute after each slice has been completed. Same substitution is available as archive_options_create::set_execute

◆ xform_to() [2/2]

void libdar::libdar_xform::xform_to ( int  filedescriptor,
const std::string &  execute 
)

the resulting archive is a single sliced archive sent to a filedescriptor

Parameters
[in]filedescriptorfile descriptor open in write mode to write the archive to
[in]executecommand to execute after the archive has been completed. same string substitution available as described in other xform_to method

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