Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Examples  

AxisTime.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2003-2004 The Apache Software Foundation.
00003  *
00004  *   Licensed under the Apache License, Version 2.0 (the "License");
00005  *   you may not use this file except in compliance with the License.
00006  *   You may obtain a copy of the License at
00007  *
00008  *       http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  *   Unless required by applicable law or agreed to in writing, software
00011  *   distributed under the License is distributed on an "AS IS" BASIS,
00012  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *   See the License for the specific language governing permissions and
00014  *   limitations under the License.
00015  */
00016 
00024 #ifndef __AXISTIME_H_OF_AXIS_INCLUDED_
00025 #define __AXISTIME_H_OF_AXIS_INCLUDED_
00026 
00027 #include "TypeMapping.h"
00028 #include "IParam.h"
00029 
00030 using namespace std;
00031 
00032 typedef struct
00033 {
00034     time_t years;
00035     time_t months;
00036     time_t days;
00037     time_t hours;
00038     time_t mins;
00039     double secs;
00040 } uDuration;
00041 
00042 
00050 class AxisTime
00051 {
00052     public:
00053         AxisTime();
00054         AxisTime(time_t ptrTime_t);
00055         AxisTime(struct tm ntime);
00056         virtual ~AxisTime();
00057         void setValue(const AxisChar* strValue);
00058         void setValue(XSDTYPE type, uParamValue Value);
00059         void setType(XSDTYPE m_Type);
00060         AxisString getValue();
00061         AxisString& serialize(const AxisChar* sName, struct tm tValue, 
00062             XSDTYPE nType);
00063         AxisString& serialize(const AxisChar* sName, long lDuration, 
00064             XSDTYPE nType);
00065         double getDuration();
00066         struct tm getDateTime();
00067         struct tm getDate();
00068         struct tm getTime();
00069         int mkCTime();
00070         static struct tm deserialize(const AxisChar* strValue, XSDTYPE type);
00071         static long deserializeDuration(const AxisChar* strValue, 
00072             XSDTYPE type);
00073 
00074     private:
00075         void processValue();
00076         AxisString m_sValue;
00077         XSDTYPE m_Type;
00078         struct tm m_TM, m_TMUTC, m_TMDuration;
00079         time_t m_Time;
00080         char buf1[80];
00081         AxisString strYears;
00082         AxisString strMonths;
00083         AxisString strDays;
00084         AxisString strHours;
00085         AxisString strMins;
00086         AxisString strSecs;
00087         time_t m_intYears;
00088         time_t m_intMonths;
00089         time_t m_intDays;
00090         time_t m_intHours;
00091         time_t m_intMins;
00092         time_t m_intSecs;
00093         AxisString strZone;
00094         uDuration duration;
00095         time_t m_longYears;
00096         double m_Duration;
00097         /* string strXSDDuration; */
00098         AxisString strXSDDuration;
00099         AxisString strXSDDate;
00100 };
00101 
00102 #endif
00103 

Generated on Fri Jul 9 13:18:28 2004 for AxisC++ by doxygen1.2.18