Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef FILEREADER_H_HEADER_INCLUDED_C1E7E521
14 #define FILEREADER_H_HEADER_INCLUDED_C1E7E521
15 
16 #include <MitkCoreExports.h>
17 #include <mitkCommon.h>
18 
19 namespace mitk
20 {
21  //##Documentation
22  //## @brief Interface class of readers that read from files
23  //## @ingroup DeprecatedIO
24  //## @deprecatedSince{2014_10} Use mitk::IFileReader instead.
26  {
27  public:
29 
30  //##Documentation
31  //## @brief Get the specified the file to load.
32  //##
33  //## Either the FileName or FilePrefix plus FilePattern are used to read.
34  virtual const char *GetFileName() const = 0;
35 
36  //##Documentation
37  //## @brief Specify the file to load.
38  //##
39  //## Either the FileName or FilePrefix plus FilePattern are used to read.
40  virtual void SetFileName(const char *aFileName) = 0;
41 
42  //##Documentation
43  //## @brief Get the specified file prefix for the file(s) to load.
44  //##
45  //## You should specify either a FileName or FilePrefix. Use FilePrefix if
46  //## the data is stored in multiple files.
47  virtual const char *GetFilePrefix() const = 0;
48 
49  //##Documentation
50  //## @brief Specify file prefix for the file(s) to load.
51  //##
52  //## You should specify either a FileName or FilePrefix. Use FilePrefix if
53  //## the data is stored in multiple files.
54  virtual void SetFilePrefix(const char *aFilePrefix) = 0;
55 
56  //##Documentation
57  //## @brief Get the specified file pattern for the file(s) to load. The
58  //## sprintf format used to build filename from FilePrefix and number.
59  //##
60  //## You should specify either a FileName or FilePrefix. Use FilePrefix if
61  //## the data is stored in multiple files.
62  virtual const char *GetFilePattern() const = 0;
63 
70  virtual void SetFilePattern(const char *aFilePattern) = 0;
71 
75  virtual bool CanReadFromMemory();
76 
80  virtual void SetReadFromMemory(bool read);
81  virtual bool GetReadFromMemory();
82 
86  virtual void SetMemoryBuffer(const char *dataArray, unsigned int size);
87 
88  protected:
89  FileReader();
90  virtual ~FileReader();
91 
94 
95  const char *m_MemoryBuffer;
96  unsigned int m_MemorySize;
97 
98  public:
99  protected:
100  };
101 } // namespace mitk
102 #endif /* FILEREADER_H_HEADER_INCLUDED_C1E7E521 */
#define MITKCORE_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacroNoParent(className)
Definition: mitkCommon.h:61
unsigned int m_MemorySize
const char * m_MemoryBuffer
Interface class of readers that read from files.