ASN1C C/C++ Common Runtime  ASN1C v7.2.x
ASN1CGeneralizedTime.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1997-2018 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 
42 //
44 // ASN1CGeneralizedTime
45 //
46 // ISO 8601 time and date for ITU-T X.680.
47 //
48 // Author Artem Bolgar.
49 // version 3.00 03 Sep, 2004 (refactored to use ASN1TGeneralizedTime)
50 //
51 // version 2.13 11 Jul, 2003 (2038 year problem fixed + some other fixes)
52 // version 1.11 03 Aug, 2002
53 //
54 #ifndef _NO_UTILS_CLASSES
55 
67 class EXTRTCLASS ASN1CGeneralizedTime : public ASN1CTime {
68  protected:
69  ASN1TGeneralizedTime timeObj;
70 
71  virtual ASN1TTime& getTimeObj () { return timeObj; }
72  virtual const ASN1TTime& getTimeObj () const { return timeObj; }
73 
74  EXTRTMETHOD ASN1CGeneralizedTime(char*& buf, int bufSize, OSBOOL useDerRules = FALSE);
75 
76  EXTRTMETHOD ASN1CGeneralizedTime(ASN1GeneralizedTime& buf,
77  OSBOOL useDerRules = FALSE);
78  public:
79 
91  EXTRTMETHOD ASN1CGeneralizedTime(OSRTMessageBufferIF& msgBuf, char*& buf, int bufSize,
92  OSBOOL useDerRules = FALSE);
93 
106  EXTRTMETHOD ASN1CGeneralizedTime(OSRTMessageBufferIF& msgBuf, ASN1GeneralizedTime& buf,
107  OSBOOL useDerRules = FALSE);
108 
122  EXTRTMETHOD ASN1CGeneralizedTime(OSRTContext& ctxt, char*& buf, int bufSize,
123  OSBOOL useDerRules = FALSE);
124 
138  EXTRTMETHOD ASN1CGeneralizedTime(OSRTContext& ctxt, ASN1GeneralizedTime& buf,
139  OSBOOL useDerRules = FALSE);
140 
141  // copy ctor
142 
149  ASN1CGeneralizedTime (const ASN1CGeneralizedTime& original) :
150  ASN1CTime (original) {}
151 
162  EXTRTMETHOD int getCentury();
163 
173  EXTRTMETHOD int setCentury(short century);
174 
191  EXTRTMETHOD int setTime(time_t time, OSBOOL diffTime);
192 
193  const ASN1CGeneralizedTime& operator = (const ASN1CGeneralizedTime& tm) {
194  return (const ASN1CGeneralizedTime&) ASN1CTime::operator = (tm);
195  }
196  protected:
203  EXTRTMETHOD int compileString();
204 } ;
205 #else
206 typedef class _ASN1CGeneralizedTime : public _ASN1CTime {
207  protected:
208  _ASN1CGeneralizedTime(char*& buf, int bufSize, OSBOOL useDerRules) {}
209  _ASN1CGeneralizedTime(ASN1VisibleString& buf, OSBOOL useDerRules) {}
210  public:
211  _ASN1CGeneralizedTime (OSRTMessageBufferIF& msgBuf, char*& buf, int sz,
212  OSBOOL useDerRules = FALSE) :
213  _ASN1CTime (msgBuf, buf, sz, useDerRules) {}
214  _ASN1CGeneralizedTime (OSRTMessageBufferIF& msgBuf, ASN1VisibleString& buf,
215  OSBOOL useDerRules = FALSE) :
216  _ASN1CTime (msgBuf, buf, useDerRules) {}
217  _ASN1CGeneralizedTime(OSRTContext& ctxt, char*& buf, int bufSize,
218  OSBOOL useDerRules) : _ASN1CTime (ctxt, buf, bufSize, useDerRules) {}
219  _ASN1CGeneralizedTime(OSRTContext& ctxt, ASN1VisibleString& buf,
220  OSBOOL useDerRules) : _ASN1CTime (ctxt, buf, bufSize, useDerRules) {}
222 #endif // _NO_UTILS_CLASSES
223 
231 #endif //__ASN1CGENTIME_H__
Definition: ASN1TTime.h:71
virtual int setTime(time_t time, OSBOOL diffTime)=0
Definition: ASN1CTime.h:86
EXTRTMETHOD const ASN1CTime & operator=(const ASN1CTime &)
Definition: ASN1TTime.h:692
Definition: ASN1CGeneralizedTime.h:67
Definition: OSRTContext.h:65
ASN1CGeneralizedTime(const ASN1CGeneralizedTime &original)
Definition: ASN1CGeneralizedTime.h:149
virtual int compileString()=0