Exiv2
Public Member Functions | Public Attributes | List of all members
Exiv2::RemoteIo::Impl Class Referenceabstract

Internal Pimpl abstract structure of class RemoteIo. More...

Public Member Functions

 Impl (const std::string &url, size_t blockSize)
 Constructor.
 
virtual ~Impl ()
 Destructor. Releases all managed memory.
 
 Impl (const Impl &)=delete
 
Imploperator= (const Impl &)=delete
 
virtual int64_t getFileLength ()=0
 Get the length (in bytes) of the remote file. More...
 
virtual void getDataByRange (size_t startBlock, size_t stopBlock, std::string &response)=0
 Get the data by range. More...
 
virtual void writeRemote (const byte *data, size_t size, size_t from, size_t to)=0
 Submit the data to the remote machine. The data replace a part of the remote file. The replaced part of remote file is indicated by from and to parameters. More...
 
virtual size_t populateBlocks (size_t startBlock, size_t stopBlock)
 Get the data from the remote machine and write them to the memory blocks. More...
 

Public Attributes

std::string path_
 (Standard) path
 
size_t blockSize_
 Size of the block memory.
 
std::vector< BlockMapblocksMap_
 An array contains all blocksMap.
 
size_t size_ {0}
 The file size.
 
size_t idx_ {0}
 Index into the memory area.
 
bool isOpen_ {false}
 Is the IO open?
 
bool eof_ {false}
 EOF indicator.
 
Protocol protocol_
 the protocol of url
 
size_t totalRead_ {0}
 total number of bytes read from host
 

Detailed Description

Internal Pimpl abstract structure of class RemoteIo.

Member Function Documentation

virtual void Exiv2::RemoteIo::Impl::getDataByRange ( size_t  startBlock,
size_t  stopBlock,
std::string &  response 
)
pure virtual

Get the data by range.

Parameters
startBlockThe start block index.
stopBlockThe stop block index.
responseThe data from the server.
Exceptions
Errorif the server returns the error code.
Note
Set startBlock = -1 and stopBlock = -1 to get the whole file content.
virtual int64_t Exiv2::RemoteIo::Impl::getFileLength ( )
pure virtual

Get the length (in bytes) of the remote file.

Returns
Return -1 if the size is unknown. Otherwise it returns the length of remote file (in bytes).
Exceptions
Errorif the server returns the error code.
size_t Exiv2::RemoteIo::Impl::populateBlocks ( size_t  startBlock,
size_t  stopBlock 
)
virtual

Get the data from the remote machine and write them to the memory blocks.

Parameters
startBlockThe start block index.
stopBlockThe stop block index.
Returns
Number of bytes written to the memory block successfully
Exceptions
Errorif it fails.
virtual void Exiv2::RemoteIo::Impl::writeRemote ( const byte data,
size_t  size,
size_t  from,
size_t  to 
)
pure virtual

Submit the data to the remote machine. The data replace a part of the remote file. The replaced part of remote file is indicated by from and to parameters.

Parameters
dataThe data are submitted to the remote machine.
sizeThe size of data.
fromThe start position in the remote file where the data replace.
toThe end position in the remote file where the data replace.
Note
The write access is available on some protocols. HTTP and HTTPS require the script file on the remote machine to handle the data. SSH requires the permission to edit the file.
Exceptions
Errorif it fails.

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