fw4spl
IWriter.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "fwIO/config.hpp"
10 #include "fwIO/ioTypes.hpp"
11 
12 #include <fwServices/IService.hpp>
13 
14 #include <boost/filesystem/path.hpp>
15 
16 namespace fwIO
17 {
18 
33 class FWIO_CLASS_API IWriter : public ::fwServices::IService
34 {
35 
36 public:
38 
39 
43  FWIO_API static const ::fwCom::Slots::SlotKeyType s_SET_FILE_FOLDER;
45 
52  FWIO_API virtual void configureWithIHM() = 0;
53 
62  FWIO_API virtual ::fwIO::IOPathType getIOPathType() const;
63 
69  FWIO_API const ::boost::filesystem::path& getFile() const;
70 
75  FWIO_API void setFile(const ::boost::filesystem::path& file);
76 
82  FWIO_API const ::fwIO::LocationsType& getFiles() const;
83 
88  FWIO_API void setFiles(const ::fwIO::LocationsType& files);
89 
95  FWIO_API const ::boost::filesystem::path& getFolder() const;
96 
100  FWIO_API void clearLocations();
101 
106  FWIO_API const ::fwIO::LocationsType& getLocations() const;
107 
112  FWIO_API void setFolder(const ::boost::filesystem::path& folder);
113 
120  FWIO_API void setFileFolder(::boost::filesystem::path folder);
121 
123  FWIO_API bool hasLocationDefined() const;
124 
125 protected:
126 
127  FWIO_API IWriter() noexcept;
128 
129  FWIO_API virtual ~IWriter() noexcept;
130 
166  FWIO_API virtual void configuring() override;
167 
171  std::string m_windowTitle;
172 
173 private:
174 
176  ::fwIO::LocationsType m_locations;
177 };
178 
179 } //namespace fwIO
Base class for all services.
Definition: IService.hpp:61
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
STL namespace.
IOPathType
IOPathType defines different type of paths used by service readers/writers.
Definition: ioTypes.hpp:19
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Writer service API. It manages extension points definition and extension configuration.
Definition: IWriter.hpp:33
The namespace fwIO contains the base interface for reader and writer services.
Definition: ioTypes.hpp:16
std::vector< ::boost::filesystem::path > LocationsType
List of paths managed by io services.
Definition: ioTypes.hpp:28