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

Method LoadArrayAt

src/db/hierdatabase.cpp:267–307  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// LoadArrayAt //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

265// LoadArrayAt
266///////////////////////////////////////////////////////////////////////////////
267void cHierDatabaseIter::LoadArrayAt(const cHierAddr& addr) //throw (eArchive, eHierDatabase)
268{
269 ASSERT(mpDb != 0);
270 //
271 // make sure the address is non-null
272 //
273 util_ThrowIfNull(addr, _T("cHierDatabaseIter::LoadArrayAt"));
274 //
275 // load the info and the array
276 //
277 mInfoAddr = addr;
278 util_ReadObject(mpDb, &mInfo, mInfoAddr);
279 cHierAddr curAddr = mInfo.mArray;
280 //
281 // load in all the array entries...
282 //
283 mEntries.clear();
284 while (!curAddr.IsNull())
285 {
286 mEntries.push_back(cHierEntry());
287 //Catch db errors, in case only part of db is broken
288 try
289 {
290 util_ReadObject(mpDb, &mEntries.back(), curAddr);
291 }
292 catch (eError& e)
293 {
294 e.SetFatality(false);
295 cErrorReporter::PrintErrorMsg(e);
296 mEntries.pop_back();
297 break;
298 }
299
300 curAddr = mEntries.back().mNext;
301 }
302
303 //
304 // seek to the beginning of the array
305 //
306 SeekBegin();
307}
308
309
310///////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 5

util_ThrowIfNullFunction · 0.85
util_ReadObjectFunction · 0.85
cHierEntryClass · 0.85
IsNullMethod · 0.80
SetFatalityMethod · 0.80

Tested by

no test coverage detected