#include <cel_storage.h>
Public Member Functions | |
virtual SimpleArray< u8 > & | getArray ()=0 |
virtual void | setAllocationUnit (size_t inAllocationUnitInBytes)=0 |
virtual void | setReadOnly (bool inReadOnly)=0 |
virtual bool | isOwnMemory () const =0 |
virtual void | makeOwnCopy ()=0 |
virtual void | retain (Referable *inReferable)=0 |
Public Member Functions inherited from Celartem::Storage | |
virtual uint64_t | getSize () const =0 |
virtual uint64_t | getPos () const =0 |
virtual void | reserve (uint64_t inReservationSize)=0 |
virtual void | setPos (uint64_t inPosition)=0 |
virtual void | setPosRelative (int64_t inPosition)=0 |
virtual void | setPosFromEnd (int64_t inPosition)=0 |
virtual void | setEof ()=0 |
virtual String | getStorageId () const =0 |
virtual AutoPtr< Storage > | duplicate () const =0 |
virtual Time | getLastUpdateTime () const =0 |
Public Member Functions inherited from Celartem::Stream | |
virtual size_t | readBytes (void *buffer, size_t inSize, bool wouldBlock=false)=0 |
virtual void | writeBytes (const void *buffer, size_t inSize)=0 |
virtual void | flushBuffer ()=0 |
virtual bool | isEof () const =0 |
virtual size_t | duplicateStream (Stream *inStream, size_t inBufferSize=1024, DuplicateStreamCallback inCallback=NULL, void *inCallbackContext=NULL) |
virtual size_t | duplicateStreamBytes (Stream *inStream, size_t inMaximumByteSize, size_t inBufferSize=1024, DuplicateStreamCallback inCallback=NULL, void *inCallbackContext=NULL) |
Public Member Functions inherited from Celartem::Referable | |
Referable () | |
void | addRef () const |
void | releaseRef () const |
size_t | getReferenceCount () const |
Public Member Functions inherited from Celartem::Lockable | |
virtual void | lock () const =0 |
virtual void | unlock () const =0 |
Static Public Member Functions | |
static AutoPtr< MemoryStorage > | create (SimpleArray< u8 > &inMemory, const Referable *inReferable=NULL) |
static AutoPtr< MemoryStorage > | create (const SimpleArray< u8 > &inMemory, const Referable *inReferable=NULL) |
static AutoPtr< MemoryStorage > | create () |
static AutoPtr< MemoryStorage > | create (const void *inData, size_t inDataSize, Endian inEndian=endianHost) |
Static Public Member Functions inherited from Celartem::Storage | |
static AutoPtr< Storage > | create (const String &inUriOrFileName, bool inLateBinding=false, ResourceBroker *inBroker=NULL) |
static AutoPtr< Storage > | createTempNoLock () |
Static Public Member Functions inherited from Celartem::Referable | |
static void | dumpDbgAllRefCount () |
This class provides the feature of creating writable storage upon SimpleArray <u8> instance.
|
static |
This method creates Memory based R/W Storage.
inMemory | A memory to access with the storage to create. |
inReferable | An optional parameter, which specifies a Referable instance to retain on the instance. |
|
static |
This method creates Memory based read only Storage.
inMemory | A memory to access with the storage to create. |
inReferable | An optional parameter, which specifies a Referable instance to retain on the instance. |
|
static |
This method creates Memory Based R/W Storage. It creates an SimpleArray <u8> instance internally and you can obtain it by getArray function.
Referenced by Celartem::DjVu::MemoryData::getReadOnlyStorage(), and Celartem::DjVu::MemoryData::getStorage().
|
static |
This method creates Memory Based R/W Storage. It creates an SimpleArray <u8> instance internally using the specified buffer (duplicate the buffer data) and you can obtain it by getArray function.
inData | Pointer to the buffer of the initial data. |
inDataSize | The size of the buffer. |
inEndian | The endianness of the specified buffer. |
|
pure virtual |
This method returns the array which is used in this MemoryStorage instance.
|
pure virtual |
This method determines whether the instance owns the memory block.
true
if it owns the memory block; otherwise false
.
|
pure virtual |
This method duplicates the associated memory to the instance.
|
pure virtual |
|
pure virtual |
This method is to set the memory allocation unit. It controls the memory effeciency and the speed. A large value results in the good speed but the drawback is the bad memory effeciency.
inAllocationUnitInBytes | The memory allocation unit in bytes. |
|
pure virtual |
This method makes the storage read-only.
inReadOnly | true to make the storage read-only; otherwise the storage can be writable. |