OOFILE  1.9
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
dbField Class Referenceabstract

Base class for persistent fields in dbTable's. More...

#include <oof3.h>

Inheritance diagram for dbField:
Inheritance graph
[legend]
Collaboration diagram for dbField:
Collaboration graph
[legend]

Public Types

enum  { kKeyLengthAutoCalculated = USHRT_MAX }
 
enum  FieldIsStandaloneT { eFieldIsStandalone }
 

Public Member Functions

virtual const char * asChars () const
 
bool caseSensitive () const
 
virtual void clear ()
 
virtual dbFieldclone () const =0
 
virtual oofString copyString () const
 
virtual void copyValueFrom (const dbField *)
 
virtual void copyValueIfDifferent (const dbField *)
 
 dbField (const OOF_IndexOptions)
 
 dbField (const char *fieldName=0)
 
 dbField (const char *fieldName, const OOF_IndexOptions)
 
 dbField (const dbField &)
 
 dbField (FieldIsStandaloneT)
 
virtual void describe (std::ostream &) const
 Provide human-readable information about object. More...
 
dbFieldequivalentFieldFromTable (dbTable *) const
 
virtual void extract (std::ostream &) const
 
unsigned long fieldDataLen () const
 
bool fieldIndexIgnoresNulls () const
 
bool fieldIndexIsCompressLeading () const
 
bool fieldIndexIsCompressPadding () const
 
OOF_IndexOptions fieldIndexOptions () const
 
virtual bool fieldIsBinary () const
 
virtual bool fieldIsBlob () const
 
virtual bool fieldIsIndexed () const
 
bool fieldIsJoinKey () const
 Checks if any relationships in field's table use field as join key. More...
 
virtual bool fieldIsKeywordIndexed () const
 
bool fieldIsPartiallyIndexed () const
 
virtual bool fieldIsSameTypeAs (const dbField *) const
 
bool fieldIsStandalone () const
 
virtual bool fieldIsUniqueIndexed () const
 
virtual bool fieldIsVirtual () const
 
unsigned short fieldKeyLen () const
 
virtual unsigned long fieldMinWrapWidth () const
 
virtual const oofStringfieldName () const
 
fieldNumT fieldNumber () const
 
unsigned short fieldNumIndexes () const
 
virtual unsigned long fieldStorageLen () const =0
 
dbTablefieldTable () const
 
virtual OOF_fieldTypes fieldType () const =0
 
virtual unsigned long fieldUsualWrapWidth () const
 
virtual void generateTestData (bool, unsigned long)
 
virtual void getChars (char *ioBuff, unsigned long &outLen) const
 
bool hasDefaultCalculator () const
 
bool hidden () const
 
void hide (bool hideIt=true)
 
void index (const OOF_IndexOptions=kIndexed)
 
void indexPartialKeyLen (unsigned short)
 
virtual bool insert (std::istream &, char fieldSep, char recSep)
 
bool isDirty () const
 
virtual bool isEmpty () const
 
virtual oofString name () const
 
virtual OOF_fieldTypes nativeType () const
 
void operator= (const char *)
 
virtual void postCloneTableCleanup ()
 
void saveDefaultCalculatedValue ()
 
void saveStoredCalculatedValue ()
 
void setName (const char *name)
 
virtual void setNumber (long)
 
virtual void setString (const char *)
 
void storeCalculatedValues ()
 
bool storesCalculatedValues () const
 
const char * tableName () const
 
void useCalculatorOnlyForDefaults ()
 
bool usingCalculator () const
 
virtual bool validateContents ()
 
virtual dbQueryClausevalueAsQueryLiteral () const
 
bool valueIsDuplicate () const
 
virtual oofWordParserwords () const
 
virtual ~dbField ()
 

Protected Member Functions

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

Protected Attributes

OOF_tableBackendmBackend
 
dbCalculatormCalculator
 
fieldNumT mFieldNumber
 
bool mHidden
 
dbTablemTable
 

Friends

class dbTable
 

Detailed Description

Base class for persistent fields in dbTable's.

Subclasses prefixed by "oof", eg: oofDate are not persistent and allow you to use local variables that match the other OOFILE typing. eg: you may want a local variable included in a dbView fed to oofRep or linked to a form with dbEditHelper.

Definition at line 63 of file oof3.h.

Constructor & Destructor Documentation

dbField::dbField ( const OOF_IndexOptions  indexOptions)
dbField::dbField ( const char *  fieldName = 0)
dbField::dbField ( const char *  fieldName,
const OOF_IndexOptions  indexOptions 
)
dbField::dbField ( const dbField rhs)
dbField::dbField ( dbField::FieldIsStandaloneT  )

Definition at line 136 of file oof3.cpp.

dbField::~dbField ( )
virtual

Definition at line 149 of file oof3.cpp.

References mCalculator.

Member Function Documentation

const char * dbField::asChars ( ) const
virtual
void dbField::CalculateWith ( dbCalculator adoptedCalculator,
bool  useOnlyForDefaults 
)
protected
bool dbField::caseSensitive ( ) const
inline

Definition at line 747 of file oof3.h.

References kIndexCaseSensitive.

virtual void dbField::clear ( )
inlinevirtual
virtual dbField* dbField::clone ( ) const
pure virtual
void dbField::CopyCalculatedValueToBuffer ( )
protectedvirtual

Reimplemented in dbDateTime, dbTime, dbDate, dbReal, dbText, dbUlong, dbLong, dbBool, dbUshort, dbChar, and dbShort.

Definition at line 163 of file oof3.cpp.

Referenced by saveDefaultCalculatedValue(), and saveStoredCalculatedValue().

oofString dbField::copyString ( ) const
virtual

Reimplemented in dbText, and dbChar.

Definition at line 472 of file oof3.cpp.

References extract().

Referenced by dbFieldLink::copyFieldToLink(), dbFieldLink::copyLinkToField(), oofRepGraphBand_CSVRender::draw(), oofRepGraphBand_TSVRender::draw(), oofRepViewBand_HTMLRender::draw(), oofRepViewBand_CSVRender::draw(), oofRepViewBand_TSVRender::draw(), oofRepViewBand_WinRender::draw(), oofRepViewBand_MacRender::draw(), oofRepViewBand_RTFRender::draw(), dbRepHTML::drawColumnar(), dbRepHTMLTable::drawColumnar(), dbRepChar::drawColumnar(), dbRepHTML::drawPageWise(), dbRepHTMLTable::drawPageWise(), dbRepChar::drawPageWise(), dbRep::extract(), oofColumnGraph::finishConstruction(), oofPointGraph::finishConstruction(), oofLineGraph::finishConstruction(), oofBarGraph::finishConstruction(), oofStackedBarGraph::finishConstruction(), oofOrdinalStackedBarGraph::finishConstruction(), oofPieGraph::finishConstruction(), oofRepViewEditLink::getCellText(), oofRepFieldBlock::getCellText(), OOF_mixOutlineItem::GetDrawContentsFromView(), dbDate::getStr255(), dbDateTime::getStr255(), dbFieldLink::linkEqualsField(), oofRepFieldBlock::MiddleText(), oofRepCustomViewDrawer::plainText(), OOF_simpleRecordBackend::recordNumberMatching(), OOF_simpleRecordBackend::SearchEqualNonIndexedWildcard(), OOF_simpleRecordBackend::SearchNotEqualNonIndexedWildcard(), OOF_simpleRecordBackend::searchSelContainsAllOf(), OOF_simpleRecordBackend::searchSelContainsAnyOf(), dbGUIAdaptLPopupButton::setValueList(), OOF_simpleRecordBackend::SubSort(), dbFieldLink::validToLeaveForm(), and oofXMLDBWriter::writeRecord().

virtual void dbField::copyValueFrom ( const dbField )
inlinevirtual

Reimplemented in dbDateTime, dbTime, dbDate, dbReal, dbText, dbUlong, dbLong, dbBool, dbUshort, dbChar, and dbShort.

Definition at line 140 of file oof3.h.

Referenced by dbTable::copyRecFrom(), and dbFieldCopier::receiveMsg().

virtual void dbField::copyValueIfDifferent ( const dbField )
inlinevirtual
void dbField::describe ( std::ostream &  ) const
virtual

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 dbFixedBinary, dbChar, and dbRelRefBase.

Definition at line 544 of file oof3.cpp.

References fieldIndexOptions(), fieldIsIndexed(), fieldType(), and oofString::isEmpty().

Referenced by dbChar::describe(), dbFixedBinary::describe(), and dbTable::setSortOrder().

dbField * dbField::equivalentFieldFromTable ( dbTable baseTable) const
void dbField::extract ( std::ostream &  ) const
virtual
unsigned long dbField::fieldDataLen ( ) const
inline
bool dbField::fieldIndexIgnoresNulls ( ) const
inline

Definition at line 699 of file oof3.h.

References kIndexNoNulls.

Referenced by OOF_ctreeBackend::countAll().

bool dbField::fieldIndexIsCompressLeading ( ) const
inline

Definition at line 707 of file oof3.h.

References kIndexCompressLeading.

bool dbField::fieldIndexIsCompressPadding ( ) const
inline

Definition at line 715 of file oof3.h.

References kIndexCompressPadding.

OOF_IndexOptions dbField::fieldIndexOptions ( ) const
inline

Definition at line 678 of file oof3.h.

Referenced by describe().

bool dbField::fieldIsBinary ( ) const
virtual

Reimplemented in dbText, and dbChar.

Definition at line 393 of file oof3.cpp.

bool dbField::fieldIsBlob ( ) const
virtual
bool dbField::fieldIsIndexed ( ) const
virtual
bool dbField::fieldIsJoinKey ( ) const

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

Definition at line 327 of file oof3.cpp.

References dbTable::field(), fieldIsStandalone(), fieldType(), dbRelRefBase::joinField(), mFieldNumber, mTable, dbTable::numFields(), and relationshipField.

Referenced by OOF_repEditSetupVisitor::VisitIterableBandBody().

bool dbField::fieldIsKeywordIndexed ( ) const
virtual

Reimplemented in dbText, and dbChar.

Definition at line 415 of file oof3.cpp.

Referenced by OOF_ctreeBackend::BuildBackendtables().

bool dbField::fieldIsPartiallyIndexed ( ) const
inline

Definition at line 692 of file oof3.h.

References kKeyLengthAutoCalculated.

Referenced by fieldKeyLen().

bool dbField::fieldIsSameTypeAs ( const dbField rhs) const
virtual
bool dbField::fieldIsStandalone ( ) const
inline
bool dbField::fieldIsUniqueIndexed ( ) const
virtual
bool dbField::fieldIsVirtual ( ) const
virtual
unsigned short dbField::fieldKeyLen ( ) const
unsigned long dbField::fieldMinWrapWidth ( ) const
virtual

Reimplemented in dbNumericField.

Definition at line 222 of file oof3.cpp.

References fieldStorageLen().

Referenced by oofViewFieldDefaultsColSizer::CalculateDefaultWidths(), and fieldUsualWrapWidth().

const oofString & dbField::fieldName ( ) const
inlinevirtual

Reimplemented in dbRelRefBase.

Definition at line 769 of file oof3.h.

Referenced by dbView::AppendOwnedField(), OOF_ramBackend::BuildBackendtables(), OOF_dbaseBackend::BuildBackendtables(), OOF_ctreeBackend::BuildBackendtables(), dbShort::copyValueFrom(), dbChar::copyValueFrom(), dbUshort::copyValueFrom(), dbBool::copyValueFrom(), dbLong::copyValueFrom(), dbUlong::copyValueFrom(), dbText::copyValueFrom(), dbReal::copyValueFrom(), dbDate::copyValueFrom(), dbTime::copyValueFrom(), dbDateTime::copyValueFrom(), dbShort::copyValueIfDifferent(), dbChar::copyValueIfDifferent(), dbUshort::copyValueIfDifferent(), dbBool::copyValueIfDifferent(), dbLong::copyValueIfDifferent(), dbUlong::copyValueIfDifferent(), dbText::copyValueIfDifferent(), dbReal::copyValueIfDifferent(), dbDate::copyValueIfDifferent(), dbTime::copyValueIfDifferent(), dbDateTime::copyValueIfDifferent(), OOF_dbaseBackend::createTableInConnection(), dbView::currentHeading(), dbRelRefBase::describe(), dbQueryField::describe(), dbRepHTML::drawHeader(), dbRepHTMLTable::drawHeader(), dbRepChar::drawHeader(), dbRepHTML::drawPageWise(), dbRepHTMLTable::drawPageWise(), dbRepChar::drawPageWise(), oofXMLdataParser::EnterNestedData(), dbRep::extract(), oofE_CtreeBlobError::extract(), dbRelRefBase::fieldName(), oofColumnGraph::finishConstruction(), oofPointGraph::finishConstruction(), oofLineGraph::finishConstruction(), oofXYGraph::finishConstruction(), oofBarGraph::finishConstruction(), oofStackedBarGraph::finishConstruction(), oofOrdinalStackedBarGraph::finishConstruction(), dbView::getHeading(), dbQueryField::getSearchTables(), dbChar::insert(), dbText::insert(), name(), OOF_simpleRecordBackend::sortSelectionInverseNow(), OOF_simpleRecordBackend::sortSelectionNow(), oofXMLdataParser::startElement(), oofXMLDBWriter::startSchema(), OOF_repXMLschemaVisitor::UniquifyTables(), dbFieldLink::validToLeaveForm(), and oofXMLDBWriter::writeRecord().

fieldNumT dbField::fieldNumber ( ) const
inline
unsigned short dbField::fieldNumIndexes ( ) const
inline

Definition at line 723 of file oof3.h.

References kNotIndexed.

Referenced by OOF_ctreeBackend::BuildBackendtables().

virtual unsigned long dbField::fieldStorageLen ( ) const
pure virtual
dbTable * dbField::fieldTable ( ) const
virtual OOF_fieldTypes dbField::fieldType ( ) const
pure virtual

Implemented in dbDateTime, dbTime, dbDate, dbCompoundField, dbFixedBinary, dbReal, dbUlong, dbText, dbLong, dbBLOB, dbBool, dbUshort, dbShort, dbChar, and dbRelRefBase.

Referenced by dbCompoundField::addSegment(), OOF_ctreeBackend::BuildBackendtables(), dbChar::copyValueFrom(), dbShort::copyValueFrom(), dbUshort::copyValueFrom(), dbBool::copyValueFrom(), dbLong::copyValueFrom(), dbUlong::copyValueFrom(), dbText::copyValueFrom(), dbReal::copyValueFrom(), dbDate::copyValueFrom(), dbTime::copyValueFrom(), dbDateTime::copyValueFrom(), dbShort::copyValueIfDifferent(), dbChar::copyValueIfDifferent(), dbUshort::copyValueIfDifferent(), dbBool::copyValueIfDifferent(), dbLong::copyValueIfDifferent(), dbUlong::copyValueIfDifferent(), dbText::copyValueIfDifferent(), dbReal::copyValueIfDifferent(), dbDate::copyValueIfDifferent(), dbTime::copyValueIfDifferent(), dbDateTime::copyValueIfDifferent(), OOF_dbaseBackend::createTableInConnection(), describe(), oofRepViewBand_HTMLRender::draw(), oofRepViewBand_WinRender::draw(), oofRepViewBand_MacRender::draw(), oofRepViewBand_RTFRender::draw(), oofRepViewBand_WinRender::drawColumnHeaders(), oofRepViewBand_MacRender::drawColumnHeaders(), oofRepViewBand_RTFRender::drawColumnHeaders(), oofRepViewBand_WinRender::DrawContinuingOverPage(), oofRepViewBand_MacRender::DrawContinuingOverPage(), equivalentFieldFromTable(), OOF_simpleRecordBackend::fieldDataLen(), fieldIsJoinKey(), fieldIsSameTypeAs(), oofXMLDBWriter::fieldtype2Attributes(), dbViewAsTableStorage::FindCellData(), OOF_mixOutlineItem::findOIDforData(), oofOrdinalStackedBarGraph::finishConstruction(), dbTable::generateTestData(), dbQueryBinary::isSimpleIndexedSearch(), dbAbstractEditHelper::linkAdapter(), OOF_simpleRecordBackend::loadRelatedContextJoiningFromTo(), dbTable::makeView(), nativeType(), OOF_simpleRecordBackend::PadFieldWidthForAlignment(), dbTable::postCloneRecordCleanup(), OOF_simpleRecordBackend::recordNumberMatching(), dbTable::relateAllDeletables(), dbGUIAdaptEditPane::setFieldLink(), OOF_simpleRecordBackend::sortSelectionInverseNow(), OOF_simpleRecordBackend::sortSelectionNow(), oofXMLdataParser::startElement(), OOF_simpleRecordBackend::SubSort(), and OOF_repXMLlayoutVisitor::WriteColumns().

unsigned long dbField::fieldUsualWrapWidth ( ) const
virtual

Reimplemented in dbText, and dbChar.

Definition at line 235 of file oof3.cpp.

References fieldMinWrapWidth().

Referenced by oofViewFieldDefaultsColSizer::CalculateDefaultWidths().

virtual void dbField::generateTestData ( bool  ,
unsigned long   
)
inlinevirtual

Reimplemented in dbDateTime, dbTime, dbDate, dbReal, dbFixedBinary, dbText, dbUlong, dbLong, dbBLOB, dbBool, dbUshort, dbChar, and dbShort.

Definition at line 147 of file oof3.h.

Referenced by dbTable::generateTestData().

void dbField::getChars ( char *  ioBuff,
unsigned long &  outLen 
) const
virtual

Reimplemented in dbText, and dbChar.

Definition at line 481 of file oof3.cpp.

References extract().

Referenced by dbViewAsTableStorage::GetCellData().

bool dbField::hasDefaultCalculator ( ) const
inline
bool OOF_PublicBase::hidden ( ) const
inlineinherited

Definition at line 51 of file oof1.h.

Referenced by OOF_Dictionary::EntryMatchesVisibility().

void OOF_PublicBase::hide ( bool  hideIt = true)
inlineinherited

Definition at line 52 of file oof1.h.

void dbField::index ( const OOF_IndexOptions  indexOpt = kIndexed)

Definition at line 212 of file oof3.cpp.

Referenced by dbRelRefBase::joinField(), and dbRelRefBase::SetCommonRelationshipFields().

void dbField::indexPartialKeyLen ( unsigned short  inLen)
inline

Definition at line 685 of file oof3.h.

bool dbField::insert ( std::istream &  ,
char  fieldSep,
char  recSep 
)
virtual

Reimplemented in dbDateTime, dbTime, dbDate, dbReal, dbText, dbUlong, dbLong, dbBool, dbUshort, dbChar, and dbShort.

Definition at line 513 of file oof3.cpp.

Referenced by dbChar::insert(), dbText::insert(), dbTable::insert(), and operator>>().

bool dbField::isDirty ( ) const
bool dbField::isEmpty ( ) const
virtual

Reimplemented in dbDateTime, dbDate, dbBLOB, and dbChar.

Definition at line 170 of file oof3.cpp.

Referenced by OOF_ctreeKeywordIndex::updateWords().

oofString dbField::name ( ) const
virtual

Reimplemented from OOF_PublicBase.

Definition at line 156 of file oof3.cpp.

References fieldName().

Referenced by setName().

OOF_fieldTypes dbField::nativeType ( ) const
virtual
void dbField::operator= ( const char *  str)
inline

Definition at line 671 of file oof3.h.

References setString().

Referenced by dbRelRef::operator=().

virtual void dbField::postCloneTableCleanup ( )
inlinevirtual

Reimplemented in dbRelRefBase.

Definition at line 77 of file oof3.h.

Referenced by dbTable::postCloneTableCleanup().

void dbField::saveDefaultCalculatedValue ( )
void dbField::saveStoredCalculatedValue ( )

Definition at line 282 of file oof3.cpp.

References CopyCalculatedValueToBuffer().

Referenced by OOF_simpleRecordBackend::saveRecord().

void dbField::setName ( const char *  name)

Definition at line 195 of file oof3.cpp.

References name().

Referenced by dbView::AppendOwnedField(), and OOF_repXMLschemaVisitor::UniquifyTables().

virtual void dbField::setNumber ( long  )
inlinevirtual

Reimplemented in dbDateTime, dbDate, dbReal, dbText, dbUlong, dbLong, dbBool, dbUshort, dbChar, and dbShort.

Definition at line 133 of file oof3.h.

Referenced by dbNumericField::clear().

virtual void dbField::setString ( const char *  )
inlinevirtual
void dbField::storeCalculatedValues ( )
inline

Definition at line 813 of file oof3.h.

Referenced by OOF_ctreeBackend::BuildBackendtables().

bool dbField::storesCalculatedValues ( ) const
inline

Definition at line 806 of file oof3.h.

Referenced by OOF_simpleRecordBackend::GetFieldWriteDest().

const char * dbField::tableName ( ) const
void dbField::useCalculatorOnlyForDefaults ( )
inline

Definition at line 799 of file oof3.h.

Referenced by CalculateWith().

bool dbField::usingCalculator ( ) const

Definition at line 258 of file oof3.cpp.

References isDirty(), dbTable::isNewRecord(), mCalculator, and mTable.

Referenced by dbChar::operator+=().

bool dbField::validateContents ( )
virtual

Definition at line 177 of file oof3.cpp.

dbQueryClause * dbField::valueAsQueryLiteral ( ) const
virtual
bool dbField::valueIsDuplicate ( ) const
oofWordParser * dbField::words ( ) const
virtual

Reimplemented in dbText, and dbChar.

Definition at line 251 of file oof3.cpp.

Referenced by OOF_simpleRecordBackend::SearchWordNonIndexed(), and OOF_ctreeKeywordIndex::updateWords().

Friends And Related Function Documentation

friend class dbTable
friend

Definition at line 167 of file oof3.h.

Member Data Documentation

OOF_tableBackend* dbField::mBackend
protected
dbCalculator* dbField::mCalculator
protected
fieldNumT dbField::mFieldNumber
protected
bool OOF_PublicBase::mHidden
protectedinherited

Definition at line 61 of file oof1.h.

dbTable* dbField::mTable
protected

The documentation for this class was generated from the following files: