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

Method write

plugins/e57/libE57Format/src/BlobNodeImpl.cpp:143–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141 }
142
143 void BlobNodeImpl::write( uint8_t *buf, int64_t start, size_t count )
144 {
145 //??? check start not negative
146 checkImageFileOpen( __FILE__, __LINE__, static_cast<const char *>( __FUNCTION__ ) );
147
148 ImageFileImplSharedPtr destImageFile( destImageFile_ );
149
150 if ( !destImageFile->isWriter() )
151 {
152 throw E57_EXCEPTION2( ErrorFileReadOnly, "fileName=" + destImageFile->fileName() );
153 }
154 if ( !isAttached() )
155 {
156 throw E57_EXCEPTION2( ErrorNodeUnattached, "fileName=" + destImageFile->fileName() );
157 }
158
159 if ( static_cast<uint64_t>( start ) + count > blobLogicalLength_ )
160 {
161 throw E57_EXCEPTION2( ErrorBadAPIArgument,
162 "this->pathName=" + this->pathName() +
163 " start=" + toString( start ) + " count=" + toString( count ) +
164 " length=" + toString( blobLogicalLength_ ) );
165 }
166
167 ImageFileImplSharedPtr imf( destImageFile_ );
168 imf->file_->seek( binarySectionLogicalStart_ + sizeof( BlobSectionHeader ) + start );
169 imf->file_->write( reinterpret_cast<char *>( buf ),
170 static_cast<size_t>( count ) ); //??? arg1 void* ?
171 }
172
173 void BlobNodeImpl::checkLeavesInSet( const StringSet &pathNames, NodeImplSharedPtr origin )
174 {

Callers 1

BlobNodeImplMethod · 0.45

Calls 5

isWriterMethod · 0.80
toStringFunction · 0.70
fileNameMethod · 0.45
pathNameMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected