Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

ASN1CUTCTime.h

Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 1997-2004 by Objective Systems, Inc. 00003 * 00004 * This software is furnished under a license and may be used and copied 00005 * only in accordance with the terms of such license and with the 00006 * inclusion of the above copyright notice. This software or any other 00007 * copies thereof may not be provided or otherwise made available to any 00008 * other person. No title to and ownership of the software is hereby 00009 * transferred. 00010 * 00011 * The information in this software is subject to change without notice 00012 * and should not be construed as a commitment by Objective Systems, Inc. 00013 * 00014 * PROPRIETARY NOTICE 00015 * 00016 * This software is an unpublished work subject to a confidentiality agreement 00017 * and is protected by copyright and trade secret law. Unauthorized copying, 00018 * redistribution or other use of this work is prohibited. 00019 * 00020 * The above notice of copyright on this source code product does not indicate 00021 * any actual or intended publication of such source code. 00022 * 00023 *****************************************************************************/ 00024 00025 #ifndef __ASN1CUTCTIME_H__ 00026 #define __ASN1CUTCTIME_H__ 00027 00028 #include "ASN1CTime.h" 00029 00031 // 00032 // ASN1CUTCTime 00033 // 00034 // ISO 8601 time and date for ITU-T X.680. 00035 // 00036 // Author Artem Bolgar. 00037 // version 3.00 03 Sep, 2004 (refactored to use ASN1TUTCTime) 00038 // 00039 // version 2.13 11 Jul, 2003 (2038 year problem fixed + some other fixes) 00040 // version 1.11 3 Aug, 2002 00041 // 00042 00056 #ifndef _NO_UTILS_CLASSES 00057 00068 class EXTERNRT ASN1CUTCTime : public ASN1CTime { 00069 protected: 00070 ASN1TUTCTime timeObj; 00071 00072 virtual ASN1TTime& getTimeObj () { return timeObj; } 00073 virtual const ASN1TTime& getTimeObj () const { return timeObj; } 00074 00075 ASN1CUTCTime(char*& buf, int bufSize, ASN1BOOL useDerRules = FALSE); 00076 ASN1CUTCTime(ASN1UTCTime& buf, ASN1BOOL useDerRules = FALSE); 00077 00078 public: 00093 ASN1CUTCTime(ASN1MessageBufferIF& msgBuf, char*& buf, int bufSize, 00094 ASN1BOOL useDerRules = FALSE); 00095 00109 ASN1CUTCTime(ASN1MessageBufferIF& msgBuf, ASN1UTCTime& buf, 00110 ASN1BOOL useDerRules = FALSE); 00111 00112 ASN1CUTCTime(ASN1Context& ctxt, char*& buf, int bufSize, 00113 ASN1BOOL useDerRules = FALSE); 00114 00115 ASN1CUTCTime(ASN1Context& ctxt, ASN1UTCTime& buf, 00116 ASN1BOOL useDerRules = FALSE); 00117 00118 // copy ctor 00119 00120 ASN1CUTCTime (const ASN1CUTCTime& original) : 00121 ASN1CTime (original) {} 00122 00134 int setTime(time_t time, ASN1BOOL diffTime); 00135 00136 const ASN1CUTCTime& operator = (const ASN1CUTCTime& tm) { 00137 return (ASN1CUTCTime&) ASN1CTime::operator = (tm); 00138 } 00139 00140 protected: 00141 /* 00142 * Compiles new time string accoring X.680 (clause 42) and ISO 8601. 00143 * Returns ASN_OK, if successful, or error code, if error. 00144 */ 00145 int compileString(); 00146 00147 /* 00148 * Gets fraction of second, 0..9. 00149 * Returns: Zero. 00150 */ 00151 int getFraction(); 00152 00153 /* 00154 * This method is not applicable for ASN1CUTCTime. 00155 * Returns ASN_E_NOTSUPP. 00156 */ 00157 int setFraction(int fraction); 00158 00159 } ; 00160 #else 00161 typedef class _ASN1CUTCTime : public _ASN1CTime { 00162 protected: 00163 _ASN1CUTCTime(char*& buf, int bufSize, ASN1BOOL useDerRules) {} 00164 _ASN1CUTCTime(ASN1VisibleString& buf, ASN1BOOL useDerRules) {} 00165 public: 00166 _ASN1CUTCTime (ASN1MessageBufferIF& msgBuf, char*& buf, int sz, 00167 ASN1BOOL useDerRules = FALSE) : 00168 _ASN1CTime (msgBuf, buf, sz, useDerRules) {} 00169 _ASN1CUTCTime (ASN1MessageBufferIF& msgBuf, ASN1VisibleString& buf, 00170 ASN1BOOL useDerRules = FALSE) : 00171 _ASN1CTime (msgBuf, buf, useDerRules) {} 00172 _ASN1CUTCTime(ASN1Context& ctxt, char*& buf, int bufSize, 00173 ASN1BOOL useDerRules) : _ASN1CTime (ctxt, buf, bufSize, useDerRules) {} 00174 _ASN1CUTCTime(ASN1Context& ctxt, ASN1VisibleString& buf, 00175 ASN1BOOL useDerRules) : _ASN1CTime (ctxt, buf, bufSize, useDerRules) {} 00176 } ASN1CUTCTime; 00177 #endif // _NO_UTILS_CLASSES 00178 #endif //__ASN1CUTCTIME_H__ 00179

Copyright © 1997-2004 Objective Systems,Inc.
All Rights Reserved.
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.

This file was last modified on 1 Oct 2004.
ASN1C C/C++ Common Runtime, ASN1C v5.7x