ASN1C C/C++ Common Runtime  ASN1C v7.6.x
ASN1CGeneralizedTime.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1997-2022 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
24 
25 #ifndef __ASN1CGENTIME_H__
26 #define __ASN1CGENTIME_H__
27 
28 #include "rtsrc/ASN1CTime.h"
29 
39 //
41 // ASN1CGeneralizedTime
42 //
43 // ISO 8601 time and date for ITU-T X.680.
44 //
45 // Author Artem Bolgar.
46 // version 3.00 03 Sep, 2004 (refactored to use ASN1TGeneralizedTime)
47 //
48 // version 2.13 11 Jul, 2003 (2038 year problem fixed + some other fixes)
49 // version 1.11 03 Aug, 2002
50 //
51 #ifndef _NO_UTILS_CLASSES
52 
64 class EXTRTCLASS ASN1CGeneralizedTime : public ASN1CTime {
65  protected:
66  ASN1TGeneralizedTime timeObj;
67 
68  virtual ASN1TTime& getTimeObj () { return timeObj; }
69  virtual const ASN1TTime& getTimeObj () const { return timeObj; }
70 
71  EXTRTMETHOD ASN1CGeneralizedTime(char*& buf, int bufSize, OSBOOL useDerRules = FALSE);
72 
73  EXTRTMETHOD ASN1CGeneralizedTime(ASN1GeneralizedTime& buf,
74  OSBOOL useDerRules = FALSE);
75  public:
76 
88  EXTRTMETHOD ASN1CGeneralizedTime(OSRTMessageBufferIF& msgBuf, char*& buf, int bufSize,
89  OSBOOL useDerRules = FALSE);
90 
103  EXTRTMETHOD ASN1CGeneralizedTime(OSRTMessageBufferIF& msgBuf, ASN1GeneralizedTime& buf,
104  OSBOOL useDerRules = FALSE);
105 
119  EXTRTMETHOD ASN1CGeneralizedTime(OSRTContext& ctxt, char*& buf, int bufSize,
120  OSBOOL useDerRules = FALSE);
121 
135  EXTRTMETHOD ASN1CGeneralizedTime(OSRTContext& ctxt, ASN1GeneralizedTime& buf,
136  OSBOOL useDerRules = FALSE);
137 
138  // copy ctor
139 
146  ASN1CGeneralizedTime (const ASN1CGeneralizedTime& original) :
147  ASN1CTime (original) {}
148 
159  EXTRTMETHOD int getCentury();
160 
170  EXTRTMETHOD int setCentury(short century);
171 
188  EXTRTMETHOD int setTime(time_t time, OSBOOL diffTime);
189 
190  const ASN1CGeneralizedTime& operator = (const ASN1CGeneralizedTime& tm) {
191  return (const ASN1CGeneralizedTime&) ASN1CTime::operator = (tm);
192  }
193  protected:
200  EXTRTMETHOD int compileString();
201 } ;
202 #else
203 typedef class _ASN1CGeneralizedTime : public _ASN1CTime {
204  protected:
205  _ASN1CGeneralizedTime(char*& buf, int bufSize, OSBOOL useDerRules) {}
206  _ASN1CGeneralizedTime(ASN1VisibleString& buf, OSBOOL useDerRules) {}
207  public:
208  _ASN1CGeneralizedTime (OSRTMessageBufferIF& msgBuf, char*& buf, int sz,
209  OSBOOL useDerRules = FALSE) :
210  _ASN1CTime (msgBuf, buf, sz, useDerRules) {}
211  _ASN1CGeneralizedTime (OSRTMessageBufferIF& msgBuf, ASN1VisibleString& buf,
212  OSBOOL useDerRules = FALSE) :
213  _ASN1CTime (msgBuf, buf, useDerRules) {}
214  _ASN1CGeneralizedTime(OSRTContext& ctxt, char*& buf, int bufSize,
215  OSBOOL useDerRules) : _ASN1CTime (ctxt, buf, bufSize, useDerRules) {}
216  _ASN1CGeneralizedTime(OSRTContext& ctxt, ASN1VisibleString& buf,
217  OSBOOL useDerRules) : _ASN1CTime (ctxt, buf, bufSize, useDerRules) {}
219 #endif // _NO_UTILS_CLASSES
220  // end of ingroup asn1ctrl asn1ctime
224 
225 #endif //__ASN1CGENTIME_H__
Definition: ASN1TTime.h:66
virtual int setTime(time_t time, OSBOOL diffTime)=0
Definition: ASN1CTime.h:85
EXTRTMETHOD const ASN1CTime & operator=(const ASN1CTime &)
Definition: ASN1TTime.h:690
Definition: ASN1CGeneralizedTime.h:64
Definition: OSRTContext.h:64
ASN1CGeneralizedTime(const ASN1CGeneralizedTime &original)
Definition: ASN1CGeneralizedTime.h:146
virtual int compileString()=0