xrootd
|
#include <XrdClZipArchiveReader.hh>
Public Member Functions | |
ZipArchiveReader (File &archive) | |
virtual | ~ZipArchiveReader () |
Destructor. More... | |
XRootDStatus | Open (const std::string &url, ResponseHandler *handler, uint16_t timeout=0) |
XRootDStatus | Open (const std::string &url, uint16_t timeout=0) |
Synchronous open of a given ZIP archive for reading. More... | |
XRootDStatus | Read (const std::string &filename, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
XRootDStatus | Read (const std::string &filename, uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout=0) |
Sync read. More... | |
XRootDStatus | Bind (const std::string &filename) |
Binds the reader to a file inside the archive. More... | |
void | Unbind () |
Unbinds the reader from a file. More... | |
XRootDStatus | Read (uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
Async bound read. More... | |
XRootDStatus | Read (uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout=0) |
Sync bound read. More... | |
XRootDStatus | List (DirectoryList *&list) |
Sync list. More... | |
XRootDStatus | Close (ResponseHandler *handler, uint16_t timeout=0) |
XRootDStatus | Close (uint16_t timeout=0) |
Sync close. More... | |
XRootDStatus | GetSize (const std::string &filename, uint64_t &size) const |
XRootDStatus | GetSize (uint64_t &size) const |
bool | IsOpen () const |
Check if the archive is open. More... | |
XRootDStatus | ZCRC32 (const std::string &filename, std::string &checksum) |
The CRC32 checksum as in the ZIP archive. More... | |
XRootDStatus | ZCRC32 (std::string &checksum) |
The CRC32 checksum as in the ZIP archive (bound version) More... | |
Private Attributes | |
ZipArchiveReaderImpl * | pImpl |
Pointer to the implementation. More... | |
A wrapper class for the XrdCl::File.
It is an abstraction for a ZIP file containing multiple sub-files. The class does not provide any unzip utilities, it just readjusts the offset so a respective file inside of the archive can be read. It is meant for ZIP archives containing uncompressed root files, so a single file can be accessed without downloading the whole archive.
|
virtual |
Destructor.
XRootDStatus XrdCl::ZipArchiveReader::Bind | ( | const std::string & | filename | ) |
Binds the reader to a file inside the archive.
XRootDStatus XrdCl::ZipArchiveReader::Close | ( | ResponseHandler * | handler, |
uint16_t | timeout = 0 |
||
) |
Async close.
handler | : the handler for the async operation |
timeout | : the timeout of the async operation |
XRootDStatus XrdCl::ZipArchiveReader::Close | ( | uint16_t | timeout = 0 | ) |
Sync close.
XRootDStatus XrdCl::ZipArchiveReader::GetSize | ( | const std::string & | filename, |
uint64_t & | size | ||
) | const |
Gets the size of the given file
filename | : the name of the file |
XRootDStatus XrdCl::ZipArchiveReader::GetSize | ( | uint64_t & | size | ) | const |
Gets the size of the bound file
bool XrdCl::ZipArchiveReader::IsOpen | ( | ) | const |
Check if the archive is open.
XRootDStatus XrdCl::ZipArchiveReader::List | ( | DirectoryList *& | list | ) |
Sync list.
XRootDStatus XrdCl::ZipArchiveReader::Open | ( | const std::string & | url, |
ResponseHandler * | handler, | ||
uint16_t | timeout = 0 |
||
) |
Asynchronous open of a given ZIP archive for reading.
During the open, the End-of-central-directory record and the Central-directory-file-headers records are being read and parsed.
If the ZIP archive is smaller than the maximum size of the EOCD record the whole archive is being down- loaded and kept in local memory.
url | : URL of the archive |
handler | : the handler for the async operation |
timeout | : the timeout of the async operation |
XRootDStatus XrdCl::ZipArchiveReader::Open | ( | const std::string & | url, |
uint16_t | timeout = 0 |
||
) |
Synchronous open of a given ZIP archive for reading.
XRootDStatus XrdCl::ZipArchiveReader::Read | ( | const std::string & | filename, |
uint64_t | offset, | ||
uint32_t | size, | ||
void * | buffer, | ||
ResponseHandler * | handler, | ||
uint16_t | timeout = 0 |
||
) |
Async read.
filename | : name of the file that will the readout |
offset | : offset (relative for the given file) |
size | : size of the buffer |
buffer | : the readout buffer |
handler | : the handler for the async operation |
timeout | : the timeout of the async operation |
XRootDStatus XrdCl::ZipArchiveReader::Read | ( | const std::string & | filename, |
uint64_t | offset, | ||
uint32_t | size, | ||
void * | buffer, | ||
uint32_t & | bytesRead, | ||
uint16_t | timeout = 0 |
||
) |
Sync read.
XRootDStatus XrdCl::ZipArchiveReader::Read | ( | uint64_t | offset, |
uint32_t | size, | ||
void * | buffer, | ||
ResponseHandler * | handler, | ||
uint16_t | timeout = 0 |
||
) |
Async bound read.
XRootDStatus XrdCl::ZipArchiveReader::Read | ( | uint64_t | offset, |
uint32_t | size, | ||
void * | buffer, | ||
uint32_t & | bytesRead, | ||
uint16_t | timeout = 0 |
||
) |
Sync bound read.
void XrdCl::ZipArchiveReader::Unbind | ( | ) |
Unbinds the reader from a file.
XRootDStatus XrdCl::ZipArchiveReader::ZCRC32 | ( | const std::string & | filename, |
std::string & | checksum | ||
) |
The CRC32 checksum as in the ZIP archive.
XRootDStatus XrdCl::ZipArchiveReader::ZCRC32 | ( | std::string & | checksum | ) |
The CRC32 checksum as in the ZIP archive (bound version)
|
private |
Pointer to the implementation.