ASN1CGeneralizedTime Class Reference
[Date and Time Runtime Classes]

#include <ASN1CGeneralizedTime.h>

Inheritance diagram for ASN1CGeneralizedTime:
ASN1CTime ASN1CType

List of all members.

Public Member Functions

EXTRTMETHOD ASN1CGeneralizedTime (OSRTMessageBufferIF &msgBuf, char *&buf, int bufSize, OSBOOL useDerRules=FALSE)
EXTRTMETHOD ASN1CGeneralizedTime (OSRTMessageBufferIF &msgBuf, ASN1GeneralizedTime &buf, OSBOOL useDerRules=FALSE)
EXTRTMETHOD ASN1CGeneralizedTime (OSRTContext &ctxt, char *&buf, int bufSize, OSBOOL useDerRules=FALSE)
EXTRTMETHOD ASN1CGeneralizedTime (OSRTContext &ctxt, ASN1GeneralizedTime &buf, OSBOOL useDerRules=FALSE)
 ASN1CGeneralizedTime (const ASN1CGeneralizedTime &original)
EXTRTMETHOD int getCentury ()
EXTRTMETHOD int setCentury (short century)
EXTRTMETHOD int setTime (time_t time, OSBOOL diffTime)
const ASN1CGeneralizedTimeoperator= (const ASN1CGeneralizedTime &tm)

Protected Member Functions

virtual ASN1TTimegetTimeObj ()
virtual const ASN1TTimegetTimeObj () const
EXTRTMETHOD ASN1CGeneralizedTime (char *&buf, int bufSize, OSBOOL useDerRules=FALSE)
EXTRTMETHOD ASN1CGeneralizedTime (ASN1GeneralizedTime &buf, OSBOOL useDerRules=FALSE)
EXTRTMETHOD int compileString ()

Protected Attributes

ASN1TGeneralizedTime timeObj

Detailed Description

ASN.1 GeneralizedTime control class. The ASN1CGeneralizedTime class is derived from the ASN1CTime base class. It is used as the base class for generated control classes for the ASN.1 Generalized Time ([UNIVERSAL 24] IMPLICIT VisibleString) type. This class provides utility methods for operating on the time information referenced by the generated class. This class can also be used inline to operate on the times within generated time string elements in a SEQUENCE, SET, or CHOICE construct. The time string generally is encoded according to ISO 8601 format with some exceptions (see X.680).


Constructor & Destructor Documentation

EXTRTMETHOD ASN1CGeneralizedTime::ASN1CGeneralizedTime ( OSRTMessageBufferIF &  msgBuf,
char *&  buf,
int  bufSize,
OSBOOL  useDerRules = FALSE 
)

This constructor creates a time string from a buffer. It does not deep-copy the data, it just assigns the passed array to an internal reference variable. The object will then directly operate on the given data variable.

Parameters:
msgBuf Reference to an OSRTMessage buffer derived object (for example, an ASN1BEREncodeBuffer).
buf A reference pointer to the time string buffer.
bufSize The size of the passed buffer, in bytes.
useDerRules An OSBOOL value.
EXTRTMETHOD ASN1CGeneralizedTime::ASN1CGeneralizedTime ( OSRTMessageBufferIF &  msgBuf,
ASN1GeneralizedTime &  buf,
OSBOOL  useDerRules = FALSE 
)

This constructor creates a time string using the ASN1GeneralizedTime argument. The constructor does not deep-copy the variable, it assigns a reference to it to an internal variable. The object will then directly operate on the given data variable. This form of the constructor is used with a complier-generated time string variable.

Parameters:
msgBuf Reference to an OSRTMessage buffer derived object (for example, an ASN1BEREncodeBuffer).
buf A reference pointer to the time string buffer.
useDerRules An OSBOOL value.

Member Function Documentation

EXTRTMETHOD int ASN1CGeneralizedTime::getCentury (  ) 

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

Parameters:
- none
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 ASN1CGeneralizedTime::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 ASN1CGeneralizedTime::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. Note that the action of this method may differ for different inherited ASN1CTime Classes.

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 ASN1CTime.


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