25 #ifndef __ASN1TTIME_H__ 26 #define __ASN1TTIME_H__ 34 #define MAX_TIMESTR_SIZE 64 42 #define LOG_TTMERR(stat) (mStatus = stat, stat) 135 January = 1, Jan = 1,
136 February = 2, Feb = 2,
143 September = 9, Sep = 9,
144 October = 10, Oct = 10,
145 November = 11, Nov = 11,
146 December = 12, Dec = 12
160 EXTRTMETHOD ASN1TTime (OSBOOL useDerRules);
168 EXTRTMETHOD ASN1TTime (
const ASN1TTime& original);
173 virtual EXTRTMETHOD ~ASN1TTime();
185 virtual EXTRTMETHOD
int getYear()
const;
200 virtual EXTRTMETHOD
int getMonth()
const;
213 virtual EXTRTMETHOD
int getDay()
const;
226 virtual EXTRTMETHOD
int getHour()
const;
238 virtual EXTRTMETHOD
int getMinute()
const;
250 virtual EXTRTMETHOD
int getSecond()
const;
261 virtual EXTRTMETHOD
int getFraction()
const;
274 virtual EXTRTMETHOD
double getFractionAsDouble()
const;
285 virtual EXTRTMETHOD
int getFractionStr(
char*
const pBuf, OSSIZE bufSize)
const;
295 virtual EXTRTMETHOD
int getFractionLen()
const;
311 virtual EXTRTMETHOD
int getDiffHour()
const;
327 virtual EXTRTMETHOD
int getDiffMinute()
const;
343 virtual EXTRTMETHOD
int getDiff()
const;
353 virtual EXTRTMETHOD OSBOOL getUTC()
const;
370 virtual EXTRTMETHOD time_t getTime()
const;
376 void setDER (OSBOOL bvalue) { mbDerRules = bvalue; }
389 virtual EXTRTMETHOD
int setUTC(OSBOOL utc);
402 virtual EXTRTMETHOD
int setYear(
short year_);
418 virtual EXTRTMETHOD
int setMonth(
short month_);
432 virtual EXTRTMETHOD
int setDay(
short day_);
446 virtual EXTRTMETHOD
int setHour(
short hour_);
459 virtual EXTRTMETHOD
int setMinute(
short minute_);
472 virtual EXTRTMETHOD
int setSecond(
short second_);
489 virtual EXTRTMETHOD
int setFraction(
int fraction,
int fracLen = -1);
502 virtual EXTRTMETHOD
int setFraction (
double frac,
int fracLen);
513 virtual EXTRTMETHOD
int setFraction (
char const* frac);
531 virtual int setTime(time_t time, OSBOOL diffTime) = 0;
550 virtual EXTRTMETHOD
int setDiffHour(
short dhour);
570 virtual EXTRTMETHOD
int setDiff(
short dhour,
short dminute);
588 virtual EXTRTMETHOD
int setDiff(
short inMinutes);
602 virtual int parseString (
const char*
string) = 0;
610 virtual EXTRTMETHOD
void clear();
622 virtual int compileString (
char* pbuf, OSSIZE bufsize)
const = 0;
628 virtual EXTRTMETHOD
int equals (
const ASN1TTime&)
const;
637 EXTRTMETHOD
const char* toString (
char* pbuf, OSSIZE bufsize)
const;
648 EXTRTMETHOD
char* toString (
OSCTXT* pctxt)
const;
657 EXTRTMETHOD
char* toString ()
const;
659 EXTRTMETHOD
const ASN1TTime& operator = (
const ASN1TTime& );
660 virtual EXTRTMETHOD OSBOOL
operator == (
const ASN1TTime&)
const;
661 virtual EXTRTMETHOD OSBOOL
operator != (
const ASN1TTime&)
const;
662 virtual EXTRTMETHOD OSBOOL
operator > (
const ASN1TTime&)
const;
663 virtual EXTRTMETHOD OSBOOL
operator < (
const ASN1TTime&)
const;
664 virtual EXTRTMETHOD OSBOOL
operator >= (
const ASN1TTime&)
const;
665 virtual EXTRTMETHOD OSBOOL
operator <= (
const ASN1TTime&)
const;
668 EXTRTMETHOD
static int checkDate (
int day,
int month,
int year);
669 EXTRTMETHOD
void privateInit ();
671 EXTRTMETHOD
static void addMilliseconds (
int deltaMs,
672 short& year,
short& month,
short& day,
673 short& hour,
short& minute,
674 short& second,
int& secFraction,
676 EXTRTMETHOD
static void addDays (
int deltaDays,
short& year,
short& month,
short& day);
678 EXTRTMETHOD
int getDaysNum ()
const;
679 EXTRTMETHOD
long getMillisNum ()
const;
681 EXTRTMETHOD
static short daysInMonth(
int i);
682 EXTRTMETHOD
static int daysAfterMonth(
int i);
683 int ncharsToInt (
const char* str, OSSIZE nchars,
int& value);
729 EXTRTMETHOD
int getCentury()
const;
740 EXTRTMETHOD
int setCentury(
short century);
756 EXTRTMETHOD
int setTime(time_t time, OSBOOL diffTime);
767 inline const ASN1TGeneralizedTime&
operator =
768 (
const ASN1TGeneralizedTime& tm)
770 return (
const ASN1TGeneralizedTime&) ASN1TTime::operator = (tm);
783 EXTRTMETHOD
int compileString (
char* pbuf, OSSIZE bufsize)
const;
804 EXTRTMETHOD ASN1TUTCTime(
const char* timeStr, OSBOOL useDerRules = FALSE);
811 EXTRTMETHOD ASN1TUTCTime(OSBOOL useDerRules);
833 EXTRTMETHOD
int setYear(
short year_);
846 EXTRTMETHOD
int setTime(time_t time, OSBOOL diffTime);
859 EXTRTMETHOD
int setUTC (OSBOOL utc);
864 EXTRTMETHOD
void clear();
876 EXTRTMETHOD
int compileString (
char* pbuf, OSSIZE bufsize)
const;
889 const ASN1TUTCTime& operator = (
const ASN1TUTCTime& tm) {
890 return (ASN1TUTCTime&) ASN1TTime::operator = (tm);
904 EXTRTMETHOD
int setFraction (
int fraction,
int fracLen = -1);
907 #endif //__ASN1TTIME_H__ ASN1TGeneralizedTime()
Definition: ASN1TTime.h:696
short mSecond
Definition: ASN1TTime.h:96
int operator>=(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
Definition: ASN1TTime.h:66
short mDiffHour
Definition: ASN1TTime.h:101
short mMonth
Definition: ASN1TTime.h:76
int operator<=(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
Definition: ASN1TTime.h:790
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:711
int operator==(const ASN1OBJID &lhs, const ASN1OBJID &rhs)
int mStatus
Definition: ASN1TTime.h:121
OSBOOL mbUtcFlag
Definition: ASN1TTime.h:126
Definition: ASN1TTime.h:690
short mYear
Definition: ASN1TTime.h:71
ASN1TUTCTime(const ASN1TUTCTime &original)
Definition: ASN1TTime.h:816
virtual EXTRTMETHOD void clear()
virtual EXTRTMETHOD int setFraction(int fraction, int fracLen=-1)
virtual EXTRTMETHOD int setYear(short year_)
OSBOOL mbDerRules
Definition: ASN1TTime.h:132
virtual EXTRTMETHOD int setUTC(OSBOOL utc)
virtual int compileString(char *pbuf, OSSIZE bufsize) const =0
short mMinute
Definition: ASN1TTime.h:91
int mSecFracLen
Definition: ASN1TTime.h:116
short mDiffMin
Definition: ASN1TTime.h:106
short mDay
Definition: ASN1TTime.h:81
Definition: rtxContext.h:189
void setDER(OSBOOL bvalue)
Definition: ASN1TTime.h:376
virtual int parseString(const char *string)=0
int mSecFraction
Definition: ASN1TTime.h:111
short mHour
Definition: ASN1TTime.h:86
int operator!=(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
int operator>(const ASN1TObjId &lhs, const ASN1TObjId &rhs)
ASN1TGeneralizedTime(const ASN1TGeneralizedTime &original)
Definition: ASN1TTime.h:717