#include <cel_storage.h>
Public Member Functions | |
StorageRewinder (Storage *inStorage) | |
StorageRewinder () | |
void | setStorage (Storage *inStorage) |
void | rewind () |
void | releaseStorage () |
~StorageRewinder () | |
StorageRewinder class memorizes the storage pointer position on the construction and rewinds the storage pointer to the position on the destruction. This class is useful when a function/method should be rewind the storage pointer to the first position although it reads and seeks the storage in it. The following code illustrates how to use this class:
|
inline |
This constructor creates the StorageRewinder on the specified storage. The instance memorizes the current storage position of the storage.
inStorage | A storage on which the StorageRewinder is built on. |
|
inline |
This constructor creates the StorageRewinder that does not hold any storage. This version of constructor is usually used with setStorage method.
|
inline |
This method rewinds the storage to the initial position and delete the StorageRewinder instance.
|
inline |
This method releases the storage instance that is held by this instance. Please note that this method does not rewind the storage.
Referenced by setStorage().
|
inline |
This method rewinds the storage to the initial position.
Referenced by ~StorageRewinder().
|
inline |
This method associates the specified storage instance to this StorageRewinder instance. Please note that the previous one is not to be rewound but only released.
inStorage | A storage on which the StorageRewinder is built on. |