Main Page   Class Hierarchy   Compound List   File List   Compound Members   Examples  

AxisTime.h

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  
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         /* string strXSDDuration; */
00093         AxisString strXSDDuration;
00094         AxisString strXSDDate;
00095 };
00096 
00097 #endif
00098 

Generated on Tue Jun 15 19:13:22 2004 for axiscpp by doxygen1.2.18