Timestamp object. More...
#include <tstamp.h>
Public Types | |
enum | resolution_type { resolution_year, resolution_month, resolution_day, resolution_hour, resolution_minute, resolution_second } |
Public Member Functions | |
timestamp () | |
C'tor. | |
timestamp (const timestamp &a_t) | |
C'tor. | |
timestamp (const int a_year, const int a_month, const int a_day, const int a_hour, const int a_minute, const int a_second) | |
C'tor. | |
timestamp (const std::string &a_s) | |
C'tor. | |
void | set (void) |
Set the timestamp to the current time and date. | |
void | assign (const timestamp &a_t) |
Set the timestamp to the value of another timestamp. | |
void | assign (const int a_year, const int a_month, const int a_day, const int a_hour, const int a_minute, const int a_second) |
Set the timestamp. | |
void | assign (const std::string &a_s) |
Set the timestamp from a string. | |
void | clear (void) |
Clear the timestamp. | |
void | resolution (resolution_type a_r) |
Set the timestamp resolution. | |
resolution_type | resolution (void) const |
Return the timestamp resolution. | |
const std::string | str (void) const |
Generate a string. | |
const std::string | str (const resolution_type a_resolution) const |
Generate a string. | |
int | second (void) const |
Return the timestamp second. | |
int | minute (void) const |
Return the timestamp minute. | |
int | hour (void) const |
Return the timestamp hour. | |
int | day (void) const |
Return the timestamp day. | |
int | month (void) const |
Return the timestamp month. | |
int | year (void) const |
Return the timestamp year. | |
timestamp & | operator= (const timestamp &a_t) |
Assignment. | |
timestamp & | operator= (const std::string &a_s) |
Assignment. | |
bool | operator< (const timestamp &a_t) const |
Comparison. | |
bool | operator> (const timestamp &a_t) const |
Comparison. | |
bool | operator== (const timestamp &a_t) const |
Comparison. | |
Private Member Functions | |
const std::string | make_str_ (const int a_resolution) const |
Generate a string. | |
Private Attributes | |
int | m_year |
int | m_month |
int | m_day |
int | m_hour |
int | m_minute |
int | m_second |
resolution_type | m_resolution |
Timestamp object.
Definition at line 13 of file tstamp.h.
timestamp::timestamp | ( | void | ) |
timestamp::timestamp | ( | const timestamp & | a_t | ) |
timestamp::timestamp | ( | const int | a_year, | |
const int | a_month, | |||
const int | a_day, | |||
const int | a_hour, | |||
const int | a_minute, | |||
const int | a_second | |||
) |
timestamp::timestamp | ( | const std::string & | a_s | ) |
void timestamp::assign | ( | const std::string & | a_s | ) |
Set the timestamp from a string.
Definition at line 158 of file tstamp.cc.
References assign(), ERROR, is_timestamp(), resolution(), resolution_day, resolution_hour, resolution_minute, resolution_month, resolution_second, resolution_year, str(), TRY, and TRY_nomem.
void timestamp::assign | ( | const int | a_year, | |
const int | a_month, | |||
const int | a_day, | |||
const int | a_hour, | |||
const int | a_minute, | |||
const int | a_second | |||
) |
void timestamp::assign | ( | const timestamp & | a_t | ) |
Set the timestamp to the value of another timestamp.
Definition at line 79 of file tstamp.cc.
References day(), hour(), m_day, m_hour, m_minute, m_month, m_resolution, m_second, m_year, minute(), month(), resolution(), second(), and year().
Referenced by assign(), configuration_manager::init(), operator=(), test3(), and timestamp().
void timestamp::clear | ( | void | ) |
Clear the timestamp.
Definition at line 290 of file tstamp.cc.
References m_day, m_hour, m_minute, m_month, m_resolution, m_second, m_year, and resolution_day.
Referenced by timestamp().
int timestamp::day | ( | void | ) | const |
int timestamp::hour | ( | void | ) | const |
const std::string timestamp::make_str_ | ( | const int | a_resolution | ) | const [private] |
Generate a string.
Definition at line 308 of file tstamp.cc.
References estring::align(), day(), estring::fmt_str(), hour(), estring::left_fillchar(), minute(), month(), estring::reset(), resolution_day, resolution_hour, resolution_minute, resolution_month, resolution_second, resolution_year, estring::right, second(), str(), TRY, TRY_nomem, estring::width(), and year().
Referenced by str().
int timestamp::minute | ( | void | ) | const |
int timestamp::month | ( | void | ) | const |
bool timestamp::operator< | ( | const timestamp & | a_t | ) | const |
Comparison.
Definition at line 466 of file tstamp.cc.
References m_resolution, resolution(), and str().
timestamp & timestamp::operator= | ( | const std::string & | a_s | ) |
bool timestamp::operator== | ( | const timestamp & | a_t | ) | const |
Comparison.
Definition at line 490 of file tstamp.cc.
References m_resolution, resolution(), and str().
bool timestamp::operator> | ( | const timestamp & | a_t | ) | const |
Comparison.
Definition at line 478 of file tstamp.cc.
References m_resolution, resolution(), and str().
timestamp::resolution_type timestamp::resolution | ( | void | ) | const |
Return the timestamp resolution.
Definition at line 444 of file tstamp.cc.
References m_resolution.
Referenced by assign().
void timestamp::resolution | ( | timestamp::resolution_type | a_r | ) |
Set the timestamp resolution.
Definition at line 302 of file tstamp.cc.
References m_resolution.
Referenced by assign(), operator<(), operator==(), operator>(), global_parser::parse_timestamp_resolution(), test3(), and configuration_manager::timestamp_resolution().
int timestamp::second | ( | void | ) | const |
void timestamp::set | ( | void | ) |
Set the timestamp to the current time and date.
Definition at line 58 of file tstamp.cc.
References ERROR, m_day, m_hour, m_minute, m_month, m_resolution, m_second, m_year, and resolution_day.
Referenced by configuration_manager::clear(), and test2().
const std::string timestamp::str | ( | const resolution_type | a_resolution | ) | const |
Generate a string.
Definition at line 397 of file tstamp.cc.
References make_str_(), str(), and TRY_nomem.
const std::string timestamp::str | ( | void | ) | const |
Generate a string.
Definition at line 387 of file tstamp.cc.
References m_resolution, make_str_(), and TRY_nomem.
Referenced by archive_manager::archive_path(), assign(), vault_manager::delete_oldest_archive(), report_manager::file_report(), vault_report::format_synopsis(), log_manager::init(), archive_manager::init(), make_str_(), job_archiver::mf_do_chores(), operator<(), operator==(), operator>(), job_parser::parse_clear(), global_parser::parse_delete_old_log_files(), global_parser::parse_delete_old_report_files(), global_parser::parse_error_logging_level(), global_parser::parse_logging_level(), job_parser::parse_rsync_behavior(), job_parser::parse_rsync_connection_type(), job_parser::parse_rsync_hardlink(), job_parser::parse_rsync_multi_hardlink(), job_parser::parse_rsync_remote_port(), job_parser::parse_rsync_retry_count(), job_parser::parse_rsync_retry_delay(), job_parser::parse_rsync_timeout(), global_parser::parse_timestamp_resolution(), global_parser::parse_vault_locking(), global_parser::parse_vault_overflow_behavior(), global_parser::parse_vault_selection_behavior(), vault_manager::select(), str(), test(), test1(), and test_rvm().
int timestamp::year | ( | void | ) | const |
int timestamp::m_day [private] |
int timestamp::m_hour [private] |
int timestamp::m_minute [private] |
int timestamp::m_month [private] |
resolution_type timestamp::m_resolution [private] |
Definition at line 74 of file tstamp.h.
Referenced by assign(), clear(), operator<(), operator==(), operator>(), resolution(), set(), and str().
int timestamp::m_second [private] |
int timestamp::m_year [private] |