25 #ifndef __ASN1TTIME_H__ 26 #define __ASN1TTIME_H__ 34 #define MAX_TIMESTR_SIZE 64 42 #define LOG_TTMERR(stat) (mStatus = stat, stat) 140 January = 1, Jan = 1,
141 February = 2, Feb = 2,
148 September = 9, Sep = 9,
149 October = 10, Oct = 10,
150 November = 11, Nov = 11,
151 December = 12, Dec = 12
165 EXTRTMETHOD ASN1TTime (OSBOOL useDerRules);
173 EXTRTMETHOD ASN1TTime (
const ASN1TTime& original);
178 virtual EXTRTMETHOD ~ASN1TTime();
190 virtual EXTRTMETHOD
int getYear()
const;
205 virtual EXTRTMETHOD
int getMonth()
const;
218 virtual EXTRTMETHOD
int getDay()
const;
231 virtual EXTRTMETHOD
int getHour()
const;
243 virtual EXTRTMETHOD
int getMinute()
const;
255 virtual EXTRTMETHOD
int getSecond()
const;
266 virtual EXTRTMETHOD
int getFraction()
const;
279 virtual EXTRTMETHOD
double getFractionAsDouble()
const;
290 virtual EXTRTMETHOD
int getFractionStr(
char*
const pBuf, OSSIZE bufSize)
const;
300 virtual EXTRTMETHOD
int getFractionLen()
const;
316 virtual EXTRTMETHOD
int getDiffHour()
const;
332 virtual EXTRTMETHOD
int getDiffMinute()
const;
348 virtual EXTRTMETHOD
int getDiff()
const;
358 virtual EXTRTMETHOD OSBOOL getUTC()
const;
375 virtual EXTRTMETHOD time_t getTime()
const;
381 void setDER (OSBOOL bvalue) { mbDerRules = bvalue; }
394 virtual EXTRTMETHOD
int setUTC(OSBOOL utc);
407 virtual EXTRTMETHOD
int setYear(
short year_);
423 virtual EXTRTMETHOD
int setMonth(
short month_);
437 virtual EXTRTMETHOD
int setDay(
short day_);
451 virtual EXTRTMETHOD
int setHour(
short hour_);
464 virtual EXTRTMETHOD
int setMinute(
short minute_);
477 virtual EXTRTMETHOD
int setSecond(
short second_);
494 virtual EXTRTMETHOD
int setFraction(
int fraction,
int fracLen = -1);
507 virtual EXTRTMETHOD
int setFraction (
double frac,
int fracLen);
518 virtual EXTRTMETHOD
int setFraction (
char const* frac);
536 virtual int setTime(time_t time, OSBOOL diffTime) = 0;
555 virtual EXTRTMETHOD
int setDiffHour(
short dhour);
575 virtual EXTRTMETHOD
int setDiff(
short dhour,
short dminute);
593 virtual EXTRTMETHOD
int setDiff(
short inMinutes);
607 virtual int parseString (
const char*
string) = 0;
615 virtual EXTRTMETHOD
void clear();
627 virtual int compileString (
char* pbuf, OSSIZE bufsize)
const = 0;
633 virtual EXTRTMETHOD
int equals (
const ASN1TTime&)
const;
642 EXTRTMETHOD
const char* toString (
char* pbuf, OSSIZE bufsize)
const;
653 EXTRTMETHOD
char* toString (
OSCTXT* pctxt)
const;
662 EXTRTMETHOD
char* toString ()
const;
664 EXTRTMETHOD
const ASN1TTime& operator = (
const ASN1TTime& );
665 virtual EXTRTMETHOD OSBOOL
operator == (
const ASN1TTime&)
const;
666 virtual EXTRTMETHOD OSBOOL
operator != (
const ASN1TTime&)
const;
667 virtual EXTRTMETHOD OSBOOL
operator > (
const ASN1TTime&)
const;
668 virtual EXTRTMETHOD OSBOOL
operator < (
const ASN1TTime&)
const;
669 virtual EXTRTMETHOD OSBOOL
operator >= (
const ASN1TTime&)
const;
670 virtual EXTRTMETHOD OSBOOL
operator <= (
const ASN1TTime&)
const;
673 EXTRTMETHOD
static int checkDate (
int day,
int month,
int year);
674 EXTRTMETHOD
void privateInit ();
676 EXTRTMETHOD
static void addMilliseconds (
int deltaMs,
677 short& year,
short& month,
short& day,
678 short& hour,
short& minute,
679 short& second,
int& secFraction,
681 EXTRTMETHOD
static void addDays (
int deltaDays,
short& year,
short& month,
short& day);
683 EXTRTMETHOD
int getDaysNum ()
const;
684 EXTRTMETHOD
long getMillisNum ()
const;
686 EXTRTMETHOD
static short daysInMonth(
int i);
687 EXTRTMETHOD
static int daysAfterMonth(
int i);
688 int ncharsToInt (
const char* str, OSSIZE nchars,
int& value);
734 EXTRTMETHOD
int getCentury()
const;
745 EXTRTMETHOD
int setCentury(
short century);
761 EXTRTMETHOD
int setTime(time_t time, OSBOOL diffTime);
772 inline const ASN1TGeneralizedTime&
operator =
773 (
const ASN1TGeneralizedTime& tm)
775 return (
const ASN1TGeneralizedTime&) ASN1TTime::operator = (tm);
788 EXTRTMETHOD
int compileString (
char* pbuf, OSSIZE bufsize)
const;
809 EXTRTMETHOD ASN1TUTCTime(
const char* timeStr, OSBOOL useDerRules = FALSE);
816 EXTRTMETHOD ASN1TUTCTime(OSBOOL useDerRules);
838 EXTRTMETHOD
int setYear(
short year_);
851 EXTRTMETHOD
int setTime(time_t time, OSBOOL diffTime);
864 EXTRTMETHOD
int setUTC (OSBOOL utc);
869 EXTRTMETHOD
void clear();
881 EXTRTMETHOD
int compileString (
char* pbuf, OSSIZE bufsize)
const;
894 const ASN1TUTCTime& operator = (
const ASN1TUTCTime& tm) {
895 return (ASN1TUTCTime&) ASN1TTime::operator = (tm);
909 EXTRTMETHOD
int setFraction (
int fraction,
int fracLen = -1);
912 #endif //__ASN1TTIME_H__ ASN1TGeneralizedTime()
Definition: ASN1TTime.h:701
short mSecond
Definition: ASN1TTime.h:101
int operator>=(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
Definition: ASN1TTime.h:71
short mDiffHour
Definition: ASN1TTime.h:106
short mMonth
Definition: ASN1TTime.h:81
int operator<=(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
Definition: ASN1TTime.h:795
virtual int setTime(time_t time, OSBOOL diffTime)=0
int operator<(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
virtual EXTRTMETHOD int getFraction() const
ASN1TGeneralizedTime(OSBOOL useDerRules)
Definition: ASN1TTime.h:716
int operator==(const ASN1OBJID &lhs, const ASN1OBJID &rhs)
int mStatus
Definition: ASN1TTime.h:126
OSBOOL mbUtcFlag
Definition: ASN1TTime.h:131
Definition: ASN1TTime.h:695
short mYear
Definition: ASN1TTime.h:76
ASN1TUTCTime(const ASN1TUTCTime &original)
Definition: ASN1TTime.h:821
virtual EXTRTMETHOD void clear()
virtual EXTRTMETHOD int setFraction(int fraction, int fracLen=-1)
virtual EXTRTMETHOD int setYear(short year_)
OSBOOL mbDerRules
Definition: ASN1TTime.h:137
virtual EXTRTMETHOD int setUTC(OSBOOL utc)
virtual int compileString(char *pbuf, OSSIZE bufsize) const =0
short mMinute
Definition: ASN1TTime.h:96
int mSecFracLen
Definition: ASN1TTime.h:121
short mDiffMin
Definition: ASN1TTime.h:111
short mDay
Definition: ASN1TTime.h:86
Definition: rtxContext.h:185
void setDER(OSBOOL bvalue)
Definition: ASN1TTime.h:381
virtual int parseString(const char *string)=0
int mSecFraction
Definition: ASN1TTime.h:116
short mHour
Definition: ASN1TTime.h:91
int operator!=(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
int operator>(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
ASN1TGeneralizedTime(const ASN1TGeneralizedTime &original)
Definition: ASN1TTime.h:722