xrootd
XrdClZipArchiveReader.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// Copyright (c) 2011-2014 by European Organization for Nuclear Research (CERN)
3// Author: Michal Simon <michal.simon@cern.ch>
4//------------------------------------------------------------------------------
5// This file is part of the XRootD software suite.
6//
7// XRootD is free software: you can redistribute it and/or modify
8// it under the terms of the GNU Lesser General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// XRootD is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU Lesser General Public License
18// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
19//
20// In applying this licence, CERN does not waive the privileges and immunities
21// granted to it by virtue of its status as an Intergovernmental Organization
22// or submit itself to any jurisdiction.
23//------------------------------------------------------------------------------
24
25#ifndef SRC_XRDCL_XRDCLZIPARCHIVEREADER_HH_
26#define SRC_XRDCL_XRDCLZIPARCHIVEREADER_HH_
27
29
30namespace XrdCl
31{
32
33class ZipArchiveReaderImpl;
34class File;
35
36//----------------------------------------------------------------------------
45//----------------------------------------------------------------------------
47{
48 public:
49
50 //------------------------------------------------------------------------
54 //------------------------------------------------------------------------
56
57 //------------------------------------------------------------------------
59 //------------------------------------------------------------------------
61
62 //------------------------------------------------------------------------
78 //------------------------------------------------------------------------
79 XRootDStatus Open( const std::string &url, ResponseHandler *handler, uint16_t timeout = 0 );
80
81 //------------------------------------------------------------------------
83 //------------------------------------------------------------------------
84 XRootDStatus Open( const std::string &url, uint16_t timeout = 0 );
85
86 //------------------------------------------------------------------------
97 //------------------------------------------------------------------------
98 XRootDStatus Read( const std::string &filename, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout = 0 );
99
100 //------------------------------------------------------------------------
102 //------------------------------------------------------------------------
103 XRootDStatus Read( const std::string &filename, uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout = 0 );
104
105 //------------------------------------------------------------------------
107 //------------------------------------------------------------------------
108 XRootDStatus Bind( const std::string &filename );
109
110 //------------------------------------------------------------------------
112 //------------------------------------------------------------------------
113 XRootDStatus Read( uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout = 0 );
114
115 //------------------------------------------------------------------------
117 //------------------------------------------------------------------------
118 XRootDStatus Read( uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout = 0 );
119
120 //------------------------------------------------------------------------
122 //------------------------------------------------------------------------
124
125 //------------------------------------------------------------------------
132 //------------------------------------------------------------------------
133 XRootDStatus Close( ResponseHandler *handler, uint16_t timeout = 0 );
134
135 //------------------------------------------------------------------------
137 //------------------------------------------------------------------------
138 XRootDStatus Close( uint16_t timeout = 0 );
139
140 //------------------------------------------------------------------------
146 //------------------------------------------------------------------------
147 XRootDStatus GetSize( const std::string &filename, uint64_t &size ) const;
148
149 //------------------------------------------------------------------------
151 //------------------------------------------------------------------------
152 bool IsOpen() const;
153
154 //------------------------------------------------------------------------
156 //------------------------------------------------------------------------
157 XRootDStatus ZCRC32( const std::string &filename, std::string &checksum );
158
159 //------------------------------------------------------------------------
161 //------------------------------------------------------------------------
162 XRootDStatus ZCRC32( std::string &checksum );
163
164 private:
165
166 //------------------------------------------------------------------------
168 //------------------------------------------------------------------------
169 ZipArchiveReaderImpl *pImpl;
170};
171
172} /* namespace XrdCl */
173
174#endif /* SRC_XRDCL_XRDCLZIPARCHIVEREADER_HH_ */
Directory list.
Definition: XrdClXRootDResponses.hh:511
A file.
Definition: XrdClFile.hh:45
Handle an async response.
Definition: XrdClXRootDResponses.hh:855
Request status.
Definition: XrdClXRootDResponses.hh:213
Definition: XrdClZipArchiveReader.hh:47
ZipArchiveReaderImpl * pImpl
Pointer to the implementation.
Definition: XrdClZipArchiveReader.hh:169
XRootDStatus ZCRC32(const std::string &filename, std::string &checksum)
The CRC32 checksum as in the ZIP archive.
bool IsOpen() const
Check if the archive is open.
XRootDStatus Open(const std::string &url, uint16_t timeout=0)
Synchronous open of a given ZIP archive for reading.
XRootDStatus Open(const std::string &url, ResponseHandler *handler, uint16_t timeout=0)
virtual ~ZipArchiveReader()
Destructor.
XRootDStatus Read(const std::string &filename, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0)
XRootDStatus Bind(const std::string &filename)
Bounds the reader to a file inside the archive.
XRootDStatus GetSize(const std::string &filename, uint64_t &size) const
XRootDStatus Read(uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout=0)
Sync bound read.
XRootDStatus Read(const std::string &filename, uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout=0)
Sync read.
XRootDStatus List(DirectoryList *&list)
Sync list.
XRootDStatus Close(ResponseHandler *handler, uint16_t timeout=0)
XRootDStatus Close(uint16_t timeout=0)
Sync close.
XRootDStatus ZCRC32(std::string &checksum)
The CRC32 checksum as in the ZIP archive (bound version)
ZipArchiveReader(File &archive)
XRootDStatus Read(uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0)
Async bound read.
Definition: XrdClAnyObject.hh:26