timestamp Class Reference

Timestamp object. More...

#include <tstamp.h>

List of all members.

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.
timestampoperator= (const timestamp &a_t)
 Assignment.
timestampoperator= (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


Detailed Description

Timestamp object.

Definition at line 13 of file tstamp.h.


Member Enumeration Documentation

enum timestamp::resolution_type

Enumerator:
resolution_year 
resolution_month 
resolution_day 
resolution_hour 
resolution_minute 
resolution_second 

Definition at line 16 of file tstamp.h.


Constructor & Destructor Documentation

timestamp::timestamp (  ) 

C'tor.

Definition at line 23 of file tstamp.cc.

References clear(), and set().

Here is the call graph for this function:

timestamp::timestamp ( const timestamp a_t  ) 

C'tor.

Definition at line 30 of file tstamp.cc.

References assign(), and clear().

Here is the call graph for this function:

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 
)

C'tor.

Definition at line 37 of file tstamp.cc.

References assign(), and clear().

Here is the call graph for this function:

timestamp::timestamp ( const std::string &  a_s  ) 

C'tor.

Definition at line 51 of file tstamp.cc.

References assign(), and clear().

Here is the call graph for this function:


Member Function Documentation

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(), test2(), and timestamp().

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().

Here is the call graph for this function:

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 
)

Set the timestamp.

Definition at line 91 of file tstamp.cc.

References ERROR, m_day, m_hour, m_minute, m_month, m_second, m_year, and TRY_nomem.

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.

Here is the call graph for this function:

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().

void timestamp::resolution ( 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().

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().

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().

Here is the call graph for this function:

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.

Here is the call graph for this function:

int timestamp::second ( void   )  const

Return the timestamp second.

Definition at line 408 of file tstamp.cc.

References m_second.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

int timestamp::minute ( void   )  const

Return the timestamp minute.

Definition at line 414 of file tstamp.cc.

References m_minute.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

int timestamp::hour ( void   )  const

Return the timestamp hour.

Definition at line 420 of file tstamp.cc.

References m_hour.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

int timestamp::day ( void   )  const

Return the timestamp day.

Definition at line 426 of file tstamp.cc.

References m_day.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

int timestamp::month ( void   )  const

Return the timestamp month.

Definition at line 432 of file tstamp.cc.

References m_month.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

int timestamp::year ( void   )  const

Return the timestamp year.

Definition at line 438 of file tstamp.cc.

References m_year.

Referenced by assign(), make_str_(), test1(), test2(), and test3().

timestamp & timestamp::operator= ( const timestamp a_t  ) 

Assignment.

Definition at line 450 of file tstamp.cc.

References assign().

Here is the call graph for this function:

timestamp & timestamp::operator= ( const std::string &  a_s  ) 

Assignment.

Definition at line 458 of file tstamp.cc.

References assign().

Here is the call graph for this function:

bool timestamp::operator< ( const timestamp a_t  )  const

Comparison.

Definition at line 466 of file tstamp.cc.

References m_resolution, resolution(), and str().

Here is the call graph for this function:

bool timestamp::operator> ( const timestamp a_t  )  const

Comparison.

Definition at line 478 of file tstamp.cc.

References m_resolution, resolution(), and str().

Here is the call graph for this function:

bool timestamp::operator== ( const timestamp a_t  )  const

Comparison.

Definition at line 490 of file tstamp.cc.

References m_resolution, resolution(), and str().

Here is the call graph for this function:

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().

Here is the call graph for this function:


Member Data Documentation

int timestamp::m_year [private]

Definition at line 68 of file tstamp.h.

Referenced by assign(), clear(), set(), and year().

int timestamp::m_month [private]

Definition at line 69 of file tstamp.h.

Referenced by assign(), clear(), month(), and set().

int timestamp::m_day [private]

Definition at line 70 of file tstamp.h.

Referenced by assign(), clear(), day(), and set().

int timestamp::m_hour [private]

Definition at line 71 of file tstamp.h.

Referenced by assign(), clear(), hour(), and set().

int timestamp::m_minute [private]

Definition at line 72 of file tstamp.h.

Referenced by assign(), clear(), minute(), and set().

int timestamp::m_second [private]

Definition at line 73 of file tstamp.h.

Referenced by assign(), clear(), second(), and set().

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().


The documentation for this class was generated from the following files:
Generated on Tue Jul 1 12:12:09 2008 for rvm by  doxygen 1.5.1