Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

oofDate Class Reference
[Local variables compatible with database fields.]

#include <oof4.h>

Inheritance diagram for oofDate:

Inheritance graph
[legend]
Collaboration diagram for oofDate:

Collaboration graph
[legend]
List of all members.

Detailed Description

Use to have local non-persistent variable of type dbDate.

See also:
dbDate::currentDate


Public Types

enum  dateFieldOrder { orderYMD, orderDMY, orderMDY }
enum  { NUMDATETOKENS = 35 }
enum  FieldIsStandaloneT { eFieldIsStandalone }
enum  { kKeyLengthAutoCalculated = USHRT_MAX }

Public Member Functions

 oofDate ()
 oofDate (const char *initialDate)
 oofDate (const dbDate &)
 oofDate (const oofDate &)
 oofDate (const tm &)
virtual ~oofDate ()
virtual dbFieldclone () const
oofDateoperator= (const char *)
oofDateoperator= (const oofDate &)
oofDateoperator= (const dbDate &)
oofDateoperator= (const tm &)
dbDatecalculateWith (dbDateCalculator *adoptedCalculator, bool useOnlyForDefaults=false)
dbDateCalculatorcalculator () const
virtual dbDateoperator++ ()
virtual dbDateoperator-- ()
dbDateoperator+= (long)
void operator+= (double)
dbDateoperator-= (long)
void operator-= (double)
long operator- (const dbDate &) const
dbDate operator- (long) const
dbDate operator+ (long) const
dbQueryBinary operator== (const char *) const
dbQueryBinary operator== (const dbDate &) const
dbQueryBinary operator== (long) const
dbQueryBinary operator< (const char *) const
dbQueryBinary operator< (const dbDate &) const
dbQueryBinary operator< (long) const
dbQueryBinary operator<= (const char *) const
dbQueryBinary operator<= (const dbDate &) const
dbQueryBinary operator<= (long) const
dbQueryBinary operator>= (const char *) const
dbQueryBinary operator>= (const dbDate &) const
dbQueryBinary operator>= (long) const
dbQueryBinary operator> (const char *) const
dbQueryBinary operator> (const dbDate &) const
dbQueryBinary operator> (long) const
dbQueryBinary operator!= (const char *) const
dbQueryBinary operator!= (const dbDate &) const
dbQueryBinary operator!= (long) const
dbQueryTrinary between (const char *, const char *) const
dbQueryTrinary between (const dbDate &, const dbDate &) const
dbQueryTrinary between (long, long) const
dbQueryTrinary outside (const char *, const char *) const
dbQueryTrinary outside (const dbDate &, const dbDate &) const
dbQueryTrinary outside (long, long) const
virtual unsigned long fieldStorageLen () const
virtual OOF_fieldTypes fieldType () const
virtual OOF_fieldTypes nativeType () const
bool isEmpty () const
bool isValid () const
void getDate (unsigned short &year, unsigned short &month, unsigned short &day) const
unsigned long value () const
virtual dbQueryClausevalueAsQueryLiteral () const
unsigned short day () const
unsigned short month () const
unsigned short year () const
 operator unsigned long () const
void getStr255 (Str255 s) const
virtual void extract (std::ostream &os) const
unsigned long daynum () const
virtual void copyValueFrom (const dbField *)
virtual void copyValueIfDifferent (const dbField *)
virtual void setString (const char *)
virtual void setNumber (long)
void setStr255 (const Str255 s)
void setDate (unsigned long)
void setDate (unsigned short year, unsigned short month, unsigned short day)
void setDate (const tm &)
virtual bool insert (std::istream &, char fieldSep, char recSep)
void setDateToCurrentDate ()
void setDaynum (unsigned long)
virtual void generateTestData (bool generateRandom, unsigned long seedOrCount)
virtual unsigned long fieldMinWrapWidth () const
const oofStringformatMask () const
void formatMask (const char *)
virtual void clear ()
dbQueryBinary equal (long) const
dbQueryBinary lessThan (long) const
dbQueryBinary lessThanOrEqual (long) const
dbQueryBinary greaterThanOrEqual (long) const
dbQueryBinary greaterThan (long) const
dbQueryBinary notEqual (long) const
void operator *= (long)
void operator *= (double)
void operator/= (long)
void operator/= (double)
virtual dbQueryLiteralmakeQueryLiteral (long) const
virtual void postCloneTableCleanup ()
virtual oofString name () const
void index (const OOF_IndexOptions=kIndexed)
void indexPartialKeyLen (unsigned short)
void setName (const char *name)
bool hasDefaultCalculator () const
void useCalculatorOnlyForDefaults ()
bool storesCalculatedValues () const
void storeCalculatedValues ()
bool usingCalculator () const
const char * tableName () const
bool fieldIsStandalone () const
virtual bool fieldIsSameTypeAs (const dbField *) const
virtual void describe (std::ostream &) const
 Provide human-readable information about object.

virtual unsigned long fieldUsualWrapWidth () const
dbTablefieldTable () const
unsigned long fieldDataLen () const
bool isDirty () const
fieldNumT fieldNumber () const
virtual const oofStringfieldName () const
OOF_IndexOptions fieldIndexOptions () const
bool fieldIndexIgnoresNulls () const
bool fieldIndexIsCompressLeading () const
bool fieldIndexIsCompressPadding () const
virtual bool fieldIsIndexed () const
bool fieldIsPartiallyIndexed () const
virtual bool fieldIsKeywordIndexed () const
virtual bool fieldIsUniqueIndexed () const
unsigned short fieldNumIndexes () const
unsigned short fieldKeyLen () const
bool caseSensitive () const
virtual bool fieldIsBlob () const
virtual bool fieldIsBinary () const
virtual bool fieldIsVirtual () const
dbFieldequivalentFieldFromTable (dbTable *) const
bool valueIsDuplicate () const
bool fieldIsJoinKey () const
 Checks if any relationships in field's table use field as join key.

virtual oofString copyString () const
virtual void getChars (char *ioBuff, unsigned long &outLen) const
virtual const char * asChars () const
virtual bool validateContents ()
virtual oofWordParserwords () const
void saveDefaultCalculatedValue ()
void saveStoredCalculatedValue ()
bool hidden () const
void hide (bool hideIt=true)

Static Public Member Functions

void long2ymd (unsigned long binaryDate, unsigned short &, unsigned short &, unsigned short &)
bool istream2ymd (std::istream &is, unsigned short &, unsigned short &, unsigned short &, dateFieldOrder theOrder=dbDate::sDefaultDateOrder)
bool istream2ymd (std::istream &is, unsigned short &, unsigned short &, unsigned short &, char fieldSep, char recordSep, dateFieldOrder theOrder=dbDate::sDefaultDateOrder)
bool str2ymd (const char *, unsigned short &, unsigned short &, unsigned short &, dateFieldOrder theOrder=dbDate::sDefaultDateOrder)
void daynum2ymd (unsigned long, unsigned short &, unsigned short &, unsigned short &)
unsigned long str2Long (const char *, dateFieldOrder theOrder=dbDate::sDefaultDateOrder)
unsigned long ymd2Long (unsigned short, unsigned short, unsigned short)
unsigned long ymd2daynum (unsigned short, unsigned short, unsigned short)
std::ostream & ymd2Stream (unsigned short, unsigned short, unsigned short, std::ostream &os)
std::ostream & ymd2Stream (const char *mask, unsigned short year, unsigned short month, unsigned short day, std::ostream &os)
void ddth (unsigned short daynum, char *ddth, bool isupper=false)
unsigned short ymd2dow (unsigned short, unsigned short, unsigned short)
void ymd2dayname (unsigned short, unsigned short, unsigned short, char *dayname, bool isshort=true, bool isupper=false)
void month2str (unsigned short monthnum, char *monthname, bool isshort=true, bool isupper=false)
unsigned short istream2month (std::istream &)
unsigned short str2month (const char *)
bool checkDate (unsigned short year, unsigned short month, unsigned short day)
bool checkDate (const char *, dateFieldOrder theOrder=dbDate::sDefaultDateOrder)
bool isLeapYear (unsigned short year)
dbDate currentDate ()
void currentDate2ymd (unsigned short &, unsigned short &, unsigned short &)
std::ostream & today (std::ostream &os)
unsigned short currentCentury ()
unsigned short currentDay ()
unsigned short currentMonth ()
unsigned short currentYear ()
unsigned short nextCenturyThreshold ()
void nextCenturyThreshold (unsigned short)
unsigned short prevCenturyThreshold ()
void prevCenturyThreshold (unsigned short)
unsigned short adjustShortYear (unsigned short inYear)
const oofStringdefaultFormatMask ()
void defaultFormatMask (const oofString &)
TOKEN get_token (const char **s, const OOF_TOKENTYPE *m, unsigned int len)
void parseMask (const char *s, TOKEN *r, const OOF_TOKENTYPE *map, unsigned int len)

Public Attributes

OOF_String mFormatMask

Static Public Attributes

dateFieldOrder sDefaultDateOrder = orderDMY

Protected Member Functions

virtual void CopyCalculatedValueToBuffer ()
void CalculateWith (dbCalculator *adoptedCalculator, bool useOnlyForDefaults)

Static Protected Member Functions

void CheckRange (double d, long minL, long maxL, const char *file, int line)
void CheckRange (long l, long minL, long maxL, const char *file, int line)
void CheckRange (unsigned long l, unsigned long max, const char *file, int line)

Protected Attributes

OOF_tableBackendmBackend
dbTablemTable
fieldNumT mFieldNumber
dbCalculatormCalculator
bool mHidden

Static Protected Attributes

OOF_TOKENTYPE tokenMap [NUMDATETOKENS]
unsigned short sNextCenturyThreshold = 1970
unsigned short sPrevCenturyThreshold = 2070
oofString sDefaultFormatMask


Member Enumeration Documentation

anonymous enum [inherited]
 

Enumeration values:
kKeyLengthAutoCalculated 

anonymous enum [inherited]
 

Enumeration values:
NUMDATETOKENS 

enum dbDate::dateFieldOrder [inherited]
 

Enumeration values:
orderYMD 
orderDMY 
orderMDY 

enum dbField::FieldIsStandaloneT [inherited]
 

Enumeration values:
eFieldIsStandalone 


Constructor & Destructor Documentation

oofDate::oofDate  ) 
 

oofDate::oofDate const char *  initialDate  ) 
 

oofDate::oofDate const dbDate  ) 
 

oofDate::oofDate const oofDate  ) 
 

oofDate::oofDate const tm &   ) 
 

virtual oofDate::~oofDate  )  [inline, virtual]
 


Member Function Documentation

unsigned short dbDate::adjustShortYear unsigned short  inYear  )  [static, inherited]
 

const char * dbField::asChars  )  const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

dbQueryTrinary dbNumericField::between long  ,
long 
const [inherited]
 

dbQueryTrinary dbDate::between const dbDate ,
const dbDate
const [inherited]
 

dbQueryTrinary dbDate::between const char *  ,
const char * 
const [inherited]
 

void dbField::CalculateWith dbCalculator adoptedCalculator,
bool  useOnlyForDefaults
[protected, inherited]
 

dbDate & dbDate::calculateWith dbDateCalculator adoptedCalculator,
bool  useOnlyForDefaults = false
[inherited]
 

dbDateCalculator * dbDate::calculator  )  const [inline, inherited]
 

bool dbField::caseSensitive  )  const [inline, inherited]
 

bool dbDate::checkDate const char *  ,
dateFieldOrder  theOrder = dbDate::sDefaultDateOrder
[static, inherited]
 

bool dbDate::checkDate unsigned short  year,
unsigned short  month,
unsigned short  day
[static, inherited]
 

void dbNumericField::CheckRange unsigned long  l,
unsigned long  max,
const char *  file,
int  line
[static, protected, inherited]
 

void dbNumericField::CheckRange long  l,
long  minL,
long  maxL,
const char *  file,
int  line
[static, protected, inherited]
 

void dbNumericField::CheckRange double  d,
long  minL,
long  maxL,
const char *  file,
int  line
[static, protected, inherited]
 

void dbNumericField::clear  )  [virtual, inherited]
 

Reimplemented from dbField.

dbField * oofDate::clone  )  const [virtual]
 

Reimplemented from dbDate.

void dbDate::CopyCalculatedValueToBuffer  )  [protected, virtual, inherited]
 

Reimplemented from dbField.

oofString dbField::copyString  )  const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

void dbDate::copyValueFrom const dbField  )  [virtual, inherited]
 

Reimplemented from dbField.

void dbDate::copyValueIfDifferent const dbField  )  [virtual, inherited]
 

Reimplemented from dbField.

unsigned short dbDate::currentCentury  )  [static, inherited]
 

dbDate dbDate::currentDate  )  [static, inherited]
 

void dbDate::currentDate2ymd unsigned short &  ,
unsigned short &  ,
unsigned short & 
[static, inherited]
 

unsigned short dbDate::currentDay  )  [static, inherited]
 

unsigned short dbDate::currentMonth  )  [static, inherited]
 

unsigned short dbDate::currentYear  )  [static, inherited]
 

unsigned short dbDate::day  )  const [inherited]
 

unsigned long dbDate::daynum  )  const [inherited]
 

void dbDate::daynum2ymd unsigned  long,
unsigned short &  ,
unsigned short &  ,
unsigned short & 
[static, inherited]
 

void dbDate::ddth unsigned short  daynum,
char *  ddth,
bool  isupper = false
[static, inherited]
 

void dbDate::defaultFormatMask const oofString  )  [inline, static, inherited]
 

const oofString & dbDate::defaultFormatMask  )  [inline, static, inherited]
 

void dbField::describe std::ostream &  os  )  const [virtual, inherited]
 

Provide human-readable information about object.

Overriden to provide much more detail particularly for dbTable::describe() which provides full schema.

Reimplemented from OOF_PublicBase.

Reimplemented in dbChar, dbFixedBinary, and dbRelRefBase.

dbQueryBinary dbNumericField::equal long   )  const [inherited]
 

dbField * dbField::equivalentFieldFromTable dbTable  )  const [inherited]
 

void dbDate::extract std::ostream &  os  )  const [virtual, inherited]
 

Reimplemented from dbField.

unsigned long dbField::fieldDataLen  )  const [inline, inherited]
 

bool dbField::fieldIndexIgnoresNulls  )  const [inline, inherited]
 

bool dbField::fieldIndexIsCompressLeading  )  const [inline, inherited]
 

bool dbField::fieldIndexIsCompressPadding  )  const [inline, inherited]
 

OOF_IndexOptions dbField::fieldIndexOptions  )  const [inline, inherited]
 

bool dbField::fieldIsBinary  )  const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

bool dbField::fieldIsBlob  )  const [virtual, inherited]
 

Reimplemented in dbBLOB.

bool dbField::fieldIsIndexed  )  const [virtual, inherited]
 

bool dbField::fieldIsJoinKey  )  const [inherited]
 

Checks if any relationships in field's table use field as join key.

Relatively expensive because it's iterating over all fields but all the function calls below are inline queries so will compile down well in release mode.

WARNING Doesn't fan out - if any other tables use this field as a join key then they are doing really weird stuff and the application programmer must add their own checks.

This feature originally added to support OOF_repEditSetupVisitor::VisitViewBandBody

bool dbField::fieldIsKeywordIndexed  )  const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

bool dbField::fieldIsPartiallyIndexed  )  const [inline, inherited]
 

bool dbField::fieldIsSameTypeAs const dbField  )  const [virtual, inherited]
 

Reimplemented in dbChar, dbFixedBinary, dbCompoundField, and dbRelRefBase.

bool dbField::fieldIsStandalone  )  const [inline, inherited]
 

bool dbField::fieldIsUniqueIndexed  )  const [virtual, inherited]
 

bool dbField::fieldIsVirtual  )  const [virtual, inherited]
 

Reimplemented in dbCompoundField, and dbRelRefBase.

unsigned short dbField::fieldKeyLen  )  const [inherited]
 

unsigned long dbNumericField::fieldMinWrapWidth  )  const [virtual, inherited]
 

Reimplemented from dbField.

const oofString & dbField::fieldName  )  const [inline, virtual, inherited]
 

Reimplemented in dbRelRefBase.

fieldNumT dbField::fieldNumber  )  const [inline, inherited]
 

unsigned short dbField::fieldNumIndexes  )  const [inline, inherited]
 

unsigned long dbDate::fieldStorageLen  )  const [virtual, inherited]
 

Implements dbField.

dbTable * dbField::fieldTable  )  const [inherited]
 

OOF_fieldTypes dbDate::fieldType  )  const [virtual, inherited]
 

Implements dbField.

unsigned long dbField::fieldUsualWrapWidth  )  const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

void dbNumericField::formatMask const char *   )  [inline, inherited]
 

const oofString & dbNumericField::formatMask  )  const [inline, inherited]
 

void dbDate::generateTestData bool  generateRandom,
unsigned long  seedOrCount
[virtual, inherited]
 

Reimplemented from dbField.

TOKEN dbNumericField::get_token const char **  s,
const OOF_TOKENTYPE m,
unsigned int  len
[static, inherited]
 

void dbField::getChars char *  ioBuff,
unsigned long &  outLen
const [virtual, inherited]
 

Reimplemented in dbChar, and dbText.

void dbDate::getDate unsigned short &  year,
unsigned short &  month,
unsigned short &  day
const [inherited]
 

void dbDate::getStr255 Str255  s  )  const [inherited]
 

dbQueryBinary dbNumericField::greaterThan long   )  const [inherited]
 

dbQueryBinary dbNumericField::greaterThanOrEqual long   )  const [inherited]
 

bool dbField::hasDefaultCalculator  )  const [inline, inherited]
 

bool OOF_PublicBase::hidden  )  const [inline, inherited]
 

void OOF_PublicBase::hide bool  hideIt = true  )  [inline, inherited]
 

void dbField::index const  OOF_IndexOptions = kIndexed  )  [inherited]
 

void dbField::indexPartialKeyLen unsigned  short  )  [inline, inherited]
 

bool dbDate::insert std::istream &  ,