XrdCl::ZipArchiveReader Class Reference

#include <XrdClZipArchiveReader.hh>

List of all members.

Public Member Functions

 ZipArchiveReader (File &archive)
virtual ~ZipArchiveReader ()
 Destructor.
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.
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.
XRootDStatus Bind (const std::string &filename)
 Bounds the reader to a file inside the archive.
XRootDStatus Read (uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0)
 Async bound read.
XRootDStatus Read (uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout=0)
 Sync bound read.
XRootDStatus List (DirectoryList *&list)
 Sync list.
XRootDStatus Close (ResponseHandler *handler, uint16_t timeout=0)
XRootDStatus Close (uint16_t timeout=0)
 Sync close.
XRootDStatus GetSize (const std::string &filename, uint64_t &size) const
bool IsOpen () const
 Check if the archive is open.
XRootDStatus ZCRC32 (const std::string &filename, std::string &checksum)
 The CRC32 checksum as in the ZIP archive.
XRootDStatus ZCRC32 (std::string &checksum)
 The CRC32 checksum as in the ZIP archive (bound version).

Private Attributes

ZipArchiveReaderImpl * pImpl
 Pointer to the implementation.

Detailed Description

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.


Constructor & Destructor Documentation

XrdCl::ZipArchiveReader::ZipArchiveReader ( File archive  ) 

Constructor.

Wraps up the File object

virtual XrdCl::ZipArchiveReader::~ZipArchiveReader (  )  [virtual]

Destructor.


Member Function Documentation

XRootDStatus XrdCl::ZipArchiveReader::Bind ( const std::string &  filename  ) 

Bounds the reader to a file inside the archive.

XRootDStatus XrdCl::ZipArchiveReader::Close ( uint16_t  timeout = 0  ) 

Sync close.

XRootDStatus XrdCl::ZipArchiveReader::Close ( ResponseHandler handler,
uint16_t  timeout = 0 
)

Async close.

Parameters:
handler : the handler for the async operation
timeout : the timeout of the async operation
Returns:
: OK on success, error otherwise
XRootDStatus XrdCl::ZipArchiveReader::GetSize ( const std::string &  filename,
uint64_t &  size 
) const

Gets the size of the given file

Parameters:
filename : the name of the file
Returns:
: the size of the file as in CDFH record
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,
uint16_t  timeout = 0 
)

Synchronous open of a given ZIP archive for reading.

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.

Parameters:
url : URL of the archive
handler : the handler for the async operation
timeout : the timeout of the async operation
Returns:
: OK on success, error otherwise
XRootDStatus XrdCl::ZipArchiveReader::Read ( uint64_t  offset,
uint32_t  size,
void *  buffer,
uint32_t &  bytesRead,
uint16_t  timeout = 0 
)

Sync bound 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 ( 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 ( const std::string &  filename,
uint64_t  offset,
uint32_t  size,
void *  buffer,
ResponseHandler handler,
uint16_t  timeout = 0 
)

Async read.

Parameters:
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
Returns:
: OK on success, error otherwise
XRootDStatus XrdCl::ZipArchiveReader::ZCRC32 ( std::string &  checksum  ) 

The CRC32 checksum as in the ZIP archive (bound version).

XRootDStatus XrdCl::ZipArchiveReader::ZCRC32 ( const std::string &  filename,
std::string &  checksum 
)

The CRC32 checksum as in the ZIP archive.


Member Data Documentation

ZipArchiveReaderImpl* XrdCl::ZipArchiveReader::pImpl [private]

Pointer to the implementation.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 17 Dec 2019 for xrootd by  doxygen 1.6.1