|
|
| CurlIo (const std::string &url, size_t blockSize=0) |
| Constructor that accepts the URL on which IO will be performed.
|
|
size_t | write (const byte *data, size_t wcount) override |
| 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.
|
|
size_t | write (BasicIo &src) override |
| 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.
|
|
| RemoteIo () |
| Destructor. Releases all managed memory.
|
|
| RemoteIo (const RemoteIo &)=delete |
|
RemoteIo & | operator= (const RemoteIo &)=delete |
|
int | open () override |
| Connect to the remote server, get the size of the remote file and allocate the array of blocksMap.
|
|
int | close () override |
| Reset the IO position to the start. It does not release the data.
|
|
size_t | write (const byte *data, size_t wcount) override |
| Not support this method.
|
|
size_t | write (BasicIo &src) override |
| Write data that is read from another BasicIo instance to the remote file.
|
|
int | putb (byte data) override |
| Not support.
|
|
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.
|
|
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.
|
|
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.
|
|
void | transfer (BasicIo &src) override |
| Remove the contents of the file and then transfer data from the src BasicIo object into the empty file.
|
|
int | seek (int64_t offset, Position pos) override |
| Move the current IO position.
|
|
byte * | mmap (bool=false) override |
| Not support.
|
|
int | munmap () override |
| Not support.
|
|
size_t | tell () const override |
| Get the current IO position.
|
|
size_t | size () const override |
| Get the current memory buffer size in bytes.
|
|
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)
|
|
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.
|
|
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.
|
|
Provides the http, https read/write access and ftp read access for the RemoteIo. This class is based on libcurl.