Time String Types

The ASN.1 GeneralizedTime and UTCTime types are mapped to standard C/C++ null-terminated character string types.

The C++ version of the product contains additional control classes for parsing and formatting time string values. When C++ code generation is specified, a control class is generated for operating on the target time string. This class is derived from the ASN1CGeneralizedTime or ASN1CUTCTime class for GeneralizedTime or UTCTime respectively. These classes contain methods for formatting or parsing time components such as month, day, year, etc. from the strings.

Objects of these classes can be declared inline to make the task of formatting or parsing time strings easier. For example, in a SEQUENCE containing a time string element the generated type will contain a public member variable containing the ASN1T type that holds the message data. If one wanted to operate on the time string contained within that element, they could do so by using one of the time string classes inline as follows:

   ASN1CGeneralizedTime gtime (msgbuf, <seqVar>.<element>);
   gtime.setMonth (ASN1CTime::November);

In this example, <seqVar> would represent a generated SEQUENCE variable type and <element> would represent a time string element within this type.

See the ASN1CTime, ASN1CGeneralizedTime, and ASN1CUTCTime subsections in the C/C++ Run-Time Library Reference Manual for details on all of the methods available in these classes.