SDTS_AL
Public Member Functions | List of all members
VSISparseFileHandle Class Reference
Inheritance diagram for VSISparseFileHandle:
VSIVirtualHandle

Public Member Functions

virtual int Seek (vsi_l_offset nOffset, int nWhence) override
 Seek to requested offset. More...
 
virtual vsi_l_offset Tell () override
 Tell current file offset. More...
 
virtual size_t Read (void *pBuffer, size_t nSize, size_t nMemb) override
 Read bytes from file. More...
 
virtual size_t Write (const void *pBuffer, size_t nSize, size_t nMemb) override
 Write bytes to file. More...
 
virtual int Eof () override
 Test for end of file. More...
 
virtual int Close () override
 Close file. More...
 
- Public Member Functions inherited from VSIVirtualHandle
virtual int ReadMultiRange (int nRanges, void **ppData, const vsi_l_offset *panOffsets, const size_t *panSizes)
 Read several ranges of bytes from file. More...
 
virtual int Flush ()
 Flush pending writes to disk. More...
 
virtual int Truncate (vsi_l_offset nNewSize)
 Truncate/expand the file to the specified size. More...
 
virtual void * GetNativeFileDescriptor ()
 Returns the "native" file descriptor for the virtual handle. More...
 
virtual VSIRangeStatus GetRangeStatus (CPL_UNUSED vsi_l_offset nOffset, CPL_UNUSED vsi_l_offset nLength)
 Return if a given file range contains data or holes filled with zeroes. More...
 

Member Function Documentation

int VSISparseFileHandle::Close ( )
overridevirtual

Close file.

This function closes the indicated file.

This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.

Analog of the POSIX fclose() function.

Returns
0 on success or -1 on failure.

Implements VSIVirtualHandle.

int VSISparseFileHandle::Eof ( )
overridevirtual

Test for end of file.

Returns TRUE (non-zero) if an end-of-file condition occurred during the previous read operation. The end-of-file flag is cleared by a successful VSIFSeekL() call.

This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.

Analog of the POSIX feof() call.

Returns
TRUE if at EOF else FALSE.

Implements VSIVirtualHandle.

size_t VSISparseFileHandle::Read ( void *  pBuffer,
size_t  nSize,
size_t  nCount 
)
overridevirtual

Read bytes from file.

Reads nCount objects of nSize bytes from the indicated file at the current offset into the indicated buffer.

This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.

Analog of the POSIX fread() call.

Parameters
pBufferthe buffer into which the data should be read (at least nCount * nSize bytes in size.
nSizesize of objects to read in bytes.
nCountnumber of objects to read.
Returns
number of objects successfully read.

Implements VSIVirtualHandle.

int VSISparseFileHandle::Seek ( vsi_l_offset  nOffset,
int  nWhence 
)
overridevirtual

Seek to requested offset.

Seek to the desired offset (nOffset) in the indicated file.

This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.

Analog of the POSIX fseek() call.

Parameters
nOffsetoffset in bytes.
nWhenceone of SEEK_SET, SEEK_CUR or SEEK_END.
Returns
0 on success or -1 one failure.

Implements VSIVirtualHandle.

vsi_l_offset VSISparseFileHandle::Tell ( )
overridevirtual

Tell current file offset.

Returns the current file read/write offset in bytes from the beginning of the file.

This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.

Analog of the POSIX ftell() call.

Returns
file offset in bytes.

Implements VSIVirtualHandle.

size_t VSISparseFileHandle::Write ( const void *  pBuffer,
size_t  nSize,
size_t  nCount 
)
overridevirtual

Write bytes to file.

Writess nCount objects of nSize bytes to the indicated file at the current offset into the indicated buffer.

This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.

Analog of the POSIX fwrite() call.

Parameters
pBufferthe buffer from which the data should be written (at least nCount * nSize bytes in size.
nSizesize of objects to read in bytes.
nCountnumber of objects to read.
Returns
number of objects successfully written.

Implements VSIVirtualHandle.


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