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 
28 #include "XrdClXRootDResponses.hh"
29 
30 namespace XrdCl
31 {
32 
33 class ZipArchiveReaderImpl;
34 class File;
35 
36 //----------------------------------------------------------------------------
45 //----------------------------------------------------------------------------
47 {
48  public:
49 
50  //------------------------------------------------------------------------
54  //------------------------------------------------------------------------
55  ZipArchiveReader( File &archive );
56 
57  //------------------------------------------------------------------------
59  //------------------------------------------------------------------------
60  virtual ~ZipArchiveReader();
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  void Unbind();
114 
115  //------------------------------------------------------------------------
117  //------------------------------------------------------------------------
118  XRootDStatus Read( uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout = 0 );
119 
120  //------------------------------------------------------------------------
122  //------------------------------------------------------------------------
123  XRootDStatus Read( uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout = 0 );
124 
125  //------------------------------------------------------------------------
127  //------------------------------------------------------------------------
128  XRootDStatus List( DirectoryList *&list );
129 
130  //------------------------------------------------------------------------
137  //------------------------------------------------------------------------
138  XRootDStatus Close( ResponseHandler *handler, uint16_t timeout = 0 );
139 
140  //------------------------------------------------------------------------
142  //------------------------------------------------------------------------
143  XRootDStatus Close( uint16_t timeout = 0 );
144 
145  //------------------------------------------------------------------------
151  //------------------------------------------------------------------------
152  XRootDStatus GetSize( const std::string &filename, uint64_t &size ) const;
153 
154  //------------------------------------------------------------------------
158  //------------------------------------------------------------------------
159  XRootDStatus GetSize( uint64_t &size ) const;
160 
161  //------------------------------------------------------------------------
163  //------------------------------------------------------------------------
164  bool IsOpen() const;
165 
166  //------------------------------------------------------------------------
168  //------------------------------------------------------------------------
169  XRootDStatus ZCRC32( const std::string &filename, std::string &checksum );
170 
171  //------------------------------------------------------------------------
173  //------------------------------------------------------------------------
174  XRootDStatus ZCRC32( std::string &checksum );
175 
176  private:
177 
178  //------------------------------------------------------------------------
180  //------------------------------------------------------------------------
181  ZipArchiveReaderImpl *pImpl;
182 };
183 
184 } /* namespace XrdCl */
185 
186 #endif /* SRC_XRDCL_XRDCLZIPARCHIVEREADER_HH_ */
ZipArchiveReader(File &archive)
XRootDStatus Close(ResponseHandler *handler, uint16_t timeout=0)
bool IsOpen() const
Check if the archive is open.
XRootDStatus List(DirectoryList *&list)
Sync list.
XRootDStatus Read(const std::string &filename, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout=0)
Directory list.
Definition: XrdClXRootDResponses.hh:649
XRootDStatus GetSize(const std::string &filename, uint64_t &size) const
void Unbind()
Unbinds the reader from a file.
A file.
Definition: XrdClFile.hh:45
XRootDStatus ZCRC32(const std::string &filename, std::string &checksum)
The CRC32 checksum as in the ZIP archive.
Request status.
Definition: XrdClXRootDResponses.hh:218
Definition: XrdClAnyObject.hh:25
Handle an async response.
Definition: XrdClXRootDResponses.hh:1040
XRootDStatus Open(const std::string &url, ResponseHandler *handler, uint16_t timeout=0)
Definition: XrdClZipArchiveReader.hh:46
ZipArchiveReaderImpl * pImpl
Pointer to the implementation.
Definition: XrdClZipArchiveReader.hh:181
XRootDStatus Bind(const std::string &filename)
Binds the reader to a file inside the archive.
virtual ~ZipArchiveReader()
Destructor.