 |
Disk ARchive
2.6.8
Full featured and portable backup and archiving tool
|
Go to the documentation of this file.
26 #ifndef FILESYSTEM_SPECIFIC_ATTRIBUTE_HPP
27 #define FILESYSTEM_SPECIFIC_ATTRIBUTE_HPP
29 #include "../my_config.h"
34 #include <sys/types.h>
110 virtual std::string
show_val()
const = 0;
122 void set_family(
const fsa_family & val) { fam = val; };
123 void set_nature(
const fsa_nature & val) { nat = val; };
165 const std::string & target,
168 bool auto_zeroing_neg_dates);
183 bool set_linux_immutable)
const;
186 bool empty()
const {
return fsa.empty(); };
190 U_I
size()
const {
return fsa.size(); };
214 std::deque<filesystem_specific_attribute *> fsa;
218 void update_familes();
222 void fill_extX_FSA_with(
const std::string & target, mode_t itype);
224 const std::string & target,
226 bool auto_zeroing_neg_dates);
234 const std::string & target,
235 bool set_immutable)
const;
240 static std::string family_to_signature(
fsa_family f);
241 static std::string nature_to_signature(
fsa_nature n);
242 static fsa_family signature_to_family(
const std::string & sig);
243 static fsa_nature signature_to_nature(
const std::string & sig);
248 template <
class T> T *cloner(
const T *x)
252 T *ret =
new (std::nothrow) T(*x);
254 throw Ememory(
"cloner template");
261 class fsa_bool :
public filesystem_specific_attribute
266 fsa_bool(
const fsa_bool & ref) =
default;
267 fsa_bool & operator = (
const fsa_bool & ref) =
default;
268 ~fsa_bool() =
default;
270 bool get_value()
const {
return val; };
273 virtual std::string show_val()
const {
return val ? gettext(
"true") : gettext(
"false"); };
274 virtual void write(generic_file & f)
const { f.write(val ?
"T" :
"F", 1); };
275 virtual infinint storage_size()
const {
return 1; };
279 virtual bool equal_value_to(
const filesystem_specific_attribute & ref)
const;
298 const infinint & get_value()
const {
return val; };
301 virtual std::string
show_val()
const;
326 const datetime & get_value()
const {
return val; };
329 virtual std::string
show_val()
const;
U_I size() const
access to members of the list
void dump(generic_file &x) const
write down this to file
fsa_nature get_nature() const
obtain the nature of the FSA
This is a pure virtual class that is used by libdar when interaction with the user is required.
filesystem_specific_attribute(generic_file &f, fsa_family xfam, fsa_nature xnat)
constructor used to read a FSA from a libdar archive
virtual infinint storage_size() const =0
give the storage size for the FSA
virtual bool equal_value_to(const filesystem_specific_attribute &ref) const =0
should return true if the value of the argument is equal to the one of 'this' false in any other case...
virtual void write(generic_file &f) const =0
write down to libdar archive
are defined here basic integer types that tend to be portable
void write(generic_file &f) const
write FSA list to archive
bool is_included_in(const filesystem_specific_attribute_list &ref, const fsa_scope &scope) const
compare two lists of FSA to see whether they have equal FSA with identical values within the given fa...
bool find(fsa_family fam, fsa_nature nat, const filesystem_specific_attribute *&ptr) const
look for the FSA of given familly and nature
the arbitrary large positive integer class
void add(const filesystem_specific_attribute &fsa)
add an fsa to the list
virtual bool equal_value_to(const filesystem_specific_attribute &ref) const
should return true if the value of the argument is equal to the one of 'this' false in any other case...
this file contains the definition of class datetime that stores unix times in a portable way
virtual void write(generic_file &f) const
write down to libdar archive
const filesystem_specific_attribute & operator[](U_I arg) const
provide reference to FSA given its index
virtual filesystem_specific_attribute * clone() const =0
provides a way to copy objects without having to know the more specific class of the object
virtual filesystem_specific_attribute * clone() const
provides a way to copy objects without having to know the more specific class of the object
class archive_version manages the version of the archive format
infinint get_storage_size() const noexcept
it returns number of byte of information necessary to store the integer
virtual bool equal_value_to(const filesystem_specific_attribute &ref) const
should return true if the value of the argument is equal to the one of 'this' false in any other case...
virtual infinint storage_size() const
give the storage size for the FSA
virtual bool operator==(const filesystem_specific_attribute &ref) const
provides a mean to compare objects values
class generic_file is defined here as well as class fichier
filesystem_specific_attribute(fsa_family f)
constructor used to before reading the FSA from filesystem
virtual filesystem_specific_attribute * clone() const
provides a way to copy objects without having to know the more specific class of the object
virtual ~filesystem_specific_attribute() noexcept(false)
virtual destructor for inherited classes
virtual std::string show_val() const =0
provides a human readable value of the FSA
virtual infinint storage_size() const
give the storage size for the FSA
this is the interface class from which all other data transfer classes inherit
void clear()
clear all attributes
bool has_linux_immutable_set() const
return true if this FSA_list contains linux FSA with the immutable attribute set to true
bool set_fsa_to_filesystem_for(const std::string &target, const fsa_scope &scope, user_interaction &ui, bool set_linux_immutable) const
fsa_family get_family() const
obtain the family of the FSA
virtual std::string show_val() const
inherited from filesystem_specific_attribute
void get_fsa_from_filesystem_for(user_interaction &ui, const std::string &target, const fsa_scope &scope, mode_t itype, bool auto_zeroing_neg_dates)
read FSA list from filesystem
bool is_same_type_as(const filesystem_specific_attribute &ref) const
provide a mean to compare objects types
filesystem specific attributes available families and fsa_scope definition
infinint get_storage_size() const
return the storage it would require to dump this object
filesystem_specific_attribute_list operator+(const filesystem_specific_attribute_list &arg) const
addition operator
bool operator<(const filesystem_specific_attribute &ref) const
used to provided a sorted list of FSA
Filesystem Specific Attributes (FSA) class.
bool set_hfs_FSA_to(user_interaction &ui, const std::string &target) const
fsa_scope get_fsa_families() const
gives the set of FSA family present in the list
interface to fileystem for FSA
void read(generic_file &f, archive_version ver)
read FSA list from archive
virtual void write(generic_file &f) const
write down to libdar archive
bool empty() const
whether the list has at least one FSA
bool set_extX_FSA_to(user_interaction &ui, const std::string &target, bool set_immutable) const
std::set< fsa_family > fsa_scope
set of fsa families
infinint storage_size() const
give the storage size for the EA
libdar namespace encapsulate all libdar symbols
virtual std::string show_val() const
inherited from filesystem_specific_attribute