zypp::Date Class Reference

Store and operate on date (time_t). More...

#include <Date.h>

List of all members.

Public Types

typedef time_t ValueType

Public Member Functions

 Date ()
 Default ctor: 0.
 Date (ValueType date_r)
 Ctor taking time_t value.
 Date (const std::string &seconds_r)
 Ctor taking time_t value as string.
 operator ValueType () const
 Conversion to time_t.
std::string form (const std::string &format_r) const
 Return string representation according to format.
std::string asString () const
 Default string representation of Date.
std::string asSeconds () const
 Convert to string representation of calendar time in numeric form (like "1029255142").

Static Public Member Functions

static Date now ()
 Return the current time.

Private Attributes

ValueType _date
 Calendar time.

Friends

std::ostream & operator<< (std::ostream &str, const Date &obj)
 Stream output.


Detailed Description

Store and operate on date (time_t).

Definition at line 29 of file Date.h.


Member Typedef Documentation

typedef time_t zypp::Date::ValueType

Definition at line 35 of file Date.h.


Constructor & Destructor Documentation

zypp::Date::Date (  )  [inline]

Default ctor: 0.

Definition at line 38 of file Date.h.

zypp::Date::Date ( ValueType  date_r  )  [inline]

Ctor taking time_t value.

Definition at line 42 of file Date.h.

zypp::Date::Date ( const std::string &  seconds_r  ) 

Ctor taking time_t value as string.

Definition at line 30 of file Date.cc.

References _date, and zypp::str::strtonum().


Member Function Documentation

static Date zypp::Date::now (  )  [inline, static]

Return the current time.

Definition at line 49 of file Date.h.

Referenced by zypp::base::LogControl::LineFormater::format(), zypp::target::CommitLog::operator()(), zypp::target::TargetImpl::timestamp(), zypp::storage::XMLFilesBackend::timestamp(), zypp::target::rpm::RpmDb::timestamp(), zypp::source::SourceImpl::timestamp(), and zypp::syscontent::Writer::Impl::writeXml().

zypp::Date::operator ValueType (  )  const [inline]

Conversion to time_t.

Definition at line 54 of file Date.h.

References _date.

Date& zypp::Date::operator+= ( const time_t  rhs  )  [inline]

Definition at line 61 of file Date.h.

References _date.

Date& zypp::Date::operator-= ( const time_t  rhs  )  [inline]

Definition at line 62 of file Date.h.

References _date.

Date& zypp::Date::operator *= ( const time_t  rhs  )  [inline]

Definition at line 63 of file Date.h.

References _date.

Date& zypp::Date::operator/= ( const time_t  rhs  )  [inline]

Definition at line 64 of file Date.h.

References _date.

Date& zypp::Date::operator++ (  )  [inline]

Definition at line 66 of file Date.h.

References _date.

Date& zypp::Date::operator-- (  )  [inline]

Definition at line 67 of file Date.h.

References _date.

Date zypp::Date::operator++ ( int   )  [inline]

Definition at line 69 of file Date.h.

References _date.

Date zypp::Date::operator-- ( int   )  [inline]

Definition at line 70 of file Date.h.

References _date.

std::string zypp::Date::form ( const std::string &  format_r  )  const

Return string representation according to format.

See also:
'man strftime' (which is used internaly) for valid conversion specifiers in format.
Returns:
An empty string on illegal format.

Definition at line 38 of file Date.cc.

References _date.

Referenced by asSeconds(), and asString().

std::string zypp::Date::asString (  )  const [inline]

Default string representation of Date.

The preferred date and time representation for the current locale.

Definition at line 85 of file Date.h.

References form().

std::string zypp::Date::asSeconds (  )  const [inline]

Convert to string representation of calendar time in numeric form (like "1029255142").

Definition at line 91 of file Date.h.

References form().

Referenced by zypp::syscontent::Writer::Impl::writeXml().

Date& zypp::Date::operator+= ( const time_t  rhs  )  [inline]

Definition at line 61 of file Date.h.

References _date.

Date& zypp::Date::operator-= ( const time_t  rhs  )  [inline]

Definition at line 62 of file Date.h.

References _date.

Date& zypp::Date::operator *= ( const time_t  rhs  )  [inline]

Definition at line 63 of file Date.h.

References _date.

Date& zypp::Date::operator/= ( const time_t  rhs  )  [inline]

Definition at line 64 of file Date.h.

References _date.

Date& zypp::Date::operator++ (  )  [inline]

Definition at line 66 of file Date.h.

References _date.

Date& zypp::Date::operator-- (  )  [inline]

Definition at line 67 of file Date.h.

References _date.

Date zypp::Date::operator++ ( int   )  [inline]

Definition at line 69 of file Date.h.

References _date.

Date zypp::Date::operator-- ( int   )  [inline]

Definition at line 70 of file Date.h.

References _date.


Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  str,
const Date obj 
) [friend]

Stream output.

Definition at line 104 of file Date.h.


Member Data Documentation

ValueType zypp::Date::_date [private]

Calendar time.

The number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).

Definition at line 99 of file Date.h.

Referenced by Date(), form(), operator *=(), operator ValueType(), operator++(), operator+=(), operator--(), operator-=(), and operator/=().


The documentation for this class was generated from the following files:
Generated on Fri Jul 4 16:58:03 2008 for zypp by  doxygen 1.5.0