MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / SetData

Method SetData

src/db/hierdatabase.cpp:590–610  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// SetData //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

588// SetData
589///////////////////////////////////////////////////////////////////////////////
590void cHierDatabaseIter::SetData(int8* pData, int32 length) //throw (eArchive, eHierDatabase)
591{
592 ASSERT(!Done());
593 ASSERT(!HasData());
594
595 // remove the item's data, if there is any...
596 //
597 if (HasData())
598 {
599 RemoveData();
600 }
601 //
602 // add the data and set the entry's data pointer appropriately
603 //
604 cBlockRecordFile::tAddr addr = mpDb->AddItem(pData, length);
605 mIter->mData = cHierAddr(addr.mBlockNum, addr.mIndex);
606 //
607 // update the entry on disk...
608 //
609 util_RewriteObject(mpDb, &(*mIter), GetCurrentAddr());
610}
611
612///////////////////////////////////////////////////////////////////////////////
613// RemoveData

Callers 2

SetFCODataMethod · 0.80
AddFileFunction · 0.80

Calls 3

cHierAddrClass · 0.85
util_RewriteObjectFunction · 0.85
AddItemMethod · 0.45

Tested by

no test coverage detected