![]() |
XRootD
|
#include <XrdClZipArchive.hh>
Public Member Functions | |
ZipArchive (bool enablePlugIns=true) | |
Constructor. More... | |
virtual | ~ZipArchive () |
Destructor. More... | |
XRootDStatus | AppendFile (const std::string &fn, uint32_t crc32, uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
XRootDStatus | CloseArchive (ResponseHandler *handler, uint16_t timeout=0) |
Create the central directory at the end of ZIP archive and close it. More... | |
XRootDStatus | CloseFile () |
XRootDStatus | GetCRC32 (const std::string &fn, uint32_t &cksum) |
File & | GetFile () |
Get the underlying File object. More... | |
XRootDStatus | GetOffset (const std::string &fn, uint64_t &offset) |
bool | GetProperty (const std::string &name, std::string &value) |
Get property on the underlying File object. More... | |
bool | IsOpen () |
bool | IsSecure () |
Check if the underlying file is using an encrypted connection. More... | |
XRootDStatus | List (DirectoryList *&list) |
XRootDStatus | OpenArchive (const std::string &url, OpenFlags::Flags flags, ResponseHandler *handler, uint16_t timeout=0) |
XRootDStatus | OpenFile (const std::string &fn, OpenFlags::Flags flags=OpenFlags::None, uint64_t size=0, uint32_t crc32=0) |
XRootDStatus | PgRead (uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
XRootDStatus | PgReadFrom (const std::string &fn, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
XRootDStatus | Read (uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
XRootDStatus | ReadFrom (const std::string &fn, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
bool | SetProperty (const std::string &name, const std::string &value) |
Set property on the underlying File object. More... | |
XRootDStatus | Stat (const std::string &fn, StatInfo *&info) |
XRootDStatus | Stat (StatInfo *&info) |
XRootDStatus | UpdateMetadata (uint32_t crc32) |
XRootDStatus | Write (uint32_t size, const void *buffer, ResponseHandler *handler, uint16_t timeout=0) |
Friends | |
class | ::MicroTest |
class | ::XrdEcTests |
template<typename RSP > | |
XRootDStatus | ReadFromImpl (ZipArchive &, const std::string &, uint64_t, uint32_t, void *, ResponseHandler *, uint16_t) |
template<bool > | |
class | XrdEc::OpenOnlyImpl |
class | XrdEc::Reader |
class | XrdEc::StrmWriter |
Definition at line 60 of file XrdClZipArchive.hh.
XrdCl::ZipArchive::ZipArchive | ( | bool | enablePlugIns = true | ) |
Constructor.
Definition at line 208 of file XrdClZipArchive.cc.
|
virtual |
XRootDStatus XrdCl::ZipArchive::AppendFile | ( | const std::string & | fn, |
uint32_t | crc32, | ||
uint32_t | size, | ||
const void * | buffer, | ||
ResponseHandler * | handler, | ||
uint16_t | timeout = 0 |
||
) |
Create a new file in the ZIP archive and append the data
fn | : the name of the new file to be created |
crc32 | : the crc32 of the file |
size | : the size of the file |
buffer | : the buffer with the data |
handler | : user callback |
timeout | : operation timeout |
Definition at line 877 of file XrdClZipArchive.cc.
References XrdCl::Log::Dump(), XrdCl::errInvalidOp, XrdCl::DefaultEnv::GetLog(), XrdCl::stError, and XrdCl::ZipMsg.
XRootDStatus XrdCl::ZipArchive::CloseArchive | ( | ResponseHandler * | handler, |
uint16_t | timeout = 0 |
||
) |
Create the central directory at the end of ZIP archive and close it.
handler | : user callback |
timeout | : operation timeout |
Definition at line 604 of file XrdClZipArchive.cc.
References XrdCl::Async(), XrdCl::Checkpoint(), XrdCl::Close(), XrdCl::COMMIT, XrdCl::Log::Dump(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), XrdCl::ResponseHandler::HandleResponse(), XrdCl::Status::IsOK(), XrdCl::Utils::SplitChunks(), XrdCl::Status::ToString(), XrdCl::VectorWrite(), XrdCl::Write(), and XrdCl::ZipMsg.
|
inline |
Close an open file within the ZIP archive
Definition at line 339 of file XrdClZipArchive.hh.
References XrdCl::errInvalidOp, and XrdCl::stError.
|
inline |
Get crc32 for a given file
fn | : file name |
cksum | : output parameter |
Definition at line 278 of file XrdClZipArchive.hh.
References XrdCl::errInvalidOp, XrdCl::errNotFound, and XrdCl::stError.
|
inline |
Get the underlying File object.
Definition at line 390 of file XrdClZipArchive.hh.
|
inline |
Definition at line 290 of file XrdClZipArchive.hh.
References XrdZip::CDFH::compressedSize, XrdZip::CDFH::compressionMethod, XrdCl::errInvalidOp, XrdCl::errNotFound, XrdCl::errNotSupported, XrdZip::CDFH::extra, XrdZip::CDFH::GetOffset(), XrdZip::DataDescriptor::GetSize(), XrdZip::CDFH::HasDataDescriptor(), XrdZip::CDFH::IsZIP64(), and XrdCl::stError.
|
inline |
Get property on the underlying File object.
Definition at line 382 of file XrdClZipArchive.hh.
|
inline |
Definition at line 358 of file XrdClZipArchive.hh.
Referenced by XrdCl::ZipListHandler::HandleResponse().
|
inline |
Check if the underlying file is using an encrypted connection.
Definition at line 366 of file XrdClZipArchive.hh.
XRootDStatus XrdCl::ZipArchive::List | ( | DirectoryList *& | list | ) |
List files in the ZIP archive
Definition at line 720 of file XrdClZipArchive.cc.
References XrdCl::DirectoryList::Add(), XrdCl::errInvalidOp, XrdZip::CDFH::extra, XrdZip::CDFH::filename, XrdCl::URL::GetHostId(), XrdCl::URL::GetPath(), XrdCl::File::GetProperty(), XrdCl::DirectoryList::SetParentName(), XrdCl::File::Stat(), XrdCl::stError, and XrdZip::CDFH::uncompressedSize.
Referenced by XrdCl::ZipListHandler::HandleResponse().
XRootDStatus XrdCl::ZipArchive::OpenArchive | ( | const std::string & | url, |
OpenFlags::Flags | flags, | ||
ResponseHandler * | handler, | ||
uint16_t | timeout = 0 |
||
) |
Open ZIP Archive (and parse the Central Directory)
url | : the URL of the ZIP archive |
flags | : open flags to be used when openning the file |
handler | : user callback |
timeout | : operation timeout |
Definition at line 266 of file XrdClZipArchive.cc.
References XrdCl::Async(), XrdCl::Log::Debug(), XrdCl::Log::Dump(), XrdZip::EOCD::eocdBaseSize, XrdCl::errDataError, XrdCl::errInvalidOp, XrdCl::Log::Error(), XrdZip::EOCD::Find(), XrdCl::DefaultEnv::GetLog(), XrdCl::ResponseHandler::HandleResponse(), XrdCl::Status::IsOK(), XrdZip::EOCD::maxCommentLength, XrdCl::Open(), XrdZip::CDFH::Parse(), XrdCl::Read(), XrdCl::Pipeline::Repeat(), XrdCl::stError, XrdCl::Pipeline::Stop(), XrdCl::Status::ToString(), XrdZip::ZIP64_EOCDL::zip64EocdlSign, XrdZip::ZIP64_EOCDL::zip64EocdlSize, XrdZip::ZIP64_EOCD::zip64EocdSign, and XrdCl::ZipMsg.
XRootDStatus XrdCl::ZipArchive::OpenFile | ( | const std::string & | fn, |
OpenFlags::Flags | flags = OpenFlags::None , |
||
uint64_t | size = 0 , |
||
uint32_t | crc32 = 0 |
||
) |
Open a file within the ZIP Archive
fn | : file name to be opened |
flags | : open flags (either 'Read' or 'New | Write') |
size | : file size (to be included in the LFH) |
crc32 | : file crc32 (to be included in the LFH) |
Definition at line 489 of file XrdClZipArchive.cc.
References XrdCl::Log::Dump(), XrdCl::errInvalidOp, XrdCl::errNotFound, XrdCl::DefaultEnv::GetLog(), XrdCl::File::IsOpen(), XrdCl::OpenFlags::New, XrdCl::stError, and XrdCl::ZipMsg.
|
inline |
PgRead data from an open file
offset | : offset within the file to read at |
size | : number of bytes to be read |
buffer | : the buffer for the data |
handler | : user callback |
timeout | : operation timeout |
Definition at line 143 of file XrdClZipArchive.hh.
References XrdCl::errInvalidOp, XrdCl::Operation< HasHndl >::handler, XrdCl::stError, and XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::timeout.
XRootDStatus XrdCl::ZipArchive::PgReadFrom | ( | const std::string & | fn, |
uint64_t | offset, | ||
uint32_t | size, | ||
void * | buffer, | ||
ResponseHandler * | handler, | ||
uint16_t | timeout = 0 |
||
) |
PgRead data from a given file
fn | : the name of the file from which we are going to read |
offset | : offset within the file to read at |
size | : number of bytes to be read |
buffer | : the buffer for the data |
handler | : user callback |
timeout | : operation timeout |
Definition at line 707 of file XrdClZipArchive.cc.
|
inline |
Read data from an open file
offset | : offset within the file to read at |
size | : number of bytes to be read |
buffer | : the buffer for the data |
handler | : user callback |
timeout | : operation timeout |
Definition at line 122 of file XrdClZipArchive.hh.
References XrdCl::errInvalidOp, XrdCl::Operation< HasHndl >::handler, XrdCl::ReadFrom(), XrdCl::stError, and XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::timeout.
XRootDStatus XrdCl::ZipArchive::ReadFrom | ( | const std::string & | fn, |
uint64_t | offset, | ||
uint32_t | size, | ||
void * | buffer, | ||
ResponseHandler * | handler, | ||
uint16_t | timeout = 0 |
||
) |
Read data from a given file
fn | : the name of the file from which we are going to read |
offset | : offset within the file to read at |
size | : number of bytes to be read |
buffer | : the buffer for the data |
handler | : user callback |
timeout | : operation timeout |
Definition at line 694 of file XrdClZipArchive.cc.
|
inline |
Set property on the underlying File object.
Definition at line 374 of file XrdClZipArchive.hh.
|
inline |
Get stat info for given file
fn | : the name of the file |
info | : output parameter |
Definition at line 242 of file XrdClZipArchive.hh.
References XrdCl::errInvalidOp, XrdCl::errNotFound, and XrdCl::stError.
|
inline |
Get stat info for an open file
info | : output parameter |
Definition at line 264 of file XrdClZipArchive.hh.
References XrdCl::errInvalidOp, XrdCl::Stat(), and XrdCl::stError.
XRootDStatus XrdCl::ZipArchive::UpdateMetadata | ( | uint32_t | crc32 | ) |
Update the metadata of the currently open file
crc32 | : the crc32 checksum |
Definition at line 849 of file XrdClZipArchive.cc.
References XrdCl::errInvalidOp, and XrdCl::stError.
|
inline |
Append data to a new file
size | : number of bytes to be appended |
buffer | : the buffer with the data to be appended |
handler | : user callback |
timeout | : operation timeout |
Definition at line 198 of file XrdClZipArchive.hh.
References XrdCl::errInvalidOp, XrdCl::Operation< HasHndl >::handler, XrdCl::stError, and XrdCl::ConcreteOperation< Derived, HasHndl, HdlrFactory, Args >::timeout.
|
friend |
Definition at line 66 of file XrdClZipArchive.hh.
|
friend |
Definition at line 67 of file XrdClZipArchive.hh.
|
friend |
Definition at line 44 of file XrdClZipArchive.cc.
|
friend |
Definition at line 65 of file XrdClZipArchive.hh.
|
friend |
Definition at line 63 of file XrdClZipArchive.hh.
|
friend |
Definition at line 62 of file XrdClZipArchive.hh.