ASN1C C/C++ Common Runtime
ASN1C v7.5.x
|
#include <ASN1CGeneralizedTime.h>
Public Member Functions | |
EXTRTMETHOD | ASN1CGeneralizedTime (OSRTMessageBufferIF &msgBuf, char *&buf, int bufSize, OSBOOL useDerRules=FALSE) |
EXTRTMETHOD | ASN1CGeneralizedTime (OSRTMessageBufferIF &msgBuf, ASN1GeneralizedTime &buf, OSBOOL useDerRules=FALSE) |
EXTRTMETHOD | ASN1CGeneralizedTime (OSRTContext &ctxt, char *&buf, int bufSize, OSBOOL useDerRules=FALSE) |
EXTRTMETHOD | ASN1CGeneralizedTime (OSRTContext &ctxt, ASN1GeneralizedTime &buf, OSBOOL useDerRules=FALSE) |
ASN1CGeneralizedTime (const ASN1CGeneralizedTime &original) | |
EXTRTMETHOD int | getCentury () |
EXTRTMETHOD int | setCentury (short century) |
EXTRTMETHOD int | setTime (time_t time, OSBOOL diffTime) |
const ASN1CGeneralizedTime & | operator= (const ASN1CGeneralizedTime &tm) |
Public Member Functions inherited from ASN1CTime | |
EXTRTMETHOD | ASN1CTime (OSRTMessageBufferIF &msgBuf, char *&buf, OSSIZE bufSize, OSBOOL useDerRules) |
EXTRTMETHOD | ASN1CTime (OSRTMessageBufferIF &msgBuf, ASN1VisibleString &buf, OSBOOL useDerRules) |
EXTRTMETHOD | ASN1CTime (OSRTContext &ctxt, char *&buf, OSSIZE bufSize, OSBOOL useDerRules) |
EXTRTMETHOD | ASN1CTime (OSRTContext &ctxt, ASN1VisibleString &buf, OSBOOL useDerRules) |
EXTRTMETHOD | ASN1CTime (const ASN1CTime &original) |
EXTRTMETHOD | ~ASN1CTime () |
virtual EXTRTMETHOD int | getYear () |
virtual EXTRTMETHOD int | getMonth () |
virtual EXTRTMETHOD int | getDay () |
virtual EXTRTMETHOD int | getHour () |
virtual EXTRTMETHOD int | getMinute () |
virtual EXTRTMETHOD int | getSecond () |
virtual EXTRTMETHOD int | getFraction () |
virtual EXTRTMETHOD double | getFractionAsDouble () |
virtual EXTRTMETHOD int | getFractionStr (char *const pBuf, size_t bufSize) |
virtual EXTRTMETHOD int | getFractionLen () |
virtual EXTRTMETHOD int | getDiffHour () |
virtual EXTRTMETHOD int | getDiffMinute () |
virtual EXTRTMETHOD int | getDiff () |
virtual EXTRTMETHOD OSBOOL | getUTC () |
virtual EXTRTMETHOD time_t | getTime () |
void | setDER (OSBOOL bvalue) |
virtual EXTRTMETHOD int | setUTC (OSBOOL utc) |
virtual EXTRTMETHOD int | setYear (short year_) |
virtual EXTRTMETHOD int | setMonth (short month_) |
virtual EXTRTMETHOD int | setDay (short day_) |
virtual EXTRTMETHOD int | setHour (short hour_) |
virtual EXTRTMETHOD int | setMinute (short minute_) |
virtual EXTRTMETHOD int | setSecond (short second_) |
virtual EXTRTMETHOD int | setFraction (int fraction, int fracLen=-1) |
virtual EXTRTMETHOD int | setFraction (double frac, int fracLen) |
virtual EXTRTMETHOD int | setFraction (char const *frac) |
virtual EXTRTMETHOD int | setDiffHour (short dhour) |
virtual EXTRTMETHOD int | setDiff (short dhour, short dminute) |
virtual EXTRTMETHOD int | setDiff (short inMinutes) |
virtual EXTRTMETHOD int | parseString (const char *string) |
virtual EXTRTMETHOD void | clear () |
virtual EXTRTMETHOD int | equals (ASN1CTime &) |
EXTRTMETHOD OSSIZE | getTimeStringLen () |
EXTRTMETHOD const char * | getTimeString (char *pbuf, OSSIZE bufsize) |
EXTRTMETHOD const ASN1CTime & | operator= (const ASN1CTime &) |
virtual EXTRTMETHOD OSBOOL | operator== (ASN1CTime &) |
virtual EXTRTMETHOD OSBOOL | operator!= (ASN1CTime &) |
virtual EXTRTMETHOD OSBOOL | operator> (ASN1CTime &) |
virtual EXTRTMETHOD OSBOOL | operator< (ASN1CTime &) |
virtual EXTRTMETHOD OSBOOL | operator>= (ASN1CTime &) |
virtual EXTRTMETHOD OSBOOL | operator<= (ASN1CTime &) |
Public Member Functions inherited from ASN1CType | |
EXTRTMETHOD | ASN1CType (OSRTMessageBufferIF &msgBuf) |
EXTRTMETHOD | ASN1CType (const ASN1CType &orig) |
virtual | ~ASN1CType () |
void | append (OSRTDList &llist, void *pdata) |
OSRTCtxtPtr | getContext () |
OSCTXT * | getCtxtPtr () |
char * | getErrorText (char *textbuf=(char *) 0, OSSIZE bufsize=0) |
int | getStatus () const |
void * | memAlloc (OSSIZE numocts) |
void * | memAllocZ (OSSIZE numocts) |
void | memFreeAll () |
void * | memRealloc (void *ptr, OSSIZE numocts) |
void | memReset () |
void | memFreePtr (void *ptr) |
void | printErrorInfo () |
void | resetError () |
OSBOOL | setDiag (OSBOOL value) |
virtual EXTRTMETHOD int | Encode () |
virtual EXTRTMETHOD int | Decode (OSBOOL free=FALSE) |
virtual int | EncodeTo (OSRTMessageBufferIF &) |
virtual int | DecodeFrom (OSRTMessageBufferIF &, OSBOOL free=TRUE) |
virtual void | MemFree () |
Protected Member Functions | |
virtual ASN1TTime & | getTimeObj () |
virtual const ASN1TTime & | getTimeObj () const |
EXTRTMETHOD | ASN1CGeneralizedTime (char *&buf, int bufSize, OSBOOL useDerRules=FALSE) |
EXTRTMETHOD | ASN1CGeneralizedTime (ASN1GeneralizedTime &buf, OSBOOL useDerRules=FALSE) |
EXTRTMETHOD int | compileString () |
Protected Member Functions inherited from ASN1CTime | |
EXTRTMETHOD void | checkCapacity () |
EXTRTMETHOD char *& | getTimeStringPtr () |
EXTRTMETHOD | ASN1CTime (char *&buf, OSSIZE bufSize, OSBOOL useDerRules) |
EXTRTMETHOD | ASN1CTime (ASN1VisibleString &buf, OSBOOL useDerRules) |
Protected Member Functions inherited from ASN1CType | |
EXTRTMETHOD | ASN1CType () |
EXTRTMETHOD | ASN1CType (OSRTContext &ctxt) |
EXTRTMETHOD int | setMsgBuf (OSRTMessageBufferIF &msgBuf, OSBOOL initBuf=FALSE) |
EXTRTMETHOD int | setRunTimeKey (const OSOCTET *key, OSSIZE keylen) |
Protected Attributes | |
ASN1TGeneralizedTime | timeObj |
Protected Attributes inherited from ASN1CTime | |
OSBOOL | parsed |
OSBOOL | derRules |
char *& | timeStr |
OSSIZE | strSize |
Protected Attributes inherited from ASN1CType | |
OSRTCtxtPtr | mpContext |
OSRTMessageBufferIF * | mpMsgBuf |
Additional Inherited Members | |
Public Types inherited from ASN1CTime | |
enum | { January = 1, Jan = 1, February = 2, Feb = 2, March = 3, Mar = 3, April = 4, Apr = 4, May = 5, June = 6, Jun = 6, July = 7, Jul = 7, August = 8, Aug = 8, September = 9, Sep = 9, October = 10, Oct = 10, November = 11, Nov = 11, December = 12, Dec = 12 } |
ASN.1 GeneralizedTime control class. The ASN1CGeneralizedTime class is derived from the ASN1CTime base class. It is used as the base class for generated control classes for the ASN.1 Generalized Time ([UNIVERSAL 24] IMPLICIT VisibleString) type. This class provides utility methods for operating on the time information referenced by the generated class. This class can also be used inline to operate on the times within generated time string elements in a SEQUENCE, SET, or CHOICE construct. The time string generally is encoded according to ISO 8601 format with some exceptions (see X.680).
EXTRTMETHOD ASN1CGeneralizedTime::ASN1CGeneralizedTime | ( | OSRTMessageBufferIF & | msgBuf, |
char *& | buf, | ||
int | bufSize, | ||
OSBOOL | useDerRules = FALSE |
||
) |
This constructor creates a time string from a buffer. It does not deep-copy the data, it just assigns the passed array to an internal reference variable. The object will then directly operate on the given data variable.
msgBuf | Reference to an OSRTMessage buffer derived object (for example, an ASN1BEREncodeBuffer). |
buf | A reference pointer to the time string buffer. |
bufSize | The size of the passed buffer, in bytes. |
useDerRules | An OSBOOL value. |
EXTRTMETHOD ASN1CGeneralizedTime::ASN1CGeneralizedTime | ( | OSRTMessageBufferIF & | msgBuf, |
ASN1GeneralizedTime & | buf, | ||
OSBOOL | useDerRules = FALSE |
||
) |
This constructor creates a time string using the ASN1GeneralizedTime argument. The constructor does not deep-copy the variable, it assigns a reference to it to an internal variable. The object will then directly operate on the given data variable. This form of the constructor is used with a complier-generated time string variable.
msgBuf | Reference to an OSRTMessage buffer derived object (for example, an ASN1BEREncodeBuffer). |
buf | A reference pointer to the time string buffer. |
useDerRules | An OSBOOL value. |
EXTRTMETHOD ASN1CGeneralizedTime::ASN1CGeneralizedTime | ( | OSRTContext & | ctxt, |
char *& | buf, | ||
int | bufSize, | ||
OSBOOL | useDerRules = FALSE |
||
) |
This constructor creates a time string from buffer.
It does not deep-copy the data; it just assigns the passed array to an internal reference variable. The object will then directly operate on the given data variable.
ctxt | Reference to an OSRTContext data structure. |
buf | Reference to a pointer to a time string buffer. |
bufSize | Size of buffer in bytes. |
useDerRules | Use the Distinguished Encoding Rules (DER) to operate on this time value. |
EXTRTMETHOD ASN1CGeneralizedTime::ASN1CGeneralizedTime | ( | OSRTContext & | ctxt, |
ASN1GeneralizedTime & | buf, | ||
OSBOOL | useDerRules = FALSE |
||
) |
This constructor creates a time string from an ::ASN1GeneralizedTime object.
It does not deep-copy the data; it just assigns the passed array to an internal reference variable. The object will then directly operate on the given data variable.
ctxt | Reference to an OSRTContext data structure. |
buf | Reference to a pointer to a time string buffer. |
useDerRules | Use the Distinguished Encoding Rules (DER) to operate on this time value. |
|
inline |
The copy constructor. This does not deep-copy the original value. Instead, it assigns references to the internal components.
original | The original time string object value. |
References ASN1CTime::compileString(), ASN1CTime::operator=(), and ASN1CTime::setTime().
|
protectedvirtual |
Compiles new time string accoring X.680 (clause 41) and ISO 8601. Returns 0, if succeed, or error code, if error.
Implements ASN1CTime.
EXTRTMETHOD int ASN1CGeneralizedTime::getCentury | ( | ) |
This method returns the century part (first two digits) of the year component of the time value.
- | none |
EXTRTMETHOD int ASN1CGeneralizedTime::setCentury | ( | short | century | ) |
This method sets the century part (first two digits) of the year component of the time value.
century | Century part (first two digits) of the year component. |
|
virtual |
This converts the value of the C built-in type time_t to a time string.
The value is the number of seconds from January 1, 1970. Note that the action of this method may differ for different inherited ASN1CTime Classes.
time | The time value, expressed as a number of seconds from January 1, 1970. |
diffTime | TRUE means the difference between local time and UTC time will be calculated; in other case, only local time will be stored. |
Implements ASN1CTime.