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

Function util_WriteObject

src/db/hierdatabase.cpp:82–90  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// util_WriteObject -- this will write the given object to the database, returning the address that it was written to, and throwing eArchive on error. //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

80// the address that it was written to, and throwing eArchive on error.
81///////////////////////////////////////////////////////////////////////////////
82static cHierAddr util_WriteObject(cHierDatabase* pDb, cHierNode* pNode)
83{
84 static cMemoryArchive arch;
85 arch.Seek(0, cBidirArchive::BEGINNING);
86 pNode->Write(arch);
87
88 cBlockRecordFile::tAddr addr = pDb->AddItem(arch.GetMemory(), arch.CurrentPos());
89 return cHierAddr(addr.mBlockNum, addr.mIndex);
90}
91
92///////////////////////////////////////////////////////////////////////////////
93// util_RewriteObject -- call this when the data in a structure has changed, but

Callers 3

OpenImplMethod · 0.85
CreateChildArrayMethod · 0.85
CreateEntryMethod · 0.85

Calls 6

cHierAddrClass · 0.85
GetMemoryMethod · 0.80
CurrentPosMethod · 0.80
SeekMethod · 0.45
WriteMethod · 0.45
AddItemMethod · 0.45

Tested by

no test coverage detected