00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __AXISTIME_H_OF_AXIS_INCLUDED_
00018 #define __AXISTIME_H_OF_AXIS_INCLUDED_
00019
00020 #include <time.h>
00021 #include <string>
00022 #include "TypeMapping.h"
00023 #include "IParam.h"
00024
00025 using namespace std;
00026
00027 typedef struct
00028 {
00029 time_t years;
00030 time_t months;
00031 time_t days;
00032 time_t hours;
00033 time_t mins;
00034 double secs;
00035 } uDuration;
00036
00037
00045 class AxisTime
00046 {
00047 public:
00048 AxisTime();
00049 AxisTime(time_t ptrTime_t);
00050 AxisTime(struct tm ntime);
00051 virtual ~AxisTime();
00052 void setValue(const AxisChar* strValue);
00053 void setValue(XSDTYPE type, uParamValue Value);
00054 void setType(XSDTYPE m_Type);
00055 AxisString getValue();
00056 AxisString& serialize(const AxisChar* sName, struct tm tValue,
00057 XSDTYPE nType);
00058 AxisString& serialize(const AxisChar* sName, long lDuration,
00059 XSDTYPE nType);
00060 double getDuration();
00061 struct tm getDateTime();
00062 struct tm getDate();
00063 struct tm getTime();
00064 int mkCTime();
00065 static struct tm deserialize(const AxisChar* strValue, XSDTYPE type);
00066 static long deserializeDuration(const AxisChar* strValue,
00067 XSDTYPE type);
00068
00069 private:
00070 void processValue();
00071 AxisString m_sValue;
00072 XSDTYPE m_Type;
00073 struct tm m_TM, m_TMUTC, m_TMDuration;
00074 time_t m_Time;
00075 char buf1[80];
00076 AxisString strYears;
00077 AxisString strMonths;
00078 AxisString strDays;
00079 AxisString strHours;
00080 AxisString strMins;
00081 AxisString strSecs;
00082 time_t m_intYears;
00083 time_t m_intMonths;
00084 time_t m_intDays;
00085 time_t m_intHours;
00086 time_t m_intMins;
00087 time_t m_intSecs;
00088 AxisString strZone;
00089 uDuration duration;
00090 time_t m_longYears;
00091 double m_Duration;
00092
00093 AxisString strXSDDuration;
00094 AxisString strXSDDate;
00095 };
00096
00097 #endif
00098