fw4spl
Writer.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
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 __FWATOMSBOOSTIO_WRITER_HPP__
8 #define __FWATOMSBOOSTIO_WRITER_HPP__
9 
10 #include <sstream>
11 
12 #include <boost/filesystem/path.hpp>
13 
14 #include <fwCore/macros.hpp>
15 
16 #include "fwAtomsBoostIO/types.hpp"
17 #include "fwAtomsBoostIO/config.hpp"
18 
19 namespace fwAtoms
20 {
21 class Base;
22 }
23 namespace fwZip
24 {
25 class IWriteArchive;
26 }
27 
28 namespace fwAtomsBoostIO
29 {
30 
31 class FWATOMSBOOSTIO_CLASS_API Writer
32 {
33 
34 public:
35 
37  FWATOMSBOOSTIO_API static const std::string s_VERSION;
38 
40  FWATOMSBOOSTIO_API static const std::string s_ATOMS_VERSION_KEY;
41 
43  FWATOMSBOOSTIO_API static const std::string s_WRITER_VERSION_KEY;
44 
45  Writer(const SPTR(::fwAtoms::Base)& atom) : m_atom(atom)
46  {
47  }
48 
49  FWATOMSBOOSTIO_API void write( const SPTR(::fwZip::IWriteArchive)& archive,
50  const ::boost::filesystem::path& rootFilename = "root.json",
51  FormatType format = JSON ) const;
52 
53 protected:
54 
55  SPTR(::fwAtoms::Base) m_atom;
56 
57 };
58 
59 }
60 
61 #endif /* __FWATOMSBOOSTIO_WRITER_HPP__ */
62 
#define SPTR(_cls_)
fwAtoms contains basic objects to represent any other kind of object
The namespace fwAtomsBoostIO contains atom reader and writer.
This interface defines functions to write a file in an archive.
This file defines fwCore base macros.
static FWATOMSBOOSTIO_API const std::string s_ATOMS_VERSION_KEY
Defines key to retrieve fwAtoms version from file.
Definition: Writer.hpp:40
static FWATOMSBOOSTIO_API const std::string s_WRITER_VERSION_KEY
Defines key to retrieve writer version from file.
Definition: Writer.hpp:43
static FWATOMSBOOSTIO_API const std::string s_VERSION
Defines writer version.
Definition: Writer.hpp:37
The namespace fwZip provides IO for compress/uncompress .zip files using zlib .
Definition: Read.hpp:14
Base class for all Atom classes.