////////////////////////////////////////////////////////////////////////// GetDataForWriting //////////////////////////////////////////////////////////////////////////
| 458 | // GetDataForWriting |
| 459 | /////////////////////////////////////////////////////////////////////////////// |
| 460 | int8* cBlockRecordArray::GetDataForWriting(int index, int32& dataSize) //throw (eArchive) |
| 461 | { |
| 462 | // make ourselves initialized, if we are not right now... |
| 463 | // |
| 464 | if (!Initialized()) |
| 465 | { |
| 466 | InitForExistingBlock(); |
| 467 | } |
| 468 | |
| 469 | ASSERT(IsItemValid(index)); |
| 470 | cBlockFile::Block* pBlock = mpBlockFile->GetBlock(mBlockNum); |
| 471 | tIndexArray& indexArray = util_GetIndexArray(pBlock); |
| 472 | pBlock->SetDirty(); |
| 473 | // |
| 474 | // figure out the size of the block |
| 475 | // |
| 476 | dataSize = indexArray.maRecordIndex[index].GetOffset(); |
| 477 | if (index != 0) |
| 478 | { |
| 479 | dataSize -= indexArray.maRecordIndex[index - 1].GetOffset(); |
| 480 | } |
| 481 | |
| 482 | #ifdef _BLOCKFILE_DEBUG |
| 483 | AssertValid(); |
| 484 | mpBlockFile->AssertValid(); |
| 485 | #endif |
| 486 | |
| 487 | return (util_OffsetToAddr(pBlock, indexArray.maRecordIndex[index].GetOffset())); |
| 488 | } |
| 489 | |
| 490 | |
| 491 | /////////////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected