MeVisLab Toolbox Reference
ml::MLImageFormatAbstractFileHandle Class Referenceabstract

A base class for abstract read/write access of the MLImageFileFormat. More...

#include <mlImageFormatFileAccess.h>

Inheritance diagram for ml::MLImageFormatAbstractFileHandle:
ml::MLImageFormatDiskFileHandle

Public Member Functions

 MLImageFormatAbstractFileHandle ()
 Standard constructor.
 
virtual ~MLImageFormatAbstractFileHandle ()
 Destructor to clean up. Reimplement to close the file.
 
MLuint8read (MLuint startPosition, MLuint numBytes)
 Convenience method that reads the given block and returns an array that needs to be freed by free().
 
virtual bool read (MLuint8 *data, MLuint startPosition, MLuint numBytes)=0
 Reads the given block and returns true if numBytes have been read.
 
virtual MLErrorCode write (MLuint startPos, const MLuint8 *data, size_t length)=0
 Write the given block.
 
virtual MLint64 getFileSize ()=0
 Returns the current complete file size.
 
virtual MLErrorCode close ()=0
 Closes the file.
 

Detailed Description

A base class for abstract read/write access of the MLImageFileFormat.

It can be derived to create an own file access, e.g. to read data from a database or from the network.

Definition at line 26 of file mlImageFormatFileAccess.h.

Constructor & Destructor Documentation

◆ MLImageFormatAbstractFileHandle()

ml::MLImageFormatAbstractFileHandle::MLImageFormatAbstractFileHandle ( )
inline

Standard constructor.

Definition at line 30 of file mlImageFormatFileAccess.h.

◆ ~MLImageFormatAbstractFileHandle()

virtual ml::MLImageFormatAbstractFileHandle::~MLImageFormatAbstractFileHandle ( )
inlinevirtual

Destructor to clean up. Reimplement to close the file.

Definition at line 33 of file mlImageFormatFileAccess.h.

Member Function Documentation

◆ close()

virtual MLErrorCode ml::MLImageFormatAbstractFileHandle::close ( )
pure virtual

Closes the file.

Implemented in ml::MLImageFormatDiskFileHandle.

◆ getFileSize()

virtual MLint64 ml::MLImageFormatAbstractFileHandle::getFileSize ( )
pure virtual

Returns the current complete file size.

Implemented in ml::MLImageFormatDiskFileHandle.

◆ read() [1/2]

MLuint8 * ml::MLImageFormatAbstractFileHandle::read ( MLuint startPosition,
MLuint numBytes )

Convenience method that reads the given block and returns an array that needs to be freed by free().

Returns NULL if failed.

◆ read() [2/2]

virtual bool ml::MLImageFormatAbstractFileHandle::read ( MLuint8 * data,
MLuint startPosition,
MLuint numBytes )
pure virtual

Reads the given block and returns true if numBytes have been read.

The data pointer needs to be large enough to hold numBytes bytes.

Implemented in ml::MLImageFormatDiskFileHandle.

◆ write()

virtual MLErrorCode ml::MLImageFormatAbstractFileHandle::write ( MLuint startPos,
const MLuint8 * data,
size_t length )
pure virtual

Write the given block.

Implemented in ml::MLImageFormatDiskFileHandle.


The documentation for this class was generated from the following file: