Exiv2
Public Member Functions | Public Attributes | List of all members
Exiv2::HttpIo::HttpImpl Class Reference

Internal Pimpl structure of class HttpIo. More...

Inheritance diagram for Exiv2::HttpIo::HttpImpl:
Inheritance graph
[legend]

Public Member Functions

 HttpImpl (const std::string &url, size_t blockSize)
 Constructor.
 
int64_t getFileLength () override
 Get the length (in bytes) of the remote file. More...
 
void getDataByRange (size_t lowBlock, size_t highBlock, std::string &response) override
 Get the data by range. More...
 
void writeRemote (const byte *data, size_t size, size_t from, size_t to) override
 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...
 
- Public Member Functions inherited from Exiv2::RemoteIo::Impl
 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 size_t populateBlocks (size_t lowBlock, size_t highBlock)
 Get the data from the remote machine and write them to the memory blocks. More...
 

Public Attributes

Exiv2::Uri hostInfo_
 the host information extracted from the path
 
- Public Attributes inherited from Exiv2::RemoteIo::Impl
std::string path_
 (Standard) path
 
size_t blockSize_
 Size of the block memory.
 
BlockMapblocksMap_ {nullptr}
 An array contains all blocksMap.
 
size_t size_ {0}
 The file size.
 
size_t idx_ {0}
 Index into the memory area.
 
bool isMalloced_ {false}
 Was the blocksMap_ allocated?
 
bool eof_ {false}
 EOF indicator.
 
Protocol protocol_
 the protocol of url
 
size_t totalRead_ {0}
 bytes requested from host
 

Detailed Description

Internal Pimpl structure of class HttpIo.

Member Function Documentation

void Exiv2::HttpIo::HttpImpl::getDataByRange ( size_t  lowBlock,
size_t  highBlock,
std::string &  response 
)
overridevirtual

Get the data by range.

Parameters
lowBlockThe start block index.
highBlockThe end block index.
responseThe data from the server.
Exceptions
Errorif the server returns the error code.
Note
Set lowBlock = -1 and highBlock = -1 to get the whole file content.

Implements Exiv2::RemoteIo::Impl.

References Exiv2::http(), and Exiv2::Internal::stringFormat().

int64_t Exiv2::HttpIo::HttpImpl::getFileLength ( )
overridevirtual

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.

Implements Exiv2::RemoteIo::Impl.

References Exiv2::http(), and Exiv2::Internal::stringFormat().

void Exiv2::HttpIo::HttpImpl::writeRemote ( const byte data,
size_t  size,
size_t  from,
size_t  to 
)
overridevirtual

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 data are submitted to the remote machine via POST. This requires the script file on the remote machine to receive the data and edit the remote file. The server-side script may be specified with the environment string EXIV2_HTTP_POST. The default value is "/exiv2.php". More info is available at http://dev.exiv2.org/wiki/exiv2
Exceptions
Errorif it fails.

Implements Exiv2::RemoteIo::Impl.

References Exiv2::base64encode(), Exiv2::getEnv(), Exiv2::Uri::Host, Exiv2::http(), Exiv2::Uri::Parse(), Exiv2::Uri::Path, Exiv2::Uri::Port, Exiv2::Internal::stringFormat(), and Exiv2::urlencode().


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