SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWCollectableDateTime Class Reference

Provides a polymorphically persistable RWDateTime. More...

#include <rw/tools/ctdatetime.h>

Inheritance diagram for RWCollectableDateTime:
RWCollectable RWDateTime

Public Member Functions

 RWCollectableDateTime ()
 
 RWCollectableDateTime (const RWCString &str, SetType set_type=setBoth, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local())
 
 RWCollectableDateTime (const RWDate &d, unsigned h=0, unsigned m=0, unsigned s=0, unsigned ms=0, const RWZone &zone=RWZone::local())
 
 RWCollectableDateTime (const RWDateTime &dt)
 
 RWCollectableDateTime (const RWTime &t, unsigned ms=0)
 
 RWCollectableDateTime (const struct tm *t, unsigned ms=0, const RWZone &zone=RWZone::local())
 
 RWCollectableDateTime (InitialState init_state)
 
 RWCollectableDateTime (rwint64 msec)
 
 RWCollectableDateTime (std::istream &s, SetType set_type, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local())
 
 RWCollectableDateTime (unsigned d, const char *mo, unsigned y, unsigned h, unsigned m, unsigned s, unsigned ms, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local())
 
 RWCollectableDateTime (unsigned d, unsigned mo, unsigned y, unsigned h=0, unsigned m=0, unsigned s=0, unsigned ms=0, const RWZone &zone=RWZone::local())
 
 ~RWCollectableDateTime ()
 
virtual RWspace binaryStoreSize () const
 
virtual int compareTo (const RWCollectable *c) const
 
virtual RWCollectablecopy () const
 
virtual unsigned hash () const
 
virtual RWClassID isA () const
 
virtual bool isEqual (const RWCollectable *c) const
 
virtual RWCollectablenewSpecies () const
 
virtual void restoreGuts (RWFile &file)
 
virtual void restoreGuts (RWvistream &stream)
 
virtual void saveGuts (RWFile &file) const
 
virtual void saveGuts (RWvostream &stream) const
 
- Public Member Functions inherited from RWCollectable
virtual ~RWCollectable ()
 
RWspace recursiveStoreSize () const
 
RWStringID stringID () const
 
- Public Member Functions inherited from RWDateTime
 RWDateTime (const RWCString &str, Format f, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local())
 
 RWDateTime (const RWCString &str, SetType set_type=setBoth, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local())
 
 RWDateTime (const RWDate &d, unsigned hours=0, unsigned minutes=0, unsigned seconds=0, unsigned msec=0, const RWZone &zone=RWZone::local())
 
 RWDateTime (const RWDateTime &dt)
 
 RWDateTime (const RWTime &t, unsigned msec=0)
 
 RWDateTime (const RWTimeTuple &tt, const RWZone &zone=RWZone::local())
 
 RWDateTime (const RWTimeTupleOffset &tt)
 
 RWDateTime (const struct tm *tmbuf, unsigned msec=0, const RWZone &loc=RWZone::local())
 
 RWDateTime (InitialState init_state=invalid)
 
 RWDateTime (rwint64 msec)
 
 RWDateTime (std::istream &s, SetType set_type, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local())
 
 RWDateTime (unsigned day, unsigned month, unsigned year, unsigned hours=0, unsigned minutes=0, unsigned seconds=0, unsigned milliseconds=0, const RWZone &zone=RWZone::local())
 
 RWDateTime (unsigned month_day, const char *month, unsigned year, unsigned hours, unsigned minutes, unsigned seconds, unsigned msec, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local())
 
RWCString asString (char format, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local()) const
 
RWCString asString (const char *format, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local()) const
 
RWCString asString (Format format, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local()) const
 
bool between (const RWDateTime &a, const RWDateTime &b) const
 
RWspace binaryStoreSize () const
 
int compareTo (const RWDateTime &d) const
 
int compareTo (const RWDateTime *d) const
 
unsigned correctedJulian () const
 
unsigned day (const RWZone &zone=RWZone::local()) const
 
unsigned dayGMT () const
 
unsigned dayOfMonth (const RWZone &zone=RWZone::local()) const
 
unsigned dayOfMonthGMT () const
 
RWDateTimedecrementDay (const rwint64 d)
 
RWDateTimedecrementHour (const rwint64 h)
 
RWDateTimedecrementMillisecond (const rwint64 msec)
 
RWDateTimedecrementMinute (const rwint64 m)
 
RWDateTimedecrementSecond (const rwint64 s)
 
void extract (struct tm *tmbuf, const RWZone &zone=RWZone::local()) const
 
void extractGMT (struct tm *tmbuf) const
 
unsigned firstDayOfMonth (const RWZone &zone=RWZone::local()) const
 
unsigned firstDayOfMonth (unsigned mon, const RWZone &zone=RWZone::local()) const
 
unsigned hash () const
 
unsigned hour (const RWZone &zone=RWZone::local()) const
 
unsigned hourGMT () const
 
RWDateTimeincrementDay (const rwint64 d)
 
RWDateTimeincrementHour (const rwint64 h)
 
RWDateTimeincrementMillisecond (const rwint64 msec)
 
RWDateTimeincrementMinute (const rwint64 m)
 
RWDateTimeincrementSecond (const rwint64 s)
 
bool isDST (const RWZone &zone=RWZone::local()) const
 
bool isFuture () const
 
bool isInvalid () const
 
bool isNull () const
 
bool isPast () const
 
bool isSentinel () const
 
bool isValid () const
 
unsigned julian () const
 
void julian (unsigned j)
 
double julianDay () const
 
void julianDay (double j)
 
bool leap (const RWZone &zone=RWZone::local()) const
 
bool leapGMT () const
 
RWDateTime max (const RWDateTime &t) const
 
unsigned milliSecond () const
 
rwint64 milliSeconds () const
 
RWDateTime min (const RWDateTime &t) const
 
unsigned minute (const RWZone &zone=RWZone::local()) const
 
unsigned minuteGMT () const
 
unsigned month (const RWZone &zone=RWZone::local()) const
 
unsigned monthGMT () const
 
RWCString monthName (const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local()) const
 
RWDateTime next (const char *dayName, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local()) const
 
RWDateTime next (unsigned dayNum, const RWZone &zone=RWZone::local()) const
 
RWDateTimeoperator= (const RWDateTime &)
 
RWDateTime previous (const char *dayName, const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local()) const
 
RWDateTime previous (unsigned dayNum, const RWZone &zone=RWZone::local()) const
 
std::istream & readDate (std::istream &is)
 
std::istream & readTime (std::istream &is)
 
void restoreFrom (RWFile &)
 
void restoreFrom (RWvistream &)
 
void saveOn (RWFile &) const
 
void saveOn (RWvostream &) const
 
unsigned second (const RWZone &zone=RWZone::local()) const
 
unsigned secondGMT () const
 
RWDate toRWDate (const RWZone &zone=RWZone::local()) const
 
RWTime toRWTime () const
 
unsigned weekDay (const RWZone &zone=RWZone::local()) const
 
unsigned weekDayGMT () const
 
RWCString weekDayName (const RWLocale &loc=RWLocale::global(), const RWZone &zone=RWZone::local()) const
 
std::ostream & writeDate (std::ostream &os) const
 
std::ostream & writeTime (std::ostream &os) const
 
unsigned year (const RWZone &zone=RWZone::local()) const
 
unsigned yearGMT () const
 

Static Public Member Functions

static RWClassID classIsA ()
 
- Static Public Member Functions inherited from RWCollectable
static RWClassID classID (const RWStringID &name)
 
static RWClassID classIsA ()
 
static bool isAtom (RWClassID id)
 
static RWspace nilStoreSize ()
 
- Static Public Member Functions inherited from RWDateTime
static RWDateTime beginDST (unsigned year, const RWZone &zone=RWZone::local())
 
static unsigned dayOfWeek (const char *day, const RWLocale &loc=RWLocale::global())
 
static unsigned daysInMonthYear (unsigned month, unsigned year)
 
static unsigned daysInYear (unsigned year)
 
static bool dayWithinMonth (unsigned month, unsigned day, unsigned year)
 
static RWDateTime endDST (unsigned year, const RWZone &zone=RWZone::local())
 
static unsigned hash (const RWDateTime &dt)
 
static unsigned indexOfMonth (const char *monthName, const RWLocale &loc=RWLocale::global())
 
static bool leapYear (unsigned year)
 
static RWCString nameOfMonth (unsigned monthNum, const RWLocale &loc=RWLocale::global())
 
static RWDateTime now ()
 
static RWDateTime userSentinel (int n)
 
static RWCString weekDayName (unsigned dayNum, const RWLocale &loc=RWLocale::global())
 

Additional Inherited Members

- Public Types inherited from RWDateTime
enum  Format { iso8601_compat , iso8601_2000 , iso8601_midnight24 , iso8601 }
 
enum  InitialState { invalid , null , setCurrentTime }
 
enum  SetType { setDate , setTime , setBoth }
 
- Static Public Attributes inherited from RWDateTime
static const rwint64 futureSentinel
 
static const rwint64 invalidSentinel
 
static const rwint64 maxDateTime
 
static const rwint64 millisecsInDay
 
static const rwint64 millisecsInHour
 
static const rwint64 millisecsInMin
 
static const rwint64 millisecsInSec
 
static const rwint64 minDateTime
 
static const rwint64 nullSentinel
 
static const rwint64 pastSentinel
 
static const rwint64 userSentinelStart
 

Detailed Description

Collectable RWDateTime instances. Inherits from classes RWDateTime and RWCollectable. This class is useful when date/time objects are used as keys in the "dictionary" collection classes, or if date/time objects are stored and retrieved as RWCollectable instances.

Redefines the virtual functions of the base class RWCollectable.

Synopsis
#include <rw/tools/ctdatetime.h>
Provides a polymorphically persistable RWDateTime.
Definition ctdatetime.h:56
Persistence
Polymorphic

Constructor & Destructor Documentation

◆ RWCollectableDateTime() [1/11]

RWCollectableDateTime::RWCollectableDateTime ( )
inline

Calls the corresponding constructor of the base class RWDateTime.

◆ RWCollectableDateTime() [2/11]

RWCollectableDateTime::RWCollectableDateTime ( InitialState init_state)
inline

Calls the corresponding constructor of the base class RWDateTime.

◆ RWCollectableDateTime() [3/11]

RWCollectableDateTime::RWCollectableDateTime ( const RWDateTime & dt)
inline

Calls the corresponding constructor of the base class RWDateTime.

◆ RWCollectableDateTime() [4/11]

RWCollectableDateTime::RWCollectableDateTime ( rwint64 msec)
inlineexplicit

Calls the corresponding constructor of the base class RWDateTime.

◆ RWCollectableDateTime() [5/11]

RWCollectableDateTime::RWCollectableDateTime ( const struct tm * t,
unsigned ms = 0,
const RWZone & zone = RWZone::local() )
inline

Calls the corresponding constructor of the base class RWDateTime.

◆ RWCollectableDateTime() [6/11]

RWCollectableDateTime::RWCollectableDateTime ( const RWTime & t,
unsigned ms = 0 )
inline
Deprecated
As of SourcePro 10, provided for compatibility with code that relies on the deprecated RWTime type.

◆ RWCollectableDateTime() [7/11]

RWCollectableDateTime::RWCollectableDateTime ( const RWDate & d,
unsigned h = 0,
unsigned m = 0,
unsigned s = 0,
unsigned ms = 0,
const RWZone & zone = RWZone::local() )
inline

Calls the corresponding constructor of the base class RWDateTime.

◆ RWCollectableDateTime() [8/11]

RWCollectableDateTime::RWCollectableDateTime ( unsigned d,
const char * mo,
unsigned y,
unsigned h,
unsigned m,
unsigned s,
unsigned ms,
const RWLocale & loc = RWLocale::global(),
const RWZone & zone = RWZone::local() )
inline

Calls the corresponding constructor of the base class RWDateTime.

◆ RWCollectableDateTime() [9/11]

RWCollectableDateTime::RWCollectableDateTime ( unsigned d,
unsigned mo,
unsigned y,
unsigned h = 0,
unsigned m = 0,
unsigned s = 0,
unsigned ms = 0,
const RWZone & zone = RWZone::local() )
inline

Calls the corresponding constructor of the base class RWDateTime.

◆ RWCollectableDateTime() [10/11]

RWCollectableDateTime::RWCollectableDateTime ( const RWCString & str,
SetType set_type = setBoth,
const RWLocale & loc = RWLocale::global(),
const RWZone & zone = RWZone::local() )
inlineexplicit

Calls the corresponding constructor of the base class RWDateTime.

◆ RWCollectableDateTime() [11/11]

RWCollectableDateTime::RWCollectableDateTime ( std::istream & s,
SetType set_type,
const RWLocale & loc = RWLocale::global(),
const RWZone & zone = RWZone::local() )
inline

Calls the corresponding constructor of the base class RWDateTime.

◆ ~RWCollectableDateTime()

RWCollectableDateTime::~RWCollectableDateTime ( )
inline

Empty destructor.

Member Function Documentation

◆ binaryStoreSize()

virtual RWspace RWCollectableDateTime::binaryStoreSize ( ) const
inlinevirtual

Returns the number of bytes used by the virtual function saveGuts(RWFile&) to store an object. Typically, this involves adding up the space required to store all primitives, plus the results of calling recursiveStoreSize() for all objects inheriting from RWCollectable. See the Essential Tools Module User's Guide for details.

Reimplemented from RWCollectable.

◆ classIsA()

static RWClassID RWCollectableDateTime::classIsA ( )
static

Returns the RWClassID of this class.

◆ compareTo()

virtual int RWCollectableDateTime::compareTo ( const RWCollectable * c) const
virtual

Returns the results of calling RWDateTime::compareTo(), otherwise returns a nonzero value.

Reimplemented from RWCollectable.

◆ copy()

virtual RWCollectable * RWCollectableDateTime::copy ( ) const
virtual

Returns a new, copy-constructed object of the same type as self. The caller is responsible for deleting the object.

Reimplemented from RWCollectable.

◆ hash()

virtual unsigned RWCollectableDateTime::hash ( ) const
inlinevirtual

Returns the results of calling RWDateTime::hash().

Reimplemented from RWCollectable.

◆ isA()

virtual RWClassID RWCollectableDateTime::isA ( ) const
virtual

Returns the unique ID for RWCollectableDateTime.

Reimplemented from RWCollectable.

◆ isEqual()

virtual bool RWCollectableDateTime::isEqual ( const RWCollectable * t) const
inlinevirtual

Behaves as if compareTo(t) was invoked, returning true if the result equals 0, false otherwise.

Reimplemented from RWCollectable.

◆ newSpecies()

virtual RWCollectable * RWCollectableDateTime::newSpecies ( ) const
virtual

Returns a new, default-constructed object of the same type as self. The caller is responsible for deleting the object.

Reimplemented from RWCollectable.

◆ restoreGuts() [1/2]

virtual void RWCollectableDateTime::restoreGuts ( RWFile & )
inlinevirtual

Reads an object's state from a binary file, using class RWFile, replacing the previous state.

Reimplemented from RWCollectable.

◆ restoreGuts() [2/2]

virtual void RWCollectableDateTime::restoreGuts ( RWvistream & )
inlinevirtual

Reads an object's state from an input stream, replacing the previous state.

Reimplemented from RWCollectable.

◆ saveGuts() [1/2]

virtual void RWCollectableDateTime::saveGuts ( RWFile & ) const
inlinevirtual

Writes an object's state to a binary file, using class RWFile.

Reimplemented from RWCollectable.

◆ saveGuts() [2/2]

virtual void RWCollectableDateTime::saveGuts ( RWvostream & ) const
inlinevirtual

Writes an object's state to an output stream.

Reimplemented from RWCollectable.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.