46 unsigned remainder = binarySectionLogicalLength_ % 4;
49 binarySectionLogicalLength_ += 4 - remainder;
54 binarySectionLogicalStart_ = imf->allocateSpace( binarySectionLogicalLength_,
true );
59 #ifdef E57_MAX_VERBOSE
64 imf->file_->seek( binarySectionLogicalStart_ );
65 imf->file_->write(
reinterpret_cast<char *
>( &header ),
sizeof( header ) );
78 blobLogicalLength_ =
length;
79 binarySectionLogicalStart_ = imf->file_->physicalToLogical( fileOffset );
94 std::shared_ptr<BlobNodeImpl> bi( std::static_pointer_cast<BlobNodeImpl>( ni ) );
97 if ( blobLogicalLength_ != bi->blobLogicalLength_ )
119 return ( blobLogicalLength_ );
127 if (
static_cast<uint64_t
>( start ) +
count > blobLogicalLength_ )
135 imf->file_->seek( binarySectionLogicalStart_ +
sizeof(
BlobSectionHeader ) + start );
136 imf->file_->read(
reinterpret_cast<char *
>( buf ),
137 static_cast<size_t>(
count ) );
156 if (
static_cast<uint64_t
>( start ) +
count > blobLogicalLength_ )
164 imf->file_->seek( binarySectionLogicalStart_ +
sizeof(
BlobSectionHeader ) + start );
165 imf->file_->write(
reinterpret_cast<char *
>( buf ),
166 static_cast<size_t>(
count ) );
182 const char *forcedFieldName )
187 if ( forcedFieldName !=
nullptr )
189 fieldName = forcedFieldName;
200 cf <<
space( indent ) <<
"<" << fieldName <<
" type=\"Blob\" fileOffset=\"" << physicalOffset <<
"\" length=\""
201 << blobLogicalLength_ <<
"\"/>\n";
208 os <<
space( indent ) <<
"type: Blob"
211 os <<
space( indent ) <<
"blobLogicalLength_: " << blobLogicalLength_ <<
std::endl;
212 os <<
space( indent ) <<
"binarySectionLogicalStart: " << binarySectionLogicalStart_ <<
std::endl;
213 os <<
space( indent ) <<
"binarySectionLogicalLength: " << binarySectionLogicalLength_ <<
std::endl;
void write(uint8_t *buf, int64_t start, size_t count)
void writeXml(ImageFileImplSharedPtr imf, CheckedFile &cf, int indent, const char *forcedFieldName=nullptr) override
void dump(int indent=0, std::ostream &os=std::cout) const override
void checkLeavesInSet(const StringSet &pathNames, NodeImplSharedPtr origin) override
void read(uint8_t *buf, int64_t start, size_t count)
BlobNodeImpl(ImageFileImplWeakPtr destImageFile, int64_t byteCount)
bool isTypeEquivalent(NodeImplSharedPtr ni) override
NodeType type() const override
bool isDefined(const ustring &pathName) override
static uint64_t logicalToPhysical(uint64_t logicalOffset)
ImageFileImplWeakPtr destImageFile_
ImageFileImplSharedPtr destImageFile()
ustring relativePathName(const NodeImplSharedPtr &origin, ustring childPathName=ustring()) const
void checkImageFileOpen(const char *srcFileName, int srcLineNumber, const char *srcFunctionName) const
virtual void dump(int indent=0, std::ostream &os=std::cout) const
__host__ __device__ float length(float2 v)
QTextStream & endl(QTextStream &stream)
std::shared_ptr< class NodeImpl > NodeImplSharedPtr
std::weak_ptr< class ImageFileImpl > ImageFileImplWeakPtr
std::shared_ptr< class ImageFileImpl > ImageFileImplSharedPtr
@ E57_ERROR_FILE_IS_READ_ONLY
can't modify read only file
@ E57_ERROR_BAD_API_ARGUMENT
bad API function argument provided by user
@ E57_ERROR_NO_BUFFER_FOR_ELEMENT
@ E57_ERROR_NODE_UNATTACHED
node is not yet attached to tree of ImageFile
std::string ustring
UTF-8 encodeded Unicode string.
std::set< std::string > StringSet
@ E57_BLOB
BlobNode class.
std::string toString(T x)
std::string space(size_t n)