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 <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         /* string strXSDDuration; */
00100         AxisString strXSDDuration;
00101         AxisString strXSDDate;
00102 };
00103 
00104 #endif
00105 

Generated on Tue Jun 29 09:27:56 2004 for AxisC++ by doxygen1.2.18