ASN1C C/C++ Common Runtime
ASN1C v7.4.x
|
#include <ASN1TTime.h>
Public Member Functions | |
ASN1TGeneralizedTime () | |
EXTRTMETHOD | ASN1TGeneralizedTime (const char *buf, OSBOOL useDerRules=FALSE) |
ASN1TGeneralizedTime (OSBOOL useDerRules) | |
ASN1TGeneralizedTime (const ASN1TGeneralizedTime &original) | |
EXTRTMETHOD int | getCentury () const |
EXTRTMETHOD int | setCentury (short century) |
EXTRTMETHOD int | setTime (time_t time, OSBOOL diffTime) |
EXTRTMETHOD int | parseString (const char *string) |
const ASN1TGeneralizedTime & | operator= (const ASN1TGeneralizedTime &tm) |
EXTRTMETHOD int | compileString (char *pbuf, OSSIZE bufsize) const |
Public Member Functions inherited from ASN1TTime | |
EXTRTMETHOD | ASN1TTime () |
EXTRTMETHOD | ASN1TTime (OSBOOL useDerRules) |
EXTRTMETHOD | ASN1TTime (const ASN1TTime &original) |
virtual EXTRTMETHOD | ~ASN1TTime () |
virtual EXTRTMETHOD int | getYear () const |
virtual EXTRTMETHOD int | getMonth () const |
virtual EXTRTMETHOD int | getDay () const |
virtual EXTRTMETHOD int | getHour () const |
virtual EXTRTMETHOD int | getMinute () const |
virtual EXTRTMETHOD int | getSecond () const |
virtual EXTRTMETHOD int | getFraction () const |
virtual EXTRTMETHOD double | getFractionAsDouble () const |
virtual EXTRTMETHOD int | getFractionStr (char *const pBuf, OSSIZE bufSize) const |
virtual EXTRTMETHOD int | getFractionLen () const |
virtual EXTRTMETHOD int | getDiffHour () const |
virtual EXTRTMETHOD int | getDiffMinute () const |
virtual EXTRTMETHOD int | getDiff () const |
virtual EXTRTMETHOD OSBOOL | getUTC () const |
virtual EXTRTMETHOD time_t | getTime () const |
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 void | clear () |
virtual EXTRTMETHOD int | equals (const ASN1TTime &) const |
EXTRTMETHOD const char * | toString (char *pbuf, OSSIZE bufsize) const |
EXTRTMETHOD char * | toString (OSCTXT *pctxt) const |
EXTRTMETHOD char * | toString () const |
EXTRTMETHOD const ASN1TTime & | operator= (const ASN1TTime &) |
virtual EXTRTMETHOD OSBOOL | operator== (const ASN1TTime &) const |
virtual EXTRTMETHOD OSBOOL | operator!= (const ASN1TTime &) const |
virtual EXTRTMETHOD OSBOOL | operator> (const ASN1TTime &) const |
virtual EXTRTMETHOD OSBOOL | operator< (const ASN1TTime &) const |
virtual EXTRTMETHOD OSBOOL | operator>= (const ASN1TTime &) const |
virtual EXTRTMETHOD OSBOOL | operator<= (const ASN1TTime &) const |
Additional Inherited Members | |
Public Types inherited from ASN1TTime | |
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 } |
Public Attributes inherited from ASN1TTime | |
short | mYear |
short | mMonth |
short | mDay |
short | mHour |
short | mMinute |
short | mSecond |
short | mDiffHour |
short | mDiffMin |
int | mSecFraction |
int | mSecFracLen |
int | mStatus |
OSBOOL | mbUtcFlag |
OSBOOL | mbDerRules |
Protected Member Functions inherited from ASN1TTime | |
EXTRTMETHOD void | privateInit () |
EXTRTMETHOD int | getDaysNum () const |
EXTRTMETHOD long | getMillisNum () const |
int | ncharsToInt (const char *str, OSSIZE nchars, int &value) |
Static Protected Member Functions inherited from ASN1TTime | |
static EXTRTMETHOD int | checkDate (int day, int month, int year) |
static EXTRTMETHOD void | addMilliseconds (int deltaMs, short &year, short &month, short &day, short &hour, short &minute, short &second, int &secFraction, int secFracLen) |
static EXTRTMETHOD void | addDays (int deltaDays, short &year, short &month, short &day) |
static EXTRTMETHOD short | daysInMonth (int i) |
static EXTRTMETHOD int | daysAfterMonth (int i) |
ASN.1 GeneralizedTime utility class. The ASN1TGeneralizedTime class is derived from the ASN1TTime base class.
|
inline |
A default constructor.
EXTRTMETHOD ASN1TGeneralizedTime::ASN1TGeneralizedTime | ( | const char * | buf, |
OSBOOL | useDerRules = FALSE |
||
) |
This constructor creates a time object using the specified time string.
buf | A pointer to the time string to be parsed. |
useDerRules | An OSBOOL value. |
|
inline |
This constructor creates an empty time object.
useDerRules | An OSBOOL value. |
|
inline |
A copy constructor.
References ASN1TTime::compileString(), ASN1TTime::parseString(), and ASN1TTime::setTime().
|
virtual |
Compiles new time string accoring X.680 and ISO 8601. Returns 0, if succeed, or error code, if error.
pbuf | A pointer to destination buffer. |
bufsize | A size of destination buffer. |
Implements ASN1TTime.
EXTRTMETHOD int ASN1TGeneralizedTime::getCentury | ( | ) | const |
This method returns the centry part (first two digits) of the year component of the time value.
|
virtual |
Parses sting.
Implements ASN1TTime.
EXTRTMETHOD int ASN1TGeneralizedTime::setCentury | ( | short | century | ) |
This method sets the centry 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.
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 ASN1TTime.