 |
Disk ARchive
2.6.8
Full featured and portable backup and archiving tool
|
Go to the documentation of this file.
32 #include <sys/types.h>
45 #include "../my_config.h"
54 class archive_version;
63 enum time_unit { tu_nanosecond, tu_microsecond, tu_second };
73 datetime(time_t second, time_t subsec, time_unit unit);
87 bool operator < (
const datetime & ref)
const;
88 bool operator == (
const datetime & ref)
const;
89 bool operator != (
const datetime & ref)
const {
return ! (*
this == ref); };
90 bool operator >= (
const datetime & ref)
const {
return ! (*
this < ref); };
91 bool operator > (
const datetime & ref)
const {
return ref < *
this; };
92 bool operator <= (
const datetime & ref)
const {
return ref >= *
this; };
95 void operator -= (
const datetime & ref);
96 void operator += (
const datetime & ref);
121 bool get_value(time_t & second, time_t & subsecond, time_unit unit)
const;
140 void nullify() { val = 0; uni = tu_second ; };
157 static time_unit min(time_unit a, time_unit b);
158 static time_unit max(time_unit a, time_unit b);
159 static const char time_unit_to_char(time_unit a);
160 static time_unit char_to_time_unit(
const char a);
void nullify()
set to null (zero)
void dump(generic_file &x) const
write down this to file
infinint get_second_value() const
return the integer number of second
void reduce_to_largest_unit() const
reduce the value to the largest unit possible
switch module to limitint (32 ou 64 bits integers) or infinint
the arbitrary large positive integer class
time_unit get_unit() const
returns the time unit used internally to store the subsecond time fraction
void read(generic_file &f, archive_version ver)
read this from file
class archive_version manages the version of the archive format
bool is_null() const
return true if the datetime is exactly January 1st, 1970, 0 h 0 mn 0 s
bool loose_equal(const datetime &ref) const
equivalent to operator == but if compared object use different time unit, do the comparison rounding ...
datetime(const infinint &value=0)
constructor based on the number of second ellasped since the end of 1969
bool is_integer_second() const
return true if the datetime is an integer number of second (subsecond part is zero)
bool get_value(time_t &second, time_t &subsecond, time_unit unit) const
return a time as time_t arguments
this is the interface class from which all other data transfer classes inherit
datetime loose_diff(const datetime &ref) const
at the difference of operator - provides the difference using the less precise unit used between the ...
infinint get_storage_size() const
return the storage it would require to dump this object
infinint get_subsecond_value(time_unit unit) const
return the subsecond time fraction expressed in the given time unit
static const infinint & get_scaling_factor(time_unit source, time_unit dest)
return the factor between two units
archive_version db2archive_version(unsigned char db_version)
converts dar_manager database version to dar archive version in order to properly read time fields
libdar namespace encapsulate all libdar symbols