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