#include <cel_storage.h>

Public Member Functions | |
| 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 |
Static Public Member Functions | |
| static AutoPtr< Storage > | create (const String &inUriOrFileName, bool inLateBinding=false, ResourceBroker *inBroker=NULL) |
Definition at line 25 of file cel_storage.h.
| virtual uint64_t Celartem::Storage::getSize | ( | ) | const [pure virtual] |
This method obtains the current storage size in bytes.
| virtual uint64_t Celartem::Storage::getPos | ( | ) | const [pure virtual] |
This method obtains the current storage pointer position in byte offset from the beginning of the storage.
| virtual void Celartem::Storage::reserve | ( | uint64_t | inReservationSize | ) | [pure virtual] |
This method reserves the storage size. Since to resize the storage is not so simple work and it may takes so much time, you should reserve the size of storage in the first time. With this method, you don't have to care of the runtime costs of the resizing storage.
Please note that there are storages that is not implement the method. In any case, it never throws any exception but it may do nothing.
| inReservationSize | Size to reserve. |
| virtual void Celartem::Storage::setPos | ( | uint64_t | inPosition | ) | [pure virtual] |
This method moves the storage pointer to the specified position. Please note that it is not an error to set the storage pointer to a position beyond the EOF. The size of the file does not increase until you call the writeBytes function. A write operation increases the size of the storage to the storage pointer position plus the size of the buffer written, leaving the intervening bytes uninitialized.
| inPosition | Position in byte offset from the beginning of the storage. |
Referenced by Celartem::DjVu::MemoryData::create().
| virtual void Celartem::Storage::setPosRelative | ( | int64_t | inPosition | ) | [pure virtual] |
This method moves the storage pointer to the specified position. Please note that it is not an error to set the storage pointer to a position beyond the EOF. The size of the file does not increase until you call the writeBytes function. A write operation increases the size of the storage to the storage pointer position plus the size of the buffer written, leaving the intervening bytes uninitialized.
| inPosition | Position in byte offset from the current storage pointer position. |
| virtual void Celartem::Storage::setPosFromEnd | ( | int64_t | inPosition | ) | [pure virtual] |
This method moves the storage pointer to the specified position. Please note that it is not an error to set the storage pointer to a position beyond the EOF. The size of the file does not increase until you call the writeBytes function. A write operation increases the size of the storage to the storage pointer position plus the size of the buffer written, leaving the intervening bytes uninitialized.
| inPosition | Position in byte offset from the current EOF. |
| virtual void Celartem::Storage::setEof | ( | ) | [pure virtual] |
This method set the end mark to the current storage position. The following code sets the storage size:
void setStorageSize(Storage *inStorage, size_t inSize) { // firstly, preserves the current position StorageRewinder sr(inStorage); // set size inStorage->setPos(inSize); inStorage->setEof(); }
| virtual String Celartem::Storage::getStorageId | ( | ) | const [pure virtual] |
This method returns the identifier of the storage.
It usually returns a filename or an URL that specifies the storage location. In cases with volatile storage, this function returns some string that is automatically generated by the storage class.
This method duplicates the storage instance, it is not to duplicate the reference count of the storage instance.
| virtual Time Celartem::Storage::getLastUpdateTime | ( | ) | const [pure virtual] |
This method returns the last update time of the file.
| static AutoPtr<Storage> Celartem::Storage::create | ( | const String & | inUriOrFileName, | |
| bool | inLateBinding = false, |
|||
| ResourceBroker * | inBroker = NULL | |||
| ) | [static] |
This method locates the resource and returns a pointer to read-only Storage instance.
| inUriOrFileName | URI or local file name of the resource. The default implementation can deal with URIs starts from http or file or local file names. | |
| inLateBinding | If this parameter is true, this method actually never establish a connection to the resource but the first time when any of the methods of this instance is called, it tries to connect to the resource.Otherwise, if this parameter is false, this method immediately connects to the resource within this method. | |
| inBroker | A ResourceBroker instance which locates the file. If NULL is specified, this method uses the default broker. |