Exiv2
List of all members
Exiv2::CurlIo Class Reference

Provides the http, https read/write access and ftp read access for the RemoteIo. This class is based on libcurl. More...

#include <basicio.hpp>

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

Creators

 CurlIo (const std::string &url, size_t blockSize=0)
 Constructor that accepts the URL on which IO will be performed. More...
 
long write (const byte *data, long wcount)
 Write access is only available for some protocols. This method will call RemoteIo::write(const byte* data, long wcount) if the write access is available for the protocol. Otherwise, it throws the Error. More...
 
long write (BasicIo &src)
 Write access is only available for some protocols. This method will call RemoteIo::write(BasicIo& src) if the write access is available for the protocol. Otherwise, it throws the Error. More...
 
 CurlIo (CurlIo &rhs)
 Copy constructor.
 
CurlIooperator= (const CurlIo &rhs)
 Assignment operator.
 
virtual ~CurlIo ()
 Default Destructor.
 

Additional Inherited Members

- Public Types inherited from Exiv2::BasicIo
enum  Position { beg , cur , end }
 Seek starting positions.
 
typedef std::auto_ptr< BasicIoAutoPtr
 BasicIo auto_ptr type.
 
- Public Member Functions inherited from Exiv2::RemoteIo
virtual ~RemoteIo ()
 Destructor. Releases all managed memory.
 
virtual int open ()
 Connect to the remote server, get the size of the remote file and allocate the array of blocksMap. More...
 
virtual int close ()
 Reset the IO position to the start. It does not release the data. More...
 
virtual int putb (byte data)
 Not support. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void transfer (BasicIo &src)
 Remove the contents of the file and then transfer data from the src BasicIo object into the empty file. More...
 
virtual int seek (long offset, Position pos)
 Move the current IO position. More...
 
virtual bytemmap (bool=false)
 Not support. More...
 
virtual int munmap ()
 Not support. More...
 
virtual long tell () const
 Get the current IO position. More...
 
virtual size_t size () const
 Get the current memory buffer size in bytes. More...
 
virtual bool isopen () const
 Returns true if the memory area is allocated. More...
 
virtual int error () const
 Always returns 0. More...
 
virtual bool eof () const
 Returns true if the IO position has reached the end, otherwise false. More...
 
virtual std::string path () const
 Returns the URL of the file. More...
 
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) More...
 
- Public Member Functions inherited from Exiv2::BasicIo
virtual ~BasicIo ()
 Destructor.
 
- Public Attributes inherited from Exiv2::BasicIo
bytebigBlock_
 this is allocated and populated by mmap()
 
- Protected Member Functions inherited from Exiv2::RemoteIo
 RemoteIo ()
 Default Constructor.
 
- Protected Member Functions inherited from Exiv2::BasicIo
 BasicIo ()
 Default Constructor.
 
- Protected Attributes inherited from Exiv2::RemoteIo
Implp_
 Pointer to implementation.
 

Detailed Description

Provides the http, https read/write access and ftp read access for the RemoteIo. This class is based on libcurl.

Constructor & Destructor Documentation

◆ CurlIo()

Exiv2::CurlIo::CurlIo ( const std::string &  url,
size_t  blockSize = 0 
)

Constructor that accepts the URL on which IO will be performed.

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.
Exceptions
Errorif it is unable to init curl pointer.

Member Function Documentation

◆ write() [1/2]

long Exiv2::CurlIo::write ( BasicIo src)
virtual

Write access is only available for some protocols. This method will call RemoteIo::write(BasicIo& src) if the write access is available for the protocol. Otherwise, it throws the Error.

Reimplemented from Exiv2::RemoteIo.

◆ write() [2/2]

long Exiv2::CurlIo::write ( const byte data,
long  wcount 
)
virtual

Write access is only available for some protocols. This method will call RemoteIo::write(const byte* data, long wcount) if the write access is available for the protocol. Otherwise, it throws the Error.

Reimplemented from Exiv2::RemoteIo.


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