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

Method DeleteChildArray

src/db/hierdatabase.cpp:695–725  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// DeleteChildArray //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

693// DeleteChildArray
694///////////////////////////////////////////////////////////////////////////////
695void cHierDatabaseIter::DeleteChildArray() //throw (eArchive, eHierDatabase)
696{
697 ASSERT(!Done());
698 ASSERT(CanDescend());
699 cDebug d("cHierDatabaseIter::DeleteChildArray");
700
701 if (Done())
702 {
703 d.TraceDetail("Attempt to DeleteChildArray() when Done() == true; returning\n");
704 return;
705 }
706 if (!CanDescend())
707 {
708 d.TraceDetail("Attempt to DeleteChildArray() when none exists; returning\n");
709 return;
710 }
711 //
712 // make sure that the child index is empty...
713 //
714 if (!ChildArrayEmpty())
715 {
716 ASSERT(false);
717 throw eHierDatabase(_T("Attempt to delete a child array that still has entries"));
718 }
719 //
720 // ok, no we can remove it...
721 //
722 mpDb->RemoveItem(cBlockRecordFile::tAddr(mIter->mChild.mBlockNum, mIter->mChild.mIndex));
723 mIter->mChild = cHierAddr();
724 util_RewriteObject(mpDb, &(*mIter), GetCurrentAddr());
725}
726
727
728///////////////////////////////////////////////////////////////////////////////

Callers 2

RemoveChildArrayMethod · 0.80
RemoveDirectoryFunction · 0.80

Calls 5

tAddrClass · 0.85
cHierAddrClass · 0.85
util_RewriteObjectFunction · 0.85
TraceDetailMethod · 0.60
RemoveItemMethod · 0.45

Tested by

no test coverage detected