ASN1TGeneralizedTime Class Reference
[Date and Time Runtime Classes]

#include <ASN1TTime.h>

Inheritance diagram for ASN1TGeneralizedTime:
ASN1TTime

List of all members.

Public Member Functions

 ASN1TGeneralizedTime ()
EXTRTMETHOD ASN1TGeneralizedTime (const char *buf, OSBOOL useDerRules=FALSE)
 ASN1TGeneralizedTime (OSBOOL useDerRules)
 ASN1TGeneralizedTime (const ASN1TGeneralizedTime &original)
EXTRTMETHOD int getCentury () const
EXTRTMETHOD int setCentury (short century)
EXTRTMETHOD int setTime (time_t time, OSBOOL diffTime)
EXTRTMETHOD int parseString (const char *string)
const ASN1TGeneralizedTimeoperator= (const ASN1TGeneralizedTime &tm)
EXTRTMETHOD int compileString (char *pbuf, size_t bufsize) const

Detailed Description

ASN.1 GeneralizedTime utility class. The ASN1TGeneralizedTime class is derived from the ASN1TTime base class.


Constructor & Destructor Documentation

ASN1TGeneralizedTime::ASN1TGeneralizedTime (  )  [inline]

A default constructor.

EXTRTMETHOD ASN1TGeneralizedTime::ASN1TGeneralizedTime ( const char *  buf,
OSBOOL  useDerRules = FALSE 
)

This constructor creates a time object using the specified time string.

Parameters:
buf A pointer to the time string to be parsed.
useDerRules An OSBOOL value.
ASN1TGeneralizedTime::ASN1TGeneralizedTime ( OSBOOL  useDerRules  )  [inline]

This constructor creates an empty time object.

Parameters:
useDerRules An OSBOOL value.
ASN1TGeneralizedTime::ASN1TGeneralizedTime ( const ASN1TGeneralizedTime original  )  [inline]

A copy constructor.


Member Function Documentation

EXTRTMETHOD int ASN1TGeneralizedTime::compileString ( char *  pbuf,
size_t  bufsize 
) const [virtual]

Compiles new time string accoring X.680 and ISO 8601. Returns 0, if succeed, or error code, if error.

Parameters:
pbuf A pointer to destination buffer.
bufsize A size of destination buffer.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

Implements ASN1TTime.

EXTRTMETHOD int ASN1TGeneralizedTime::getCentury (  )  const

This method returns the centry part (first two digits) of the year component of the time value.

Returns:
Century part (first two digits) of the year component is returned if the operation is sucessful. If the operation fails, one of the negative status codes is returned.
EXTRTMETHOD int ASN1TGeneralizedTime::parseString ( const char *  string  )  [virtual]

Parses sting.

Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

Implements ASN1TTime.

EXTRTMETHOD int ASN1TGeneralizedTime::setCentury ( short  century  ) 

This method sets the centry part (first two digits) of the year component of the time value.

Parameters:
century Century part (first two digits) of the year component.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.
EXTRTMETHOD int ASN1TGeneralizedTime::setTime ( time_t  time,
OSBOOL  diffTime 
) [virtual]

This converts the value of the C built-in type time_t to a time string.

The value is the number of seconds from January 1, 1970.

Parameters:
time The time value, expressed as a number of seconds from January 1, 1970.
diffTime TRUE means the difference between local time and UTC time will be calculated; in other case, only local time will be stored.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

Implements ASN1TTime.


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