00001 //------------------------------------------------------------------------------ 00002 // Copyright (c) 2011-2014 by European Organization for Nuclear Research (CERN) 00003 // Author: Michal Simon <michal.simon@cern.ch> 00004 //------------------------------------------------------------------------------ 00005 // This file is part of the XRootD software suite. 00006 // 00007 // XRootD is free software: you can redistribute it and/or modify 00008 // it under the terms of the GNU Lesser General Public License as published by 00009 // the Free Software Foundation, either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // XRootD is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public License 00018 // along with XRootD. If not, see <http://www.gnu.org/licenses/>. 00019 // 00020 // In applying this licence, CERN does not waive the privileges and immunities 00021 // granted to it by virtue of its status as an Intergovernmental Organization 00022 // or submit itself to any jurisdiction. 00023 //------------------------------------------------------------------------------ 00024 00025 #ifndef SRC_XRDCL_XRDCLZIPARCHIVEREADER_HH_ 00026 #define SRC_XRDCL_XRDCLZIPARCHIVEREADER_HH_ 00027 00028 #include "XrdClXRootDResponses.hh" 00029 00030 namespace XrdCl 00031 { 00032 00033 class ZipArchiveReaderImpl; 00034 class File; 00035 00036 //---------------------------------------------------------------------------- 00045 //---------------------------------------------------------------------------- 00046 class ZipArchiveReader 00047 { 00048 public: 00049 00050 //------------------------------------------------------------------------ 00054 //------------------------------------------------------------------------ 00055 ZipArchiveReader( File &archive ); 00056 00057 //------------------------------------------------------------------------ 00059 //------------------------------------------------------------------------ 00060 virtual ~ZipArchiveReader(); 00061 00062 //------------------------------------------------------------------------ 00078 //------------------------------------------------------------------------ 00079 XRootDStatus Open( const std::string &url, ResponseHandler *handler, uint16_t timeout = 0 ); 00080 00081 //------------------------------------------------------------------------ 00083 //------------------------------------------------------------------------ 00084 XRootDStatus Open( const std::string &url, uint16_t timeout = 0 ); 00085 00086 //------------------------------------------------------------------------ 00097 //------------------------------------------------------------------------ 00098 XRootDStatus Read( const std::string &filename, uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout = 0 ); 00099 00100 //------------------------------------------------------------------------ 00102 //------------------------------------------------------------------------ 00103 XRootDStatus Read( const std::string &filename, uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout = 0 ); 00104 00105 //------------------------------------------------------------------------ 00107 //------------------------------------------------------------------------ 00108 XRootDStatus Bind( const std::string &filename ); 00109 00110 //------------------------------------------------------------------------ 00112 //------------------------------------------------------------------------ 00113 XRootDStatus Read( uint64_t offset, uint32_t size, void *buffer, ResponseHandler *handler, uint16_t timeout = 0 ); 00114 00115 //------------------------------------------------------------------------ 00117 //------------------------------------------------------------------------ 00118 XRootDStatus Read( uint64_t offset, uint32_t size, void *buffer, uint32_t &bytesRead, uint16_t timeout = 0 ); 00119 00120 //------------------------------------------------------------------------ 00122 //------------------------------------------------------------------------ 00123 XRootDStatus List( DirectoryList *&list ); 00124 00125 //------------------------------------------------------------------------ 00132 //------------------------------------------------------------------------ 00133 XRootDStatus Close( ResponseHandler *handler, uint16_t timeout = 0 ); 00134 00135 //------------------------------------------------------------------------ 00137 //------------------------------------------------------------------------ 00138 XRootDStatus Close( uint16_t timeout = 0 ); 00139 00140 //------------------------------------------------------------------------ 00146 //------------------------------------------------------------------------ 00147 XRootDStatus GetSize( const std::string &filename, uint64_t &size ) const; 00148 00149 //------------------------------------------------------------------------ 00151 //------------------------------------------------------------------------ 00152 bool IsOpen() const; 00153 00154 private: 00155 00156 //------------------------------------------------------------------------ 00158 //------------------------------------------------------------------------ 00159 ZipArchiveReaderImpl *pImpl; 00160 }; 00161 00162 } /* namespace XrdCl */ 00163 00164 #endif /* SRC_XRDCL_XRDCLZIPARCHIVEREADER_HH_ */