27 #ifndef LIST_ENTRY_HPP 28 #define LIST_ENTRY_HPP 33 #include "../my_config.h" 63 const std::string & get_name()
const {
return my_name; };
64 unsigned char get_type()
const {
return type; };
65 bool is_dir()
const {
return type ==
'd'; };
66 bool is_file()
const {
return type ==
'f'; };
67 bool is_symlink()
const {
return type ==
'l'; };
68 bool is_char_device()
const {
return type ==
'c'; };
69 bool is_block_device()
const {
return type ==
'b'; };
70 bool is_unix_socket()
const {
return type ==
's'; };
71 bool is_named_pipe()
const {
return type ==
'p'; };
72 bool is_hard_linked()
const {
return hard_link; };
73 bool is_removed_entry()
const {
return type ==
'x'; };
74 bool is_door_inode()
const {
return type ==
'o'; };
76 bool has_data_present_in_the_archive()
const {
return data_status == s_saved; };
77 bool has_EA()
const {
return ea_status != cat_inode::ea_none && ea_status != cat_inode::ea_removed; };
78 bool has_EA_saved_in_the_archive()
const {
return ea_status == cat_inode::ea_full; };
79 bool has_FSA()
const {
return fsa_status != cat_inode::fsa_none; };
80 bool has_FSA_saved_in_the_archive()
const {
return fsa_status == cat_inode::fsa_full; };
82 std::string get_uid()
const {
return deci(uid).
human(); };
83 std::string get_gid()
const {
return deci(gid).
human(); };
85 std::string get_last_access()
const {
return last_access.is_null() ?
"" :
tools_display_date(last_access); };
86 std::string get_last_modif()
const {
return last_modif.is_null() ?
"" :
tools_display_date(last_modif); };
87 std::string get_last_change()
const {
return last_change.is_null() ?
"" :
tools_display_date(last_change); };
88 time_t get_last_access_s()
const {
return datetime2time_t(last_access); };
89 time_t get_last_modif_s()
const {
return datetime2time_t(last_modif); };
90 time_t get_last_change_s()
const {
return datetime2time_t(last_change); };
97 void get_last_access(datetime::time_unit tu, time_t & second, time_t & fraction)
const 98 { last_access.get_value(second, fraction, tu); }
101 void get_last_modif(datetime::time_unit tu, time_t & second, time_t & fraction)
const 102 { last_modif.get_value(second, fraction, tu); }
105 void get_last_change(datetime::time_unit tu, time_t & second, time_t & fraction)
const 106 { last_change.get_value(second, fraction, tu); }
108 std::string get_file_size()
const {
return deci(file_size).
human(); };
110 bool is_sparse()
const {
return sparse_file; };
111 std::string get_compression_algo()
const {
return compression2string(compression_algo); };
112 bool is_dirty()
const {
return dirty; };
113 std::string get_link_target()
const {
return target; };
114 std::string get_major()
const {
return tools_int2str(major); };
115 std::string get_minor()
const {
return tools_int2str(minor); };
116 const range & get_slices()
const {
return slices; };
121 void set_name(
const std::string & val) { my_name = val; };
122 void set_type(
unsigned char val) { type = val; };
123 void set_hard_link(
bool val) { hard_link = val; };
124 void set_uid(
const infinint & val) { uid = val; };
125 void set_gid(
const infinint & val) { gid = val; };
126 void set_perm(U_16 val) { perm = val; };
127 void set_last_access(
const datetime & val) { last_access = val; };
128 void set_last_modif(
const datetime & val) { last_modif = val; };
129 void set_saved_status(saved_status val) { data_status = val; };
130 void set_ea_status(cat_inode::ea_status val) { ea_status = val; };
131 void set_last_change(
const datetime & val) { last_change = val; };
132 void set_fsa_status(cat_inode::fsa_status val) { fsa_status = val; };
133 void set_file_size(
const infinint & val) { file_size = val; };
134 void set_storage_size(
const infinint & val) { storage_size = val; };
135 void set_is_sparse_file(
bool val) { sparse_file = val; };
136 void set_compression_algo(
compression val) { compression_algo = val; };
137 void set_dirtiness(
bool val) { dirty = val; };
138 void set_link_target(
const std::string & val) { target = val; };
139 void set_major(
int val) { major = val; };
140 void set_minor(
int val) { minor = val; };
141 void set_slices(
const range & sl) { slices = sl; };
150 datetime last_access;
152 saved_status data_status;
153 cat_inode::ea_status ea_status;
154 datetime last_change;
155 cat_inode::fsa_status fsa_status;
166 static time_t datetime2time_t(
const datetime & val);
are defined here basic integer types that tend to be portable
decimal class, convert infinint from and to decimal represention
void get_last_change(datetime::time_unit tu, time_t &second, time_t &fraction) const
yet an alternative method to get the last change date (see get_last_access() for details) ...
void get_last_modif(datetime::time_unit tu, time_t &second, time_t &fraction) const
yet an alternative method to get the last modification date (see get_last_access() for details) ...
void get_last_access(datetime::time_unit tu, time_t &second, time_t &fraction) const
switch module to limitint (32 ou 64 bits integers) or infinint
manages the decimal representation of infinint
compression
the different compression algorithm available
this file contains the definition of class datetime that stores unix times in a portable way ...
compression engine implementation
this is the base class of object that can be allocated on a memory pool
the arbitrary large positive integer class
class than provide a way to manipulate and represent range of integer numbers (infinint) ...
std::string human() const
this produce a string from the decimal stored in the current object
libdar namespace encapsulate all libdar symbols
here is defined the many classed which is build of the catalogue