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; };
131 bool get_archive_offset_for_data(U_64 & val)
const {
return tools_infinint2U_64(offset_for_data, val) && !offset_for_data.is_zero(); };
132 std::string get_archive_offset_for_data()
const {
return offset_for_data.is_zero() ?
"" : deci(offset_for_data).human(); };
139 bool get_storage_size_for_data(U_64 & val)
const {
return tools_infinint2U_64(storage_size_for_data, val) && !storage_size_for_data.is_zero(); };
140 std::string get_storage_size_for_data()
const {
return storage_size_for_data.is_zero() ?
"" : deci(storage_size_for_data).human(); };
148 bool get_archive_offset_for_EA(U_64 & val)
const {
return tools_infinint2U_64(offset_for_EA, val) && !offset_for_EA.is_zero(); };
149 std::string get_archive_offset_for_EA()
const {
return offset_for_EA.is_zero() ?
"" : deci(offset_for_EA).human(); };
153 bool get_storage_size_for_EA(U_64 & val)
const {
return tools_infinint2U_64(storage_size_for_EA, val) && !storage_size_for_EA.is_zero(); };
154 std::string get_storage_size_for_EA()
const {
return storage_size_for_EA.is_zero() ?
"" : deci(storage_size_for_EA).human(); };
162 bool get_archive_offset_for_FSA(U_64 & val)
const {
return tools_infinint2U_64(offset_for_FSA, val) && !offset_for_FSA.is_zero(); };
163 std::string get_archive_offset_for_FSA()
const {
return offset_for_FSA.is_zero() ?
"" : deci(offset_for_FSA).human(); };
167 bool get_storage_size_for_FSA(U_64 & val)
const {
return tools_infinint2U_64(storage_size_for_FSA, val) && !storage_size_for_FSA.is_zero(); };
168 std::string get_storage_size_for_FSA()
const {
return storage_size_for_FSA.is_zero() ?
"" : deci(storage_size_for_FSA).human(); };
173 void set_name(
const std::string & val) { my_name = val; };
174 void set_type(
unsigned char val) { type = val; };
175 void set_hard_link(
bool val) { hard_link = val; };
176 void set_uid(
const infinint & val) { uid = val; };
177 void set_gid(
const infinint & val) { gid = val; };
178 void set_perm(U_16 val) { perm = val; };
179 void set_last_access(
const datetime & val) { last_access = val; };
180 void set_last_modif(
const datetime & val) { last_modif = val; };
181 void set_saved_status(saved_status val) { data_status = val; };
182 void set_ea_status(cat_inode::ea_status val) { ea_status = val; };
183 void set_last_change(
const datetime & val) { last_change = val; };
184 void set_fsa_status(cat_inode::fsa_status val) { fsa_status = val; };
185 void set_file_size(
const infinint & val) { file_size = val; };
186 void set_storage_size(
const infinint & val) { storage_size = val; };
187 void set_is_sparse_file(
bool val) { sparse_file = val; };
188 void set_compression_algo(
compression val) { compression_algo = val; };
189 void set_dirtiness(
bool val) { dirty = val; };
190 void set_link_target(
const std::string & val) { target = val; };
191 void set_major(
int val) { major = val; };
192 void set_minor(
int val) { minor = val; };
193 void set_slices(
const range & sl) { slices = sl; };
194 void set_archive_offset_for_data(
const infinint & val) { offset_for_data = val; };
195 void set_storage_size_for_data(
const infinint & val) { storage_size_for_data = val; };
196 void set_archive_offset_for_EA(
const infinint & val) { offset_for_EA = val; };
197 void set_storage_size_for_EA(
const infinint & val) { storage_size_for_EA = val; };
198 void set_archive_offset_for_FSA(
const infinint & val) { offset_for_FSA = val; };
199 void set_storage_size_for_FSA(
const infinint & val) { storage_size_for_FSA = val; };
208 datetime last_access;
210 saved_status data_status;
211 cat_inode::ea_status ea_status;
212 datetime last_change;
213 cat_inode::fsa_status fsa_status;
215 infinint storage_size;
223 infinint offset_for_data;
224 infinint storage_size_for_data;
225 infinint offset_for_EA;
226 infinint storage_size_for_EA;
227 infinint offset_for_FSA;
228 infinint storage_size_for_FSA;
230 static time_t datetime2time_t(
const datetime & val);
bool get_storage_size_for_EA(infinint &val) const
amount of byte used to store the file's EA
bool get_archive_offset_for_FSA(infinint &val) const
are defined here basic integer types that tend to be portable
decimal class, convert infinint from and to decimal represention
bool get_storage_size_for_data(infinint &val) const
bool get_storage_size_for_FSA(infinint &val) const
amount of byte used to store the file's FSA
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) ...
bool get_archive_offset_for_data(infinint &val) const
bool get_archive_offset_for_EA(infinint &val) const
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