OOFILE  1.9
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
dbBLOB Class Reference

Persistent field used to store an arbitrary binary object. More...

#include <oof3.h>

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

Public Types

enum  { kKeyLengthAutoCalculated = USHRT_MAX }
 
enum  FieldIsStandaloneT { eFieldIsStandalone }
 

Public Member Functions

void adoptBody (void *body, unsigned long bodyLen) const
 
void adoptBody (void *body, unsigned long bodyLen, unsigned long usedLen) const
 
char * allocRoomFor (unsigned long) const
 
void append (const dbBLOB &)
 
virtual void append (const void *appendBody, unsigned long bodyLen, unsigned long usedLen=ULONG_MAX)
 
virtual const char * asChars () const
 
char * bodyAddress () const
 
bool caseSensitive () const
 
virtual void clear ()
 
virtual dbFieldclone () const
 
virtual oofString copyString () const
 
virtual void copyValueFrom (const dbField *)
 
virtual void copyValueIfDifferent (const dbField *)
 
 dbBLOB (const OOF_IndexOptions indexOptions)
 
 dbBLOB (const char *fieldName=0)
 
 dbBLOB (const char *fieldName, const OOF_IndexOptions indexOptions)
 
 dbBLOB (dbField::FieldIsStandaloneT k)
 
 dbBLOB (const dbBLOB &)
 
virtual void describe (std::ostream &) const
 Provide human-readable information about object. More...
 
dbFieldequivalentFieldFromTable (dbTable *) const
 
virtual void extract (std::ostream &os) 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
 
dbTablefieldTable () const
 
virtual OOF_fieldTypes fieldType () const
 
virtual unsigned long fieldUsualWrapWidth () const
 
virtual void generateTestData (bool generateRandom, unsigned long seedOrCount)
 
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 unsigned long length () const
 
bool loaded () const
 
void markDirty () const
 
virtual oofString name () const
 
virtual OOF_fieldTypes nativeType () const
 
void operator+= (const dbBLOB &)
 
dbBLOBoperator= (const dbBLOB &)
 
char * orphanBody () const
 
virtual void postCloneTableCleanup ()
 
void reset () const
 
void saveDefaultCalculatedValue ()
 
void saveStoredCalculatedValue ()
 
void setBytes (const void *buf, unsigned long bufLen)
 Copy the incoming buffer into our local buffer in mStorage. More...
 
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 ~dbBLOB ()
 

Protected Member Functions

void CalculateWith (dbCalculator *adoptedCalculator, bool useOnlyForDefaults)
 
virtual void CopyCalculatedValueToBuffer ()
 
void LoadField () const
 
void SetLength (unsigned long len) const
 

Protected Attributes

OOF_tableBackendmBackend
 
dbCalculatormCalculator
 
fieldNumT mFieldNumber
 
bool mHidden
 
bool mIsTextField
 
dbBLOBstoragemStorage
 
dbTablemTable
 

Friends

void dbBLOBstorage::setBytes (const char *buf, unsigned long bufLen)
 
void dbBLOBstorage::setChars (const char *str, unsigned long charLen)
 

Detailed Description

Persistent field used to store an arbitrary binary object.

Definition at line 387 of file oof3.h.

Constructor & Destructor Documentation

dbBLOB::dbBLOB ( const OOF_IndexOptions  indexOptions)

Definition at line 2066 of file oof3.cpp.

References mStorage.

Referenced by clone().

dbBLOB::dbBLOB ( const char *  fieldName = 0)

Definition at line 2074 of file oof3.cpp.

References mStorage.

dbBLOB::dbBLOB ( const char *  fieldName,
const OOF_IndexOptions  indexOptions 
)

Definition at line 2082 of file oof3.cpp.

References mStorage.

dbBLOB::dbBLOB ( dbField::FieldIsStandaloneT  k)

Definition at line 2100 of file oof3.cpp.

References dbField::mBackend, and mStorage.

dbBLOB::dbBLOB ( const dbBLOB rhs)

Definition at line 2090 of file oof3.cpp.

References dbField::fieldIsStandalone(), dbField::mBackend, and mStorage.

dbBLOB::~dbBLOB ( )
virtual

Definition at line 2109 of file oof3.cpp.

References dbField::fieldIsStandalone(), dbField::mBackend, and mStorage.

Member Function Documentation

void dbBLOB::adoptBody ( void *  body,
unsigned long  bodyLen 
) const
void dbBLOB::adoptBody ( void *  body,
unsigned long  bodyLen,
unsigned long  usedLen 
) const

Definition at line 2182 of file oof3.cpp.

References mStorage, and SetLength().

char * dbBLOB::allocRoomFor ( unsigned long  len) const
inline

Definition at line 885 of file oof3.h.

References mStorage, and SetLength().

Referenced by append(), OOF_ramBackend::loadBlob(), and OOF_ctreeBackend::loadBlob().

void dbBLOB::append ( const dbBLOB rhs)

Definition at line 2209 of file oof3.cpp.

References bodyAddress(), and length().

Referenced by dbText::append(), operator+=(), and dbText::operator+=().

void dbBLOB::append ( const void *  appendBody,
unsigned long  bodyLen,
unsigned long  usedLen = ULONG_MAX 
)
virtual
const char * dbField::asChars ( ) const
virtualinherited
char * dbBLOB::bodyAddress ( ) const
void dbField::CalculateWith ( dbCalculator adoptedCalculator,
bool  useOnlyForDefaults 
)
protectedinherited
bool dbField::caseSensitive ( ) const
inlineinherited

Definition at line 747 of file oof3.h.

References kIndexCaseSensitive.

virtual void dbField::clear ( )
inlinevirtualinherited
dbField * dbBLOB::clone ( ) const
virtual

Implements dbField.

Reimplemented in oofBLOB, oofText, and dbText.

Definition at line 2118 of file oof3.cpp.

References dbBLOB().

void dbField::CopyCalculatedValueToBuffer ( )
protectedvirtualinherited
oofString dbField::copyString ( ) const
virtualinherited

Reimplemented in dbText, and dbChar.

Definition at line 472 of file oof3.cpp.

References dbField::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 )
inlinevirtualinherited

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 )
inlinevirtualinherited
void dbField::describe ( std::ostream &  ) const
virtualinherited

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 dbField::fieldIndexOptions(), dbField::fieldIsIndexed(), dbField::fieldType(), and oofString::isEmpty().

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

dbField * dbField::equivalentFieldFromTable ( dbTable baseTable) const
inherited
void dbBLOB::extract ( std::ostream &  os) const
virtual

Reimplemented from dbField.

Reimplemented in dbText.

Definition at line 2307 of file oof3.cpp.

References bodyAddress(), and length().

unsigned long dbField::fieldDataLen ( ) const
inlineinherited
bool dbField::fieldIndexIgnoresNulls ( ) const
inlineinherited

Definition at line 699 of file oof3.h.

References kIndexNoNulls.

Referenced by OOF_ctreeBackend::countAll().

bool dbField::fieldIndexIsCompressLeading ( ) const
inlineinherited

Definition at line 707 of file oof3.h.

References kIndexCompressLeading.

bool dbField::fieldIndexIsCompressPadding ( ) const
inlineinherited

Definition at line 715 of file oof3.h.

References kIndexCompressPadding.

OOF_IndexOptions dbField::fieldIndexOptions ( ) const
inlineinherited

Definition at line 678 of file oof3.h.

Referenced by dbField::describe().

bool dbField::fieldIsBinary ( ) const
virtualinherited

Reimplemented in dbText, and dbChar.

Definition at line 393 of file oof3.cpp.

bool dbBLOB::fieldIsBlob ( ) const
virtual

Reimplemented from dbField.

Definition at line 2162 of file oof3.cpp.

bool dbField::fieldIsIndexed ( ) const
virtualinherited
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

Definition at line 327 of file oof3.cpp.

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

Referenced by OOF_repEditSetupVisitor::VisitIterableBandBody().

bool dbField::fieldIsKeywordIndexed ( ) const
virtualinherited

Reimplemented in dbText, and dbChar.

Definition at line 415 of file oof3.cpp.

Referenced by OOF_ctreeBackend::BuildBackendtables().

bool dbField::fieldIsPartiallyIndexed ( ) const
inlineinherited

Definition at line 692 of file oof3.h.

References dbField::kKeyLengthAutoCalculated.

Referenced by dbField::fieldKeyLen().

bool dbField::fieldIsSameTypeAs ( const dbField rhs) const
virtualinherited
bool dbField::fieldIsStandalone ( ) const
inlineinherited
bool dbField::fieldIsUniqueIndexed ( ) const
virtualinherited
bool dbField::fieldIsVirtual ( ) const
virtualinherited
unsigned short dbField::fieldKeyLen ( ) const
inherited
unsigned long dbField::fieldMinWrapWidth ( ) const
virtualinherited
const oofString & dbField::fieldName ( ) const
inlinevirtualinherited

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(), dbField::name(), OOF_simpleRecordBackend::sortSelectionInverseNow(), OOF_simpleRecordBackend::sortSelectionNow(), oofXMLdataParser::startElement(), oofXMLDBWriter::startSchema(), OOF_repXMLschemaVisitor::UniquifyTables(), dbFieldLink::validToLeaveForm(), and oofXMLDBWriter::writeRecord().

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

Definition at line 723 of file oof3.h.

References kNotIndexed.

Referenced by OOF_ctreeBackend::BuildBackendtables().

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

Implements dbField.

Reimplemented in dbText.

Definition at line 2125 of file oof3.cpp.

References blobField.

unsigned long dbField::fieldUsualWrapWidth ( ) const
virtualinherited

Reimplemented in dbText, and dbChar.

Definition at line 235 of file oof3.cpp.

References dbField::fieldMinWrapWidth().

Referenced by oofViewFieldDefaultsColSizer::CalculateDefaultWidths().

void dbBLOB::generateTestData ( bool  generateRandom,
unsigned long  seedOrCount 
)
virtual

Reimplemented from dbField.

Reimplemented in dbText.

Definition at line 2291 of file oof3.cpp.

References oofString::length(), oofString::makeRandomChars(), and setBytes().

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

Reimplemented in dbText, and dbChar.

Definition at line 481 of file oof3.cpp.

References dbField::extract().

Referenced by dbViewAsTableStorage::GetCellData().

bool dbField::hasDefaultCalculator ( ) const
inlineinherited
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)
inherited

Definition at line 212 of file oof3.cpp.

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

void dbField::indexPartialKeyLen ( unsigned short  inLen)
inlineinherited

Definition at line 685 of file oof3.h.

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

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 dbBLOB::isDirty ( ) const
inline

Definition at line 857 of file oof3.h.

References mStorage.

Referenced by OOF_simpleRecordBackend::DonateBlobBodiesTo(), and OOF_ramBackend::SaveContext().

bool dbBLOB::isEmpty ( ) const
virtual

Reimplemented from dbField.

Definition at line 2155 of file oof3.cpp.

References length().

unsigned long dbBLOB::length ( ) const
virtual
bool dbBLOB::loaded ( ) const
inline

Definition at line 871 of file oof3.h.

References dbBLOBstorage::mLoaded, and mStorage.

Referenced by append(), and bodyAddress().

void dbBLOB::LoadField ( ) const
protected
void dbBLOB::markDirty ( ) const
inline

Definition at line 864 of file oof3.h.

References mStorage.

Referenced by append().

oofString dbField::name ( ) const
virtualinherited

Reimplemented from OOF_PublicBase.

Definition at line 156 of file oof3.cpp.

References dbField::fieldName().

Referenced by dbField::setName().

OOF_fieldTypes dbField::nativeType ( ) const
virtualinherited
void dbBLOB::operator+= ( const dbBLOB rhs)

Definition at line 2246 of file oof3.cpp.

References append().

dbBLOB & dbBLOB::operator= ( const dbBLOB rhs)

Definition at line 2254 of file oof3.cpp.

References bodyAddress(), length(), and setBytes().

Referenced by oofBLOB::oofBLOB(), and oofBLOB::operator=().

char * dbBLOB::orphanBody ( ) const
inline

Definition at line 893 of file oof3.h.

References mStorage.

Referenced by OOF_simpleRecordBackend::DonateBlobBodiesTo(), and OOF_ramBackend::SaveContext().

virtual void dbField::postCloneTableCleanup ( )
inlinevirtualinherited

Reimplemented in dbRelRefBase.

Definition at line 77 of file oof3.h.

Referenced by dbTable::postCloneTableCleanup().

void dbBLOB::reset ( ) const
inline
void dbField::saveDefaultCalculatedValue ( )
inherited
void dbField::saveStoredCalculatedValue ( )
inherited

Definition at line 282 of file oof3.cpp.

References dbField::CopyCalculatedValueToBuffer().

Referenced by OOF_simpleRecordBackend::saveRecord().

void dbBLOB::setBytes ( const void *  buf,
unsigned long  bufLen 
)

Copy the incoming buffer into our local buffer in mStorage.

Use adoptBody to avoid copying.

Definition at line 2280 of file oof3.cpp.

References dbTable::ensureRecordLoaded(), dbField::fieldIsStandalone(), dbTable::markDirty(), mStorage, and dbField::mTable.

Referenced by generateTestData(), and operator=().

void dbBLOB::SetLength ( unsigned long  len) const
protected
void dbField::setName ( const char *  name)
inherited

Definition at line 195 of file oof3.cpp.

References dbField::name().

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

virtual void dbField::setNumber ( long  )
inlinevirtualinherited

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 *  )
inlinevirtualinherited
void dbField::storeCalculatedValues ( )
inlineinherited

Definition at line 813 of file oof3.h.

Referenced by OOF_ctreeBackend::BuildBackendtables().

bool dbField::storesCalculatedValues ( ) const
inlineinherited

Definition at line 806 of file oof3.h.

Referenced by OOF_simpleRecordBackend::GetFieldWriteDest().

const char * dbField::tableName ( ) const
inherited
void dbField::useCalculatorOnlyForDefaults ( )
inlineinherited

Definition at line 799 of file oof3.h.

Referenced by dbField::CalculateWith().

bool dbField::usingCalculator ( ) const
inherited
bool dbField::validateContents ( )
virtualinherited

Definition at line 177 of file oof3.cpp.

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

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

void dbBLOBstorage::setBytes ( const char *  buf,
unsigned long  bufLen 
)
friend
void dbBLOBstorage::setChars ( const char *  str,
unsigned long  charLen 
)
friend

Member Data Documentation

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

Definition at line 61 of file oof1.h.

bool dbBLOB::mIsTextField
protected

Definition at line 432 of file oof3.h.

Referenced by dbText::dbText(), and LoadField().

dbBLOBstorage* dbBLOB::mStorage
protected
dbTable* dbField::mTable
protectedinherited

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