Exiv2::HttpIo Class Reference

Provides the http read/write access for the RemoteIo. More...

#include <basicio.hpp>

Inheritance diagram for Exiv2::HttpIo:

Public Member Functions

Creators
 HttpIo (const std::string &url, size_t blockSize=1024)
 Constructor that accepts the http URL on which IO will be performed. The constructor does not open the file, and therefore never fails. More...
 
- Public Member Functions inherited from Exiv2::RemoteIo
 RemoteIo ()
 Destructor. Releases all managed memory.
 
 RemoteIo (const RemoteIo &)=delete
 
RemoteIooperator= (const RemoteIo &)=delete
 
int open () override
 Connect to the remote server, get the size of the remote file and allocate the array of blocksMap. More...
 
int close () override
 Reset the IO position to the start. It does not release the data. More...
 
size_t write (const byte *data, size_t wcount) override
 Not support this method. More...
 
size_t write (BasicIo &src) override
 Write data that is read from another BasicIo instance to the remote file. More...
 
int putb (byte data) override
 Not support. More...
 
DataBuf read (size_t rcount) override
 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. More...
 
size_t read (byte *buf, size_t rcount) override
 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 (!= bMemory), it will connect to server and populate the data to memory blocks. More...
 
int getb () override
 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. More...
 
void transfer (BasicIo &src) override
 Remove the contents of the file and then transfer data from the src BasicIo object into the empty file. More...
 
int seek (int64_t offset, Position pos) override
 Move the current IO position. More...
 
bytemmap (bool=false) override
 Not support. More...
 
int munmap () override
 Not support. More...
 
size_t tell () const override
 Get the current IO position. More...
 
size_t size () const override
 Get the current memory buffer size in bytes. More...
 
bool isopen () const override
 Returns true if the memory area is allocated.
 
int error () const override
 Always returns 0.
 
bool eof () const override
 Returns true if the IO position has reached the end, otherwise false.
 
const std::string & path () const noexcept override
 Returns the URL of the file.
 
void populateFakeData () override
 Mark all the bNone blocks to bKnow. This avoids allocating memory for parts of the file that contain image-date (non-metadata/pixel data) More...
 
- Public Member Functions inherited from Exiv2::BasicIo
virtual ~BasicIo ()=default
 Destructor.
 
void readOrThrow (byte *buf, size_t rcount, ErrorCode err=ErrorCode::kerCorruptedMetadata)
 Safe version of read() that checks for errors and throws an exception if the read was unsuccessful. More...
 
void seekOrThrow (int64_t offset, Position pos, ErrorCode err)
 Safe version of seek() that checks for errors and throws an exception if the seek was unsuccessful. More...
 

Additional Inherited Members

- Public Types inherited from Exiv2::BasicIo
enum  Position { beg , cur , end }
 Seek starting positions.
 
using UniquePtr = std::unique_ptr< BasicIo >
 BasicIo auto_ptr type.
 
- Public Attributes inherited from Exiv2::BasicIo
bytebigBlock_ {}
 this is allocated and populated by mmap()
 
- Protected Attributes inherited from Exiv2::RemoteIo
std::unique_ptr< Impl > p_
 Pointer to implementation.
 

Detailed Description

Provides the http read/write access for the RemoteIo.

Constructor & Destructor Documentation

◆ HttpIo()

Exiv2::HttpIo::HttpIo ( const std::string &  url,
size_t  blockSize = 1024 
)
explicit

Constructor that accepts the http URL on which IO will be performed. The constructor does not open the file, and therefore never fails.

Parameters
urlThe full path of url
blockSizethe size of the memory block. The file content is divided into the memory blocks. These blocks are populated on demand from the server, so it avoids copying the complete file.

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