ASN1TUTCTime Class Reference
[Date and Time Runtime Classes]

#include <ASN1TTime.h>

Inheritance diagram for ASN1TUTCTime:
ASN1TTime

List of all members.

Public Member Functions

EXTRTMETHOD ASN1TUTCTime ()
EXTRTMETHOD ASN1TUTCTime (const char *timeStr, OSBOOL useDerRules=FALSE)
EXTRTMETHOD ASN1TUTCTime (OSBOOL useDerRules)
 ASN1TUTCTime (const ASN1TUTCTime &original)
EXTRTMETHOD int setYear (short year_)
EXTRTMETHOD int setTime (time_t time, OSBOOL diffTime)
EXTRTMETHOD int setUTC (OSBOOL utc)
EXTRTMETHOD void clear ()
EXTRTMETHOD int compileString (char *pbuf, size_t bufsize) const
EXTRTMETHOD int parseString (const char *string)
const ASN1TUTCTimeoperator= (const ASN1TUTCTime &tm)

Protected Member Functions

EXTRTMETHOD int getFraction () const
EXTRTMETHOD int setFraction (int fraction, int fracLen=-1)

Detailed Description

ASN.1 UTCTime utility class. The ASN1TUTTime class is derived from the ASN1TTime base class.


Constructor & Destructor Documentation

EXTRTMETHOD ASN1TUTCTime::ASN1TUTCTime (  ) 

A default constructor.

EXTRTMETHOD ASN1TUTCTime::ASN1TUTCTime ( const char *  timeStr,
OSBOOL  useDerRules = FALSE 
)

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

Parameters:
timeStr A pointer to the time string to be parsed.
useDerRules Create object using DER rules.
EXTRTMETHOD ASN1TUTCTime::ASN1TUTCTime ( OSBOOL  useDerRules  ) 

This constructor creates an empty time object.

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

A copy constructor.


Member Function Documentation

EXTRTMETHOD void ASN1TUTCTime::clear (  )  [virtual]

Clears out the time object.

Reimplemented from ASN1TTime.

EXTRTMETHOD int ASN1TUTCTime::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 ASN1TUTCTime::getFraction (  )  const [protected, virtual]

This method returns the second's decimal component of the time value.

Second's decimal fraction is represented by one or more digits from 0 to 9.

Returns:
Second's decimal fraction component is returned if operation is successful. If the operation fails, a negative value is returned.

Reimplemented from ASN1TTime.

EXTRTMETHOD int ASN1TUTCTime::parseString ( const char *  string  )  [virtual]

Parses the given time string. The string is assumed to be in standard UTC time format.

Parameters:
string UTC time string to be parsed.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

Implements ASN1TTime.

EXTRTMETHOD int ASN1TUTCTime::setFraction ( int  fraction,
int  fracLen = -1 
) [protected, virtual]

This method sets the second's decimal fraction component of the time value.

Second's decimal fraction is represented by one or more digits from 0 to 9. Note that the action of this method may differ for different inherited ASN1TTime classes.

Parameters:
fraction Second's decimal fraction component (0 - 9).
fracLen Optional parameter specifies number of digits in second's fraction.
Returns:
Completion status of operation:
  • 0 (ASN_OK) = success,
  • negative return value is error.

Reimplemented from ASN1TTime.

EXTRTMETHOD int ASN1TUTCTime::setTime ( time_t  time,
OSBOOL  diffTime 
) [virtual]

Converts time_t to time string.

Parameters:
time time to convert,
diffTime TRUE means the difference between local time and UTC 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.

EXTRTMETHOD int ASN1TUTCTime::setUTC ( OSBOOL  utc  )  [virtual]

This method sets the UTC flag state.

If the UTC flag is TRUE, then the time is a UTC time and symbol 'Z' is added to the end of the string. Otherwise, it is a local time.

Parameters:
utc UTC flag state.
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

Reimplemented from ASN1TTime.

EXTRTMETHOD int ASN1TUTCTime::setYear ( short  year_  )  [virtual]

This method sets the year component of the time value.

The year parameter can be either the two last digits of the year (00 - 99) or the full four digits (0 - 9999). Note: the getYear method returns the year in the full four digits, independent of the format of the year parameter used in this method.

Parameters:
year_ Year component (full four digits or only last two digits).
Returns:
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

Reimplemented from ASN1TTime.


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