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

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

Write the given block.

Implements ml::MLImageFormatAbstractFileHandle.


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