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

Function util_ReadObject

src/db/hierdatabase.cpp:65–76  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// util_ReadObject -- this will read the given object from the database from the given address. eArchive is thrown on exception. //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

63// given address. eArchive is thrown on exception.
64///////////////////////////////////////////////////////////////////////////////
65static void util_ReadObject(cHierDatabase* pDb, cHierNode* pNode, const cHierAddr& addr)
66{
67 int32 dataSize;
68 int8* pData = pDb->GetDataForReading(cBlockRecordFile::tAddr(addr.mBlockNum, addr.mIndex), dataSize);
69 //
70 // make sure we aren't trying to read a null object
71 //
72 util_ThrowIfNull(addr, _T("util_ReadObject"));
73
74 cFixedMemArchive arch(pData, dataSize);
75 pNode->Read(arch);
76}
77
78///////////////////////////////////////////////////////////////////////////////
79// util_WriteObject -- this will write the given object to the database, returning

Callers 3

OpenImplMethod · 0.85
LoadArrayAtMethod · 0.85
ChildArrayEmptyMethod · 0.85

Calls 4

tAddrClass · 0.85
util_ThrowIfNullFunction · 0.85
GetDataForReadingMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected