MeVisLab Toolbox Reference
ml::MLImageFormatDiskFileHandle Class Reference

Implements reading and writing from a given file descriptor. More...

#include <mlImageFormatFileAccess.h>

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

Public Member Functions

 MLImageFormatDiskFileHandle (int fd)
 Standard constructor.
 
 ~MLImageFormatDiskFileHandle () override
 Destructor to clean up.
 
bool read (MLuint8 *data, MLuint startPosition, MLuint numBytes) override
 Reads the given block and returns true if numBytes have been read.
 
MLErrorCode write (MLuint startPos, const MLuint8 *data, size_t length) override
 Writes the given block.
 
MLint64 getFileSize () override
 Returns the current complete file size. If an error occurs, a value <0 is returned.
 
MLErrorCode close () override
 Closes the file.
 
- Public Member Functions inherited from ml::MLImageFormatAbstractFileHandle
 MLImageFormatAbstractFileHandle ()
 Standard constructor.
 
virtual ~MLImageFormatAbstractFileHandle ()
 Destructor to clean up. Reimplement to close the file.
 
MLuint8 * read (MLuint startPosition, MLuint numBytes)
 Convenience method that reads the given block and returns an array that needs to be freed by free().
 

Detailed Description

Implements reading and writing from a given file descriptor.

Definition at line 55 of file mlImageFormatFileAccess.h.

Constructor & Destructor Documentation

◆ MLImageFormatDiskFileHandle()

ml::MLImageFormatDiskFileHandle::MLImageFormatDiskFileHandle ( int  fd)

Standard constructor.

◆ ~MLImageFormatDiskFileHandle()

ml::MLImageFormatDiskFileHandle::~MLImageFormatDiskFileHandle ( )
override

Destructor to clean up.

Member Function Documentation

◆ close()

MLErrorCode ml::MLImageFormatDiskFileHandle::close ( )
overridevirtual

Closes the file.

Implements ml::MLImageFormatAbstractFileHandle.

◆ getFileSize()

MLint64 ml::MLImageFormatDiskFileHandle::getFileSize ( )
overridevirtual

Returns the current complete file size. If an error occurs, a value <0 is returned.

Implements ml::MLImageFormatAbstractFileHandle.

◆ read()

bool ml::MLImageFormatDiskFileHandle::read ( MLuint8 *  data,
MLuint  startPosition,
MLuint  numBytes 
)
overridevirtual

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

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

Implements ml::MLImageFormatAbstractFileHandle.

◆ write()

MLErrorCode ml::MLImageFormatDiskFileHandle::write ( MLuint  startPos,
const MLuint8 *  data,
size_t  length 
)
overridevirtual

Writes the given block.

Implements ml::MLImageFormatAbstractFileHandle.


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