fw4spl
ReadDirArchive.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWZIP_READDIRARCHIVE_HPP__
8 #define __FWZIP_READDIRARCHIVE_HPP__
9 
10 #include "fwZip/config.hpp"
11 #include "fwZip/IReadArchive.hpp"
12 
13 #include <fwCore/macros.hpp>
14 
15 #include <boost/filesystem/path.hpp>
16 
17 #include <fstream>
18 
19 namespace fwZip
20 {
21 
25 class FWZIP_CLASS_API ReadDirArchive : public IReadArchive
26 {
27 
28 public:
29 
31  ((( const ::boost::filesystem::path& ))),
32  std::make_shared< ReadDirArchive >)
33 
34 
35  FWZIP_API ReadDirArchive( const ::boost::filesystem::path& archive );
36 
38  FWZIP_API ~ReadDirArchive();
39 
47  FWZIP_API SPTR(std::istream) getFile(const ::boost::filesystem::path &path) override;
48 
52  FWZIP_API const ::boost::filesystem::path getArchivePath() const override;
53 
54  //------------------------------------------------------------------------------
55 
56  IReadArchive::sptr clone() const override
57  {
58  return ReadDirArchive::New(m_archive);
59  }
60 
61 protected:
62 
63  ::boost::filesystem::path m_archive;
64 };
65 
66 }
67 
68 #endif /* __FWZIP_READDIRARCHIVE_HPP__ */
69 
#define SPTR(_cls_)
STL namespace.
This file defines fwCore base macros.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
The namespace fwZip provides IO for compress/uncompress .zip files using zlib .
Definition: Read.hpp:14
This interface defines functions to read a file in an archive.
This class defines functions to read a file in a file system archive.