Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkFileReader.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef FILEREADER_H_HEADER_INCLUDED_C1E7E521
18 #define FILEREADER_H_HEADER_INCLUDED_C1E7E521
19 
20 #include <MitkCoreExports.h>
21 #include <mitkCommon.h>
22 
23 namespace mitk
24 {
25  //##Documentation
26  //## @brief Interface class of readers that read from files
27  //## @ingroup DeprecatedIO
28  //## @deprecatedSince{2014_10} Use mitk::IFileReader instead.
30  {
31  public:
33 
34  //##Documentation
35  //## @brief Get the specified the file to load.
36  //##
37  //## Either the FileName or FilePrefix plus FilePattern are used to read.
38  virtual const char *GetFileName() const = 0;
39 
40  //##Documentation
41  //## @brief Specify the file to load.
42  //##
43  //## Either the FileName or FilePrefix plus FilePattern are used to read.
44  virtual void SetFileName(const char *aFileName) = 0;
45 
46  //##Documentation
47  //## @brief Get the specified file prefix for the file(s) to load.
48  //##
49  //## You should specify either a FileName or FilePrefix. Use FilePrefix if
50  //## the data is stored in multiple files.
51  virtual const char *GetFilePrefix() const = 0;
52 
53  //##Documentation
54  //## @brief Specify file prefix for the file(s) to load.
55  //##
56  //## You should specify either a FileName or FilePrefix. Use FilePrefix if
57  //## the data is stored in multiple files.
58  virtual void SetFilePrefix(const char *aFilePrefix) = 0;
59 
60  //##Documentation
61  //## @brief Get the specified file pattern for the file(s) to load. The
62  //## sprintf format used to build filename from FilePrefix and number.
63  //##
64  //## You should specify either a FileName or FilePrefix. Use FilePrefix if
65  //## the data is stored in multiple files.
66  virtual const char *GetFilePattern() const = 0;
67 
74  virtual void SetFilePattern(const char *aFilePattern) = 0;
75 
79  virtual bool CanReadFromMemory();
80 
84  virtual void SetReadFromMemory(bool read);
85  virtual bool GetReadFromMemory();
86 
90  virtual void SetMemoryBuffer(const char *dataArray, unsigned int size);
91 
92  protected:
93  FileReader();
94  virtual ~FileReader();
95 
96  bool m_CanReadFromMemory;
97  bool m_ReadFromMemory;
98 
99  const char *m_MemoryBuffer;
100  unsigned int m_MemorySize;
101 
102  public:
103  protected:
104  };
105 } // namespace mitk
106 #endif /* FILEREADER_H_HEADER_INCLUDED_C1E7E521 */
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacroNoParent(className)
Definition: mitkCommon.h:65
Interface class of readers that read from files.