Public Member Functions | List of all members
Celartem::BlockReadStorage Class Referenceabstract

#include <cel_storage.h>

Public Member Functions

virtual size_t readBytes (void *buffer, uint64_t inOffset, size_t inSize, bool wouldBlock=false)=0

Detailed Description

This class defines an additional readBytes function, which accepts direct offset rather than reading from the current file pointer. Some variants of Storage implements this interface so that you can query the interface by using dynamic_cast.

Member Function Documentation

virtual size_t Celartem::BlockReadStorage::readBytes ( void *  buffer,
uint64_t  inOffset,
size_t  inSize,
bool  wouldBlock = false 
pure virtual

readBytes tries to read bytes from the specified offset. If wouldBlock is false, readBytes reads the data currenly available and returned immediately; the returned value indicates the bytes actually read and it is no more than inSize. If wouldBlock is true, it blocks until it reads all the bytes specified by inSize parameter. If the stream is potentially read-only and it seems there're no chance to read the bytes specified by inSize, it throws some exception.

bufferPointer to a buffer that receives the data.
inOffsetAbsolute offset address to read from.
inSizeMaximum size to read; readBytes reads data no more than the number of bytes specified by inSize.
wouldBlockIt specifies it blocks until all bytes comes or not.
readBytes returns the number of bytes read by this call.

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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo