MCPcopy Create free account
hub / github.com/PDAL/PDAL / writePhysicalPage

Method writePhysicalPage

plugins/e57/libE57Format/src/CheckedFile.cpp:779–806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779void CheckedFile::writePhysicalPage( char *page_buffer, uint64_t page )
780{
781#ifdef E57_VERBOSE
782 // cout << "writePhysicalPage, page:" << page << std::endl;
783#endif
784
785 // Append checksum
786 uint32_t check_sum = checksum( page_buffer, logicalPageSize );
787 *reinterpret_cast<uint32_t *>( &page_buffer[logicalPageSize] ) =
788 check_sum; //??? little endian dependency
789
790 // Seek to start of physical page
791 seek( page * physicalPageSize, Physical );
792
793#if defined( _MSC_VER )
794 int result = ::_write( fd_, page_buffer, physicalPageSize );
795#elif defined( __GNUC__ )
796 ssize_t result = ::write( fd_, page_buffer, physicalPageSize );
797#else
798#error "no supported compiler defined"
799#endif
800
801 if ( result < 0 )
802 {
803 throw E57_EXCEPTION2( ErrorWriteFailed,
804 "fileName=" + fileName_ + " result=" + toString( result ) );
805 }
806}

Callers

nothing calls this directly

Calls 4

checksumFunction · 0.85
toStringFunction · 0.70
seekFunction · 0.50
writeFunction · 0.50

Tested by

no test coverage detected