Exiv2
Classes | List of all members
Exiv2::HttpIo Class Reference

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

#include <basicio.hpp>

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

Classes

class  HttpImpl
 Internal Pimpl structure of class HttpIo. More...
 

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 failes. More...
 
 HttpIo (HttpIo &rhs)=delete
 Copy constructor.
 
HttpIo & operator= (const HttpIo &rhs)=delete
 Assignment operator.
 
- Public Member Functions inherited from Exiv2::RemoteIo
 ~RemoteIo () override
 Destructor. Releases all managed memory.
 
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...
 
long write (const byte *data, long wcount) override
 Not support this method. More...
 
long 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 (long 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...
 
long read (byte *buf, long rcount) override
 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. 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 (long offset, Position pos) override
 Move the current IO position. More...
 
byte * mmap (bool=false) override
 Not support. More...
 
int munmap () override
 Not support. More...
 
long 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. More...
 
int error () const override
 Always returns 0. More...
 
bool eof () const override
 Returns true if the IO position has reached the end, otherwise false. More...
 
std::string path () const override
 Returns the URL of the file. More...
 
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.
 

Additional Inherited Members

- Public Types inherited from Exiv2::BasicIo
enum  Position { beg , cur , end }
 Seek starting positions.
 
typedef std::unique_ptr< BasicIo > UniquePtr
 BasicIo auto_ptr type.
 
- Public Attributes inherited from Exiv2::BasicIo
byte * bigBlock_ {}
 this is allocated and populated by mmap()
 
- Protected Attributes inherited from Exiv2::RemoteIo
Impl * p_ {nullptr}
 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 failes.

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.

References Exiv2::RemoteIo::p_.


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