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

Method AddItem

src/db/blockrecordfile.cpp:153–173  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// AddItem //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

151// AddItem
152///////////////////////////////////////////////////////////////////////////////
153cBlockRecordFile::tAddr cBlockRecordFile::AddItem(int8* pData, int dataSize) //throw (eArchive)
154{
155 ASSERT(mbOpen);
156#ifdef _BLOCKFILE_DEBUG
157 AssertValid();
158#endif
159 tAddr rtn(0, 0);
160 //
161 // first, let's find room for this data item...
162 //
163 rtn.mBlockNum = FindRoomForData(dataSize);
164 //
165 // now, insert the data...
166 //
167 rtn.mIndex = mvBlocks[rtn.mBlockNum].AddItem(pData, dataSize, 1);
168 //
169 // update the last added to pointer and return the location...
170 //
171 mLastAddedTo = rtn.mBlockNum;
172 return rtn;
173}
174
175///////////////////////////////////////////////////////////////////////////////
176// RemoveItem

Callers 2

util_WriteObjectFunction · 0.45
SetDataMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected