#include <basicio.hpp>
Public Member Functions | |
| virtual | ~RemoteIo () |
| Destructor. Releases all managed memory. | |
Manipulators | |
| virtual int | open () |
| Connect to the remote server, get the size of the remote file and allocate the array of blocksMap. | |
| virtual int | close () |
| Reset the IO position to the start. It does not release the data. | |
| virtual long | write (const byte *data, long wcount) |
| Not support this method. | |
| virtual long | write (BasicIo &src) |
| Write data that is read from another BasicIo instance to the remote file. | |
| virtual int | putb (byte data) |
| Not support. | |
| virtual DataBuf | read (long rcount) |
| Read data from the memory blocks. Reading starts at the current IO position and the position is advanced by the number of bytes read. If the memory blocks are not populated (False), it will connect to server and populate the data to memory blocks. | |
| virtual long | read (byte *buf, long rcount) |
| Read data from the the memory blocks. Reading starts at the current IO position and the position is advanced by the number of bytes read. If the memory blocks are not populated (!= bMemory), it will connect to server and populate the data to memory blocks. | |
| virtual int | getb () |
| Read one byte from the memory blocks. The IO position is advanced by one byte. If the memory block is not populated (!= bMemory), it will connect to server and populate the data to the memory block. | |
| virtual void | transfer (BasicIo &src) |
| Remove the contents of the file and then transfer data from the src BasicIo object into the empty file. | |
| virtual int | seek (long offset, Position pos) |
| Move the current IO position. | |
| virtual byte * | mmap (bool=false) |
| Not support. | |
| virtual int | munmap () |
| Not support. | |
Accessors | |
| virtual long | tell () const |
| Get the current IO position. | |
| virtual long | size () const |
| Get the current memory buffer size in bytes. | |
| virtual bool | isopen () const |
| Returns true if the memory area is allocated. | |
| virtual int | error () const |
| Always returns 0. | |
| virtual bool | eof () const |
| Returns true if the IO position has reach the end, otherwise false. | |
| virtual std::string | path () const |
| Returns the URL of the file. | |
| virtual BasicIo::AutoPtr | temporary () const |
| Returns a temporary data storage location. Currently returns an empty MemIo object, but callers should not rely on this behavior since it may change. | |
| virtual void | populateFakeData () |
| Mark all the bNone blocks to bKnow. This avoids allocating memory for parts of the file that contain image-date (non-metadata/pixel data). | |
Protected Member Functions | |
Creators | |
| RemoteIo () | |
| Default Constructor. | |
Protected Attributes | |
| Impl * | p_ |
| virtual int Exiv2::RemoteIo::open | ( | ) | [virtual] |
Connect to the remote server, get the size of the remote file and allocate the array of blocksMap.
If the blocksMap is already allocated (this method has been called before), it just reset IO position to the start and does not flush the old data.
Implements Exiv2::BasicIo.
| virtual int Exiv2::RemoteIo::close | ( | ) | [virtual] |
Reset the IO position to the start. It does not release the data.
Implements Exiv2::BasicIo.
| virtual long Exiv2::RemoteIo::write | ( | const byte * | data, | |
| long | wcount | |||
| ) | [virtual] |
| virtual long Exiv2::RemoteIo::write | ( | BasicIo & | src | ) | [virtual] |
Write data that is read from another BasicIo instance to the remote file.
The write access is done in an efficient way. It only sends the range of different bytes between the current data and BasicIo instance to the remote machine.
| src | Reference to another BasicIo instance. Reading start at the source's current IO position |
| Error | In case of failure |
Implements Exiv2::BasicIo.
| virtual int Exiv2::RemoteIo::putb | ( | byte | data | ) | [virtual] |
| virtual DataBuf Exiv2::RemoteIo::read | ( | long | rcount | ) | [virtual] |
Read data from the memory blocks. Reading starts at the current IO position and the position is advanced by the number of bytes read. If the memory blocks are not populated (False), it will connect to server and populate the data to memory blocks.
| rcount | Maximum number of bytes to read. Fewer bytes may be read if rcount bytes are not available. |
Implements Exiv2::BasicIo.
| virtual long Exiv2::RemoteIo::read | ( | byte * | buf, | |
| long | rcount | |||
| ) | [virtual] |
Read data from the the memory blocks. Reading starts at the current IO position and the position is advanced by the number of bytes read. If the memory blocks are not populated (!= bMemory), it will connect to server and populate the data to memory blocks.
| buf | Pointer to a block of memory into which the read data is stored. The memory block must be at least rcount bytes long. | |
| rcount | Maximum number of bytes to read. Fewer bytes may be read if rcount bytes are not available. |
Implements Exiv2::BasicIo.
| virtual int Exiv2::RemoteIo::getb | ( | ) | [virtual] |
Read one byte from the memory blocks. The IO position is advanced by one byte. If the memory block is not populated (!= bMemory), it will connect to server and populate the data to the memory block.
Implements Exiv2::BasicIo.
| virtual void Exiv2::RemoteIo::transfer | ( | BasicIo & | src | ) | [virtual] |
Remove the contents of the file and then transfer data from the src BasicIo object into the empty file.
The write access is done in an efficient way. It only sends the range of different bytes between the current data and BasicIo instance to the remote machine.
| src | Reference to another BasicIo instance. The entire contents of src are transferred to this object. The src object is invalidated by the method. |
| Error | In case of failure |
Implements Exiv2::BasicIo.
| virtual int Exiv2::RemoteIo::seek | ( | long | offset, | |
| Position | pos | |||
| ) | [virtual] |
Move the current IO position.
| offset | Number of bytes to move the IO position relative to the starting position specified by pos | |
| pos | Position from which the seek should start |
Implements Exiv2::BasicIo.
| virtual byte* Exiv2::RemoteIo::mmap | ( | bool | = false |
) | [virtual] |
| virtual int Exiv2::RemoteIo::munmap | ( | ) | [virtual] |
| virtual long Exiv2::RemoteIo::tell | ( | ) | const [virtual] |
Get the current IO position.
Implements Exiv2::BasicIo.
| virtual long Exiv2::RemoteIo::size | ( | ) | const [virtual] |
Get the current memory buffer size in bytes.
Implements Exiv2::BasicIo.
| virtual BasicIo::AutoPtr Exiv2::RemoteIo::temporary | ( | ) | const [virtual] |
Returns a temporary data storage location. Currently returns an empty MemIo object, but callers should not rely on this behavior since it may change.
Implements Exiv2::BasicIo.
| virtual void Exiv2::RemoteIo::populateFakeData | ( | ) | [virtual] |
Mark all the bNone blocks to bKnow. This avoids allocating memory for parts of the file that contain image-date (non-metadata/pixel data).
Reimplemented from Exiv2::BasicIo.
1.5.6