fw4spl
WriteZipArchive.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_WRITEZIPARCHIVE_HPP__
8 #define __FWZIP_WRITEZIPARCHIVE_HPP__
9 
10 #include "fwZip/config.hpp"
11 #include "fwZip/IWriteArchive.hpp"
12 
13 #include <fwCore/macros.hpp>
14 
15 #include <boost/filesystem/path.hpp>
16 
17 #include <ostream>
18 
19 namespace fwZip
20 {
21 
25 class FWZIP_CLASS_API WriteZipArchive : public IWriteArchive
26 {
27 
28 public:
29 
31  ((( const ::boost::filesystem::path& ))((const std::string&)(""))),
32  std::make_shared<WriteZipArchive> );
33 
38  FWZIP_API WriteZipArchive( const ::boost::filesystem::path& archive );
39 
44  FWZIP_API WriteZipArchive( const ::boost::filesystem::path& archive, const std::string& comment );
45 
46  FWZIP_API ~WriteZipArchive();
47 
56  FWZIP_API SPTR(std::ostream) createFile(const ::boost::filesystem::path &path) override;
57 
65  FWZIP_API void putFile(const ::boost::filesystem::path& sourceFile,
66  const ::boost::filesystem::path& path) override;
67 
74  FWZIP_API bool createDir(const ::boost::filesystem::path& path) override;
75 
79  FWZIP_API const ::boost::filesystem::path getArchivePath() const override;
80 
81 protected:
82 
83  ::boost::filesystem::path m_archive;
84 
85  std::string m_comment;
86 };
87 
88 }
89 
90 #endif /* __FWZIP_WRITEZIPARCHIVE_HPP__ */
91 
#define SPTR(_cls_)
This interface defines functions to write a file in an archive.
STL namespace.
This file defines fwCore base macros.
This class defines functions to write a file in a zip archive.
#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