rtxCppDateTime.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2008 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00028 #ifndef _RTXCPPDATETIME_H_
00029 #define _RTXCPPDATETIME_H_
00030 
00031 #include "rtxsrc/rtxCommon.h"
00032 #include "rtxsrc/OSRTBaseType.h"
00033 
00034 class EXTRTCLASS OSXSDDateTimeClass
00035    : public OSXSDDateTime, public OSRTBaseType {
00036  public:
00041    OSXSDDateTimeClass ();
00042    
00048    OSXSDDateTimeClass (const OSUTF8CHAR* dtString);
00049    
00063    OSXSDDateTimeClass (OSINT32 year_, OSUINT8 mon_,
00064                         OSUINT8 day_, OSUINT8 hour_, OSUINT8 min_,
00065                         OSREAL sec_, OSBOOL tz_flag_, OSINT32 tzo_);
00072    OSXSDDateTimeClass (const OSXSDDateTimeClass& dt);
00073 
00080    OSXSDDateTimeClass (const OSXSDDateTime& dt);
00081 
00086    OSRTBaseType* clone () const { return new OSXSDDateTimeClass (*this); }
00087 
00097    int getTime (time_t& timeMs);
00098 
00108    virtual int parseString (const OSUTF8CHAR* dtString);
00109  
00115    void print (const char* name);
00116 
00125    int setCurrent ();
00126 
00135    int setCurrentTz ();
00136 
00145    int setDateTime (struct tm* time);
00146 
00155    int setLocalTime (time_t timeMs);
00156 
00168    int setUtcTime (time_t timeMs);
00169 
00175    void setValue (const OSUTF8CHAR* utf8str);
00176 
00182    void setValue (const OSXSDDateTime& dt);
00183 
00191    const OSUTF8CHAR* toString ();
00192 
00201    virtual const OSUTF8CHAR* toString (OSUTF8CHAR* buffer, size_t bufsize);
00202 
00206    inline OSXSDDateTimeClass& operator= (const OSXSDDateTimeClass& orig) {
00207       setValue (orig);
00208       return *this;
00209    }
00210 } ;
00211 
00212 class EXTRTCLASS OSXSDDateClass : public OSXSDDateTimeClass {
00213  public:
00218    OSXSDDateClass () {}
00219 
00225    OSXSDDateClass (const OSUTF8CHAR* dtString);
00226    
00240    OSXSDDateClass (OSINT32 year, OSUINT8 mon,
00241                    OSUINT8 day, OSUINT8 hour, OSUINT8 min,
00242                    OSREAL sec, OSBOOL tz_flag,OSINT32 tzo):
00243       OSXSDDateTimeClass (year, mon, day, hour, min, sec, tz_flag, tzo) {}
00244 
00251    OSXSDDateClass (const OSXSDDateTimeClass& dt) :
00252       OSXSDDateTimeClass (dt) {}
00253 
00260    OSXSDDateClass (const OSXSDDateTime& dt) :
00261       OSXSDDateTimeClass (dt) {}
00262 
00267    OSRTBaseType* clone () const { return new OSXSDDateClass (*this); }
00268 
00278    virtual int parseString (const OSUTF8CHAR* dtString);
00279 
00285    void print (const char* name);
00286 
00295    virtual const OSUTF8CHAR* toString (OSUTF8CHAR* buffer, size_t bufsize);
00296 } ;
00297 
00298 class EXTRTCLASS OSXSDTimeClass : public OSXSDDateTimeClass {
00299  public:
00304    OSXSDTimeClass () {}
00305 
00311    OSXSDTimeClass (const OSUTF8CHAR* dtString);
00312    
00326    OSXSDTimeClass (OSINT32 year, OSUINT8 mon,
00327                    OSUINT8 day, OSUINT8 hour, OSUINT8 min,
00328                    OSREAL sec, OSBOOL tz_flag,OSINT32 tzo):
00329       OSXSDDateTimeClass (year, mon, day, hour, min, sec, tz_flag, tzo) {}
00330 
00337    OSXSDTimeClass (const OSXSDDateTimeClass& dt) :
00338       OSXSDDateTimeClass (dt) {}
00339 
00346    OSXSDTimeClass (const OSXSDDateTime& dt) :
00347       OSXSDDateTimeClass (dt) {}
00348 
00353    OSRTBaseType* clone () const { return new OSXSDTimeClass (*this); }
00354 
00364    virtual int parseString (const OSUTF8CHAR* dtString);
00365 
00371    void print (const char* name);
00372 
00381    virtual const OSUTF8CHAR* toString (OSUTF8CHAR* buffer, size_t bufsize);
00382 } ;
00383 
00384 #endif