Home > Support > Documentation

rtxCppDateTime.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2006 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 EXTERNRTX OSXSDDateTimeClass : public OSXSDDateTime, public OSRTBaseType {
00035  public:
00040    OSXSDDateTimeClass ();
00041    
00047    OSXSDDateTimeClass (const OSUTF8CHAR* dtString);
00048    
00062    OSXSDDateTimeClass (OSINT32 year_, OSUINT8 mon_,
00063                         OSUINT8 day_, OSUINT8 hour_, OSUINT8 min_,
00064                         OSREAL sec_, OSBOOL tz_flag_, OSINT32 tzo_);
00071    OSXSDDateTimeClass (const OSXSDDateTimeClass& dt);
00072 
00079    OSXSDDateTimeClass (const OSXSDDateTime& dt);
00080 
00085    OSRTBaseType* clone () const { return new OSXSDDateTimeClass (*this); }
00086 
00096    int getTime (time_t& timeMs);
00097 
00107    virtual int parseString (const OSUTF8CHAR* dtString);
00108  
00114    void print (const char* name);
00115 
00124    int setCurrent ();
00125 
00134    int setCurrentTz ();
00135 
00144    int setDateTime (struct tm* time);
00145 
00154    int setLocalTime (time_t timeMs);
00155 
00167    int setUtcTime (time_t timeMs);
00168 
00174    void setValue (const OSUTF8CHAR* utf8str);
00175 
00181    void setValue (const OSXSDDateTime& dt);
00182 
00190    const OSUTF8CHAR* toString ();
00191 
00200    virtual const OSUTF8CHAR* toString (OSUTF8CHAR* buffer, size_t bufsize);
00201 
00205    inline OSXSDDateTimeClass& operator= (const OSXSDDateTimeClass& orig) {
00206       setValue (orig);
00207       return *this;
00208    }
00209 } ;
00210 
00211 class EXTERNRTX OSXSDDateClass : public OSXSDDateTimeClass {
00212  public:
00217    OSXSDDateClass () {}
00218 
00224    OSXSDDateClass (const OSUTF8CHAR* dtString);
00225    
00239    OSXSDDateClass (OSINT32 year, OSUINT8 mon,
00240                    OSUINT8 day, OSUINT8 hour, OSUINT8 min,
00241                    OSREAL sec, OSBOOL tz_flag,OSINT32 tzo):
00242       OSXSDDateTimeClass (year, mon, day, hour, min, sec, tz_flag, tzo) {}
00243 
00250    OSXSDDateClass (const OSXSDDateTimeClass& dt) :
00251       OSXSDDateTimeClass (dt) {}
00252 
00259    OSXSDDateClass (const OSXSDDateTime& dt) :
00260       OSXSDDateTimeClass (dt) {}
00261 
00266    OSRTBaseType* clone () const { return new OSXSDDateClass (*this); }
00267 
00277    virtual int parseString (const OSUTF8CHAR* dtString);
00278 
00284    void print (const char* name);
00285 
00294    virtual const OSUTF8CHAR* toString (OSUTF8CHAR* buffer, size_t bufsize);
00295 } ;
00296 
00297 class EXTERNRTX OSXSDTimeClass : public OSXSDDateTimeClass {
00298  public:
00303    OSXSDTimeClass () {}
00304 
00310    OSXSDTimeClass (const OSUTF8CHAR* dtString);
00311    
00325    OSXSDTimeClass (OSINT32 year, OSUINT8 mon,
00326                    OSUINT8 day, OSUINT8 hour, OSUINT8 min,
00327                    OSREAL sec, OSBOOL tz_flag,OSINT32 tzo):
00328       OSXSDDateTimeClass (year, mon, day, hour, min, sec, tz_flag, tzo) {}
00329 
00336    OSXSDTimeClass (const OSXSDDateTimeClass& dt) :
00337       OSXSDDateTimeClass (dt) {}
00338 
00345    OSXSDTimeClass (const OSXSDDateTime& dt) :
00346       OSXSDDateTimeClass (dt) {}
00347 
00352    OSRTBaseType* clone () const { return new OSXSDTimeClass (*this); }
00353 
00363    virtual int parseString (const OSUTF8CHAR* dtString);
00364 
00370    void print (const char* name);
00371 
00380    virtual const OSUTF8CHAR* toString (OSUTF8CHAR* buffer, size_t bufsize);
00381 } ;
00382 
00383 #endif