
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.
Objective Systems, Inc.102 Pickering Way, Suite #506Exton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |