ASN1C C/C++ Common Runtime
ASN1C v7.5.x
|
#include <ASN1TTime.h>
Public Member Functions | |
EXTRTMETHOD | ASN1TUTCTime () |
EXTRTMETHOD | ASN1TUTCTime (const char *timeStr, OSBOOL useDerRules=FALSE) |
EXTRTMETHOD | ASN1TUTCTime (OSBOOL useDerRules) |
ASN1TUTCTime (const ASN1TUTCTime &original) | |
EXTRTMETHOD int | setYear (short year_) |
EXTRTMETHOD int | setTime (time_t time, OSBOOL diffTime) |
EXTRTMETHOD int | setUTC (OSBOOL utc) |
EXTRTMETHOD void | clear () |
EXTRTMETHOD int | compileString (char *pbuf, OSSIZE bufsize) const |
EXTRTMETHOD int | parseString (const char *string) |
const ASN1TUTCTime & | operator= (const ASN1TUTCTime &tm) |
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 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 | 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 (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 | 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 |
Protected Member Functions | |
EXTRTMETHOD int | getFraction () const |
EXTRTMETHOD int | setFraction (int fraction, int fracLen=-1) |
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) |
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 |
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 UTCTime utility class. The ASN1TUTTime class is derived from the ASN1TTime base class.
EXTRTMETHOD ASN1TUTCTime::ASN1TUTCTime | ( | ) |
A default constructor.
EXTRTMETHOD ASN1TUTCTime::ASN1TUTCTime | ( | const char * | timeStr, |
OSBOOL | useDerRules = FALSE |
||
) |
This constructor creates a time object using the specified time string.
timeStr | A pointer to the time string to be parsed. |
useDerRules | Create object using DER rules. |
EXTRTMETHOD ASN1TUTCTime::ASN1TUTCTime | ( | OSBOOL | useDerRules | ) |
This constructor creates an empty time object.
useDerRules | An OSBOOL value. |
|
inline |
A copy constructor.
References ASN1TTime::clear(), ASN1TTime::compileString(), ASN1TTime::getFraction(), ASN1TTime::parseString(), ASN1TTime::setFraction(), ASN1TTime::setTime(), ASN1TTime::setUTC(), and ASN1TTime::setYear().
|
virtual |
Clears out the time object.
Reimplemented from ASN1TTime.
|
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.
|
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.
Reimplemented from ASN1TTime.
|
virtual |
Parses the given time string. The string is assumed to be in standard UTC time format.
string | UTC time string to be parsed. |
Implements ASN1TTime.
|
protectedvirtual |
This method sets the second's decimal fraction component of the time value.
Second's decimal fraction is represented by one or more digits from 0 to 9. Note that the action of this method may differ for different inherited ASN1TTime classes.
fraction | Second's decimal fraction component (0 - 9). |
fracLen | Optional parameter specifies number of digits in second's fraction. |
Reimplemented from ASN1TTime.
|
virtual |
Converts time_t to time string.
time | time to convert, |
diffTime | TRUE means the difference between local time and UTC will be calculated; in other case only local time will be stored. |
Implements ASN1TTime.
|
virtual |
This method sets the UTC flag state.
If the UTC flag is TRUE, then the time is a UTC time and symbol 'Z' is added to the end of the string. Otherwise, it is a local time.
utc | UTC flag state. |
Reimplemented from ASN1TTime.
|
virtual |
This method sets the year component of the time value.
The year parameter can be either the two last digits of the year (00 - 99) or the full four digits (0 - 9999). Note: the getYear method returns the year in the full four digits, independent of the format of the year parameter used in this method.
year_ | Year component (full four digits or only last two digits). |
Reimplemented from ASN1TTime.