CPKIFTime Class Reference

#include <PKIFTime.h>

Collaboration diagram for CPKIFTime:

Collaboration graph
[legend]

List of all members.


Detailed Description

The CPKIFTime class provides a means of representing time information.

TSP-enforcing: Yes

Definition at line 60 of file PKIFTime.h.


Public Member Functions

 CPKIFTime ()
 CPKIFTime (const CPKIFTime &time_)
 CPKIFTime (const char *time, TimeType type)
 CPKIFTime (const char *time)
 ~CPKIFTime ()
int year () const
int month () const
int dayOfMonth () const
int hours () const
int minutes () const
int seconds () const
const char * GetTime () const
void set (int year_, int month_, int dom_, int hours_, int minutes_, int seconds_)
CPKIFTimeoperator= (const CPKIFTime &time_)
CPKIFTimeoperator+= (const CPKIFDuration &duration_)
CPKIFTimeoperator-= (const CPKIFDuration &duration_)
CPKIFTime operator+ (const CPKIFDuration &duration_) const
CPKIFTime operator- (const CPKIFDuration &duration_) const
CPKIFDuration operator- (const CPKIFTime &time_) const
bool operator== (const CPKIFTime &time_) const
bool operator!= (const CPKIFTime &time_) const
bool operator< (const CPKIFTime &time_) const
bool operator<= (const CPKIFTime &time_) const
bool operator> (const CPKIFTime &time_) const
bool operator>= (const CPKIFTime &time_) const

Static Public Member Functions

static CPKIFTimePtr CurrentTime ()

Constructor & Destructor Documentation

CPKIFTime::CPKIFTime (  ) 

Interface: External

This function is used to create and initialize an instance of CPKIFTime. Its a default constructor.

Returns:
None

Definition at line 155 of file Time.cpp.

CPKIFTime::CPKIFTime ( const CPKIFTime date_  ) 

Interface: External

This function is used to create and initialize an instance of CPKIFTime. This is a copy constructor.

Returns:
None

Definition at line 171 of file Time.cpp.

References m_impl.

CPKIFTime::CPKIFTime ( const char *  time,
TimeType  type 
)

Interface: External

This function is used to create and initialize an instance of CPKIFTime.

Returns:
None
Parameters:
time  [in] A string containing time either in GeneralizedTime form or UTCTime time form
type  [in] A TimeType which indicates if the time is in GeneralizedTime form or UTCTime time form. 2 stands for GeneralizedTime and 1 stands for UTCTime time form

Definition at line 183 of file Time.cpp.

References fromGenTime(), fromUtcTime(), and UTCTIME.

CPKIFTime::CPKIFTime ( const char *  time  ) 

Interface: External

This function is used to create and initialize an instance of CPKIFTime. The string passed to the constructor specifies a time value in GeneralizedTime form. If null is passed into CPKIFTime(const char* time) constructor the time is set to the current time.

Example: CPKIFTime t("20050209081530Z");

Returns:
None

Definition at line 214 of file Time.cpp.

References CurrentTime(), and fromGenTime().

CPKIFTime::~CPKIFTime (  ) 

Interface: External

The function destroys an instance of CPKIFTime.

Returns:
None

Definition at line 237 of file Time.cpp.


Member Function Documentation

CPKIFTimePtr CPKIFTime::CurrentTime (  )  [static]

int CPKIFTime::year (  )  const

Interface: External

This function returns an integer containing the years value from the time value held by an instance of CPKIFTime.

Returns:
An integer containing the years value from the time value held by an instance of CPKIFTime

Definition at line 259 of file Time.cpp.

Referenced by fromGenTime(), and fromUtcTime().

int CPKIFTime::month (  )  const

Interface: External

This function returns the month of the year, e.g. where 1=January and December=12.

Returns:
The month of the year, e.g. where 1=January and December=12.

Definition at line 275 of file Time.cpp.

Referenced by fromGenTime(), and fromUtcTime().

int CPKIFTime::dayOfMonth (  )  const

Interface: External

This function returns an integer containing the day of the month, e.g. a value in the range 1-31, inclusive.

Returns:
An integer containing the day of the month, e.g. a value in the range 1-31, inclusive.

Definition at line 290 of file Time.cpp.

int CPKIFTime::hours (  )  const

Interface: External

This function returns the number of hours into the day in the time value, e.g. a value in the range 0-23, inclusive.

Returns:
The number of hours into the day in the time value, e.g. a value in the range 0-23, inclusive.

Definition at line 302 of file Time.cpp.

int CPKIFTime::minutes (  )  const

Interface: External

This function returns an integer containing the number of minutes into the hour in the time value, e.g. a value in the range 0-59, inclusive.

Returns:
An integer containing the number of minutes into the hour in the time value, e.g. a value in the range 0-59, inclusive.

Definition at line 318 of file Time.cpp.

int CPKIFTime::seconds (  )  const

Interface: External

This function returns an integer containing the number of seconds into the minute in the time value held by an instance of CPKIFTime.

Returns:
An integer containing the number of seconds into the minute in the time value held by an instance of CPKIFTime

Definition at line 333 of file Time.cpp.

const char * CPKIFTime::GetTime (  )  const

Interface: External

This function returns a pointer to a NULL-terminated string representation of the time value held by the instance of CPKIFTime. The value is valid for the life of the CPKIFTime object or until one of the Setxxx functions is invoked on the same object.

Returns:
A pointer to a NULL-terminated string representation of the time value held by the instance of CPKIFTime.

Definition at line 462 of file Time.cpp.

References m_timeStr.

void CPKIFTime::set ( int  year_,
int  month_,
int  dom_,
int  hours_,
int  minutes_,
int  seconds_ 
)

Interface: External

This function is used to set the time value held by an instance of CPKIFTime,

Returns:
None
Exceptions:
CPKIFException(ASN1_INVALID_TIME) 
Parameters:
year_  [in] Integer containing the year value to set
month_  [in] Integer containing the month value to set (1-12)
dom_  [in] Integer containing the day of month value to set (1-31)
hours_  [in] Integer containing the hours into the day value to set (0-23)
minutes_  [in] Integer containing the minutes into the hour value to set (0-59)
seconds_  [in] Integer containing the seconds into the minute value to set (0-59)

Definition at line 497 of file Time.cpp.

References ASN1_INVALID_TIME, and TOOLKIT_ASN.

Referenced by fromGenTime(), and fromUtcTime().

CPKIFTime & CPKIFTime::operator= ( const CPKIFTime time_  ) 

Interface: External

This function assigns the value from the CPKIFTime object passed via the time_ parameter to the time value held by the instance on which this function was invoked.

Returns:
Boolean
Parameters:
time_  [in] Reference to a CPKIFTime object containing the value to assign

Definition at line 637 of file Time.cpp.

References m_impl.

CPKIFTime & CPKIFTime::operator+= ( const CPKIFDuration duration_  ) 

Interface: External

This function adds a duration to the time value held by an instance of CPKIFTime.

Returns:
A reference to CPKIFTime object containing the result
Parameters:
duration_  [in] Reference to a CPKIFDuration object containing the duration to add

Definition at line 663 of file Time.cpp.

References CPKIFDuration::asSeconds(), COMMON_INVALID_INPUT, and TOOLKIT_ASN.

CPKIFTime & CPKIFTime::operator-= ( const CPKIFDuration duration_  ) 

Interface: External

This function subtracts duration from the time value held by an instance of CPKIFTime.

Returns:
A reference to CPKIFTime object containing the result
Parameters:
duration_  [in] Reference to a CPKIFDuration object containing the duration to subtract

Definition at line 696 of file Time.cpp.

References CPKIFDuration::asSeconds(), COMMON_INVALID_INPUT, and TOOLKIT_ASN.

CPKIFTime CPKIFTime::operator+ ( const CPKIFDuration duration_  )  const

Interface: External

This function adds a specified value to the time value held by an instance of CPKIFTime and returns a new instance containing the result.

Returns:
A reference to CPKIFTime object containing the result
Parameters:
duration_  [in] Reference to a CPKIFDuration object containing the value to add to the time value

Definition at line 730 of file Time.cpp.

References CPKIFDuration::asSeconds(), COMMON_INVALID_INPUT, m_impl, and TOOLKIT_ASN.

CPKIFTime CPKIFTime::operator- ( const CPKIFDuration duration_  )  const

Interface: External

This function is used to subtract a specified value from the time value held by an instance of CPKIFTime

Returns:
A reference to CPKIFTime object containing the result
Parameters:
duration_  [in] Reference to a CPKIFDuration object containing the value to subtract from the time value

Definition at line 760 of file Time.cpp.

References CPKIFDuration::asSeconds(), COMMON_INVALID_INPUT, m_impl, and TOOLKIT_ASN.

CPKIFDuration CPKIFTime::operator- ( const CPKIFTime time_  )  const

Interface: External

This function is used to subtract a specified value from the time value held by an instance of CPKIFTime

Returns:
A reference to CPKIFDuration object containing the result
Parameters:
time_  [in] Reference to a CPKIFTime object containing the value to subtract from the time value

Definition at line 790 of file Time.cpp.

References m_impl, and CPKIFDuration::setSeconds().

bool CPKIFTime::operator== ( const CPKIFTime time_  )  const

Interface: External

This function returns true if the value contained in the CPKIFTime object passed via the time_ parameter is equal to the value stored in the instance on which this function was invoked and false otherwise.

Return values:
True if the value contained in the CPKIFTime object passed via the time_ parameter is equal to the value stored in the instance on which this function was invoked
Flase if the value contained in the CPKIFTime object passed via the time_ parameter is not equal to the value stored in the instance on which this function was invoked
Parameters:
time_  [in] Reference to a CPKIFTime object containing the time value to compare

Definition at line 812 of file Time.cpp.

References m_impl.

bool CPKIFTime::operator!= ( const CPKIFTime time_  )  const

Interface: External

This function returns true if the value contained in the CPKIFTime object passed via the time_ parameter is not equal to the value stored in the instance on which this function was invoked and false otherwise.

Return values:
True if the value contained in the CPKIFTime object passed via the time_ parameter is not equal to the value stored in the instance on which this function was invoked
Flase if the value contained in the CPKIFTime object passed via the time_ parameter is equal to the value stored in the instance on which this function was invoked
Parameters:
time_  [in] Reference to a CPKIFTime object containing the time value to compare

Definition at line 831 of file Time.cpp.

References m_impl.

bool CPKIFTime::operator< ( const CPKIFTime time_  )  const

Interface: External

This function returns true if the value contained in the CPKIFTime object passed via the time_ parameter is greater then the value stored in the instance on which this function was invoked and false otherwise.

Return values:
true if the value contained in the CPKIFTime object passed via the time_ parameter is greater then the value stored in the instance on which this function was invoked
flase if the value contained in the CPKIFTime object passed via the time_ parameter is not greater then the value stored in the instance on which this function was invoked

Definition at line 850 of file Time.cpp.

References m_impl.

bool CPKIFTime::operator<= ( const CPKIFTime time_  )  const

Interface: External

This function returns true if the value contained in the CPKIFTime object passed via the time_ parameter is less then or equal to the value stored in the instance on which this function was invoked and false otherwise.

Returns:
true if the value contained in the CPKIFTime object passed via the time_ parameter is greater then or equal to the value stored in the instance on which this function was invoked

false if the value contained in the CPKIFTime object passed via the time_ parameter is not greater then or not equal to the value stored in the instance on which this function was invoked

Parameters:
time_  [in] Reference to a CPKIFTime object containing the time value to compare

Definition at line 907 of file Time.cpp.

References m_impl.

bool CPKIFTime::operator> ( const CPKIFTime time_  )  const

Interface: External

This function returns true if the value contained in the CPKIFTime object passed via the time_ parameter is greater then the value stored in the instance on which this function was invoked and false otherwise.

Return values:
true if the value contained in the CPKIFTime object passed via the time_ parameter is less then the value stored in the instance on which this function was invoked
flase if the value contained in the CPKIFTime object passed via the time_ parameter is not less then the value stored in the instance on which this function was invoked
Parameters:
time_  [in] Reference to a CPKIFTime object containing the time value to compare

Definition at line 869 of file Time.cpp.

References m_impl.

bool CPKIFTime::operator>= ( const CPKIFTime time_  )  const

Interface: External

This function returns true if the value contained in the CPKIFTime object passed via the time_ parameter is less then or equal to the value stored in the instance on which this function was invoked and false otherwise.

Returns:
true if the value contained in the CPKIFTime object passed via the time_ parameter is less then or equal to the value stored in the instance on which this function was invoked

false if the value contained in the CPKIFTime object passed via the time_ parameter is not less then or not equal to the value stored in the instance on which this function was invoked

Parameters:
time_  [in] Reference to a CPKIFTime object containing the time value to compare

Definition at line 888 of file Time.cpp.

References m_impl.


The documentation for this class was generated from the following files:

Generated on Mon Nov 15 11:20:47 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6