Write one index packet. We don't have an interface to work with index packets, but one is required by the standard, so write one index packet with one entry pointing to the first data packet.
| 667 | // We don't have an interface to work with index packets, but one is required by the standard, so |
| 668 | // write one index packet with one entry pointing to the first data packet. |
| 669 | void e57::CompressedVectorWriterImpl::packetWriteIndex() |
| 670 | { |
| 671 | ImageFileImplSharedPtr imf( cVector_->destImageFile_ ); |
| 672 | |
| 673 | IndexPacket indexPacket; |
| 674 | |
| 675 | indexPacket.entries[0].chunkPhysicalOffset = dataPhysicalOffset_; |
| 676 | |
| 677 | const auto cPacketLength = sizeof( IndexPacketHeader ) + sizeof( IndexPacket::Entry ); |
| 678 | |
| 679 | indexPacket.header.packetLogicalLengthMinus1 = cPacketLength - 1; |
| 680 | indexPacket.header.entryCount = 1; |
| 681 | |
| 682 | uint64_t packetLogicalOffset = imf->allocateSpace( cPacketLength, false ); |
| 683 | topIndexPhysicalOffset_ = imf->file_->logicalToPhysical( packetLogicalOffset ); |
| 684 | |
| 685 | imf->file_->seek( packetLogicalOffset ); |
| 686 | imf->file_->write( reinterpret_cast<const char *>( &indexPacket ), cPacketLength ); |
| 687 | |
| 688 | indexPacketsCount_++; |
| 689 | } |
| 690 | |
| 691 | void CompressedVectorWriterImpl::flush() |
| 692 | { |
nothing calls this directly
no test coverage detected