ASN1C C/C++ Common Runtime  ASN1C v7.5.x
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

#include <ASN1CUTCTime.h>

Inheritance diagram for ASN1CUTCTime:
ASN1CTime ASN1CType

Public Member Functions

EXTRTMETHOD ASN1CUTCTime (OSRTMessageBufferIF &msgBuf, char *&buf, int bufSize, OSBOOL useDerRules=FALSE)
 
EXTRTMETHOD ASN1CUTCTime (OSRTMessageBufferIF &msgBuf, ASN1UTCTime &buf, OSBOOL useDerRules=FALSE)
 
EXTRTMETHOD ASN1CUTCTime (OSRTContext &ctxt, char *&buf, int bufSize, OSBOOL useDerRules=FALSE)
 
EXTRTMETHOD ASN1CUTCTime (OSRTContext &ctxt, ASN1UTCTime &buf, OSBOOL useDerRules=FALSE)
 
 ASN1CUTCTime (const ASN1CUTCTime &original)
 
EXTRTMETHOD int setTime (time_t time, OSBOOL diffTime)
 
const ASN1CUTCTimeoperator= (const ASN1CUTCTime &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 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 ASN1CTimeoperator= (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 ()
 
OSCTXTgetCtxtPtr ()
 
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 ASN1TTimegetTimeObj ()
 
virtual const ASN1TTimegetTimeObj () const
 
EXTRTMETHOD ASN1CUTCTime (char *&buf, int bufSize, OSBOOL useDerRules=FALSE)
 
EXTRTMETHOD ASN1CUTCTime (ASN1UTCTime &buf, OSBOOL useDerRules=FALSE)
 
EXTRTMETHOD int compileString ()
 
EXTRTMETHOD int getFraction ()
 
EXTRTMETHOD int setFraction (int fraction)
 
- 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

ASN1TUTCTime 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
}
 

Detailed Description

ASN.1 UTCTime control class. The ASN1CUTTime class is derived from the ASN1CTime base class. It used as the bass class for generated control classes for the ASN.1 Universal Time ([UNIVERSAL 23] 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 time within generated time string elements in a SEQUENCE, SET, or CHOICE construct. The string generally is encoded according to ISO 8601 format with some exceptions (see X.680).

Constructor & Destructor Documentation

◆ ASN1CUTCTime() [1/2]

EXTRTMETHOD ASN1CUTCTime::ASN1CUTCTime ( 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.

Parameters
msgBufReference to an ASN1MEssage buffer derived object (for example, an ASN1BEREncodeBuffer).
bufReference to a pointer to a time string buffer.
bufSizeSize of passed buffer, in bytes.
useDerRulesUse the Distinguished Encoding Rules to encode or decode the value,

◆ ASN1CUTCTime() [2/2]

EXTRTMETHOD ASN1CUTCTime::ASN1CUTCTime ( OSRTMessageBufferIF &  msgBuf,
ASN1UTCTime &  buf,
OSBOOL  useDerRules = FALSE 
)

This constructor creates a time string suing the ASN1UTCTime argument. c The constructor does not deep-copy the variable, it assigns a referene 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 compiler-generated time string variable.

Parameters
msgBufReference to an ASN1MEssage buffer derived object (for example, an ASN1BEREncodeBuffer).
bufReference to a time string structure.
useDerRulesUse the Distinguished Encoding Rules to encode or decode the value,

Member Function Documentation

◆ compileString()

EXTRTMETHOD int ASN1CUTCTime::compileString ( )
protectedvirtual

Compiles new time string accoring X.680 and ISO 8601.

Returns
0 on success, or an error code if there was an error.

Implements ASN1CTime.

◆ getFraction()

EXTRTMETHOD int ASN1CUTCTime::getFraction ( )
protectedvirtual

This method returns the second's decimal component of the time value.

Second's decimal fraction is represented by one or more digits from 0 to 9. Note that the return value may differ for different inherited ASN1CTime classes.

Parameters
-none
Returns
Second's decimal fraction component (0 - 9) is returned if operation is successful. If the operation fails, a negative value is returned.

Reimplemented from ASN1CTime.

◆ setTime()

EXTRTMETHOD int ASN1CUTCTime::setTime ( time_t  time,
OSBOOL  diffTime 
)
virtual

Converts time_t to time string.

Parameters
timetime to convert,
diffTimeTRUE means the difference between local time and UTC will be calculated; in other case only local time will be stored.
Returns
Completion status of operation:
  • 0 (0) = success,
  • negative return value is error.

Implements ASN1CTime.


The documentation for this class was generated from the following file: