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

class implementing the dar_xform feature More...

#include <i_libdar_xform.hpp>

+ Inheritance diagram for libdar::libdar_xform::i_libdar_xform:
+ Collaboration diagram for libdar::libdar_xform::i_libdar_xform:

Public Member Functions

 i_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...
 
 i_libdar_xform (const std::shared_ptr< user_interaction > &dialog, const std::string &pipename)
 the archive to transform is read from a named pipe More...
 
 i_libdar_xform (const std::shared_ptr< user_interaction > &dialog, int filedescriptor)
 < if pipename is set to "-" reading from standard input More...
 
 i_libdar_xform (const i_libdar_xform &ref)=delete
 copy constructor is not allowed
 
 i_libdar_xform (i_libdar_xform &&ref) noexcept=default
 move constructor
 
i_libdar_xformoperator= (const i_libdar_xform &ref)=delete
 assignment operator is not allowed
 
i_libdar_xformoperator= (i_libdar_xform &&ref) noexcept=default
 move assignment operator
 
 ~i_libdar_xform ()=default
 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...
 
- Public Member Functions inherited from libdar::mem_ui
 mem_ui (const std::shared_ptr< user_interaction > &dialog)
 constructor More...
 
 mem_ui (const mem_ui &ref)=default
 the copy constructor More...
 
 mem_ui (mem_ui &&ref) noexcept=default
 the move constructor
 
mem_uioperator= (const mem_ui &ref)=default
 assignement operator More...
 
mem_uioperator= (mem_ui &&ref) noexcept=default
 move operator
 
virtual ~mem_ui () noexcept(false)
 destructor More...
 

Private Member Functions

void init_entrep ()
 
void xform_to (generic_file *dst)
 

Private Attributes

bool can_xform
 
std::unique_ptr< generic_filesource
 
std::unique_ptr< pathsrc_path
 may be null when reading from a pipe
 
std::shared_ptr< entrepot_localentrep_src
 
std::shared_ptr< entrepot_localentrep_dst
 
bool format_07_compatible
 
label dataname
 

Additional Inherited Members

- Protected Member Functions inherited from libdar::mem_ui
user_interactionget_ui () const
 get access to the user_interaction object More...
 
std::shared_ptr< user_interactionget_pointer () const
 get access to the shared_ptr pointing to the user_interaction
 

Detailed Description

class implementing the dar_xform feature

Definition at line 44 of file i_libdar_xform.hpp.

Constructor & Destructor Documentation

◆ i_libdar_xform() [1/3]

libdar::libdar_xform::i_libdar_xform::i_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()

◆ i_libdar_xform() [2/3]

libdar::libdar_xform::i_libdar_xform::i_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)

◆ i_libdar_xform() [3/3]

libdar::libdar_xform::i_libdar_xform::i_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::i_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::i_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: