Medical Imaging Interaction Toolkit  2018.4.99-f51274ea
Medical Imaging Interaction Toolkit
mitkFileReaderSelector.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 MITKFILEREADERSELECTOR_H
14 #define MITKFILEREADERSELECTOR_H
15 
16 #include <mitkIFileReader.h>
17 
18 #include <mitkMimeType.h>
19 
20 #include <usServiceReference.h>
21 
22 #include <string>
23 #include <vector>
24 
25 namespace mitk
26 {
27  class BaseData;
28 
30  {
31  public:
33  {
34  public:
35  Item(const Item &other);
36  ~Item();
37 
38  Item &operator=(const Item &other);
39 
40  IFileReader *GetReader() const;
41  std::string GetDescription() const;
42  IFileReader::ConfidenceLevel GetConfidenceLevel() const;
43  MimeType GetMimeType() const;
44  us::ServiceReference<IFileReader> GetReference() const;
45  long GetServiceId() const;
46 
47  bool operator<(const Item &other) const;
48 
49  private:
50  friend class FileReaderSelector;
51 
52  Item();
53 
54  struct Impl;
56  };
57 
59  FileReaderSelector(const std::string &path);
60 
62 
63  FileReaderSelector &operator=(const FileReaderSelector &other);
64 
65  bool IsEmpty() const;
66 
67  std::vector<MimeType> GetMimeTypes() const;
68 
83  std::vector<Item> Get() const;
84 
85  Item Get(long id) const;
86 
87  Item GetDefault() const;
88  long GetDefaultId() const;
89 
90  Item GetSelected() const;
91  long GetSelectedId() const;
92 
93  bool Select(const Item &item);
94  bool Select(long id);
95 
96  void Swap(FileReaderSelector &fws);
97 
98  private:
99  struct Impl;
101  };
102 
103  void swap(FileReaderSelector &fws1, FileReaderSelector &fws2);
104 }
105 
106 #endif // MITKFILEREADERSELECTOR_H
#define MITKCORE_EXPORT
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two var lists and returns true if the first list&#39;s first item is lower than the second one&#39;s...
DataCollection - Class to facilitate loading/accessing structured data.
ConfidenceLevel
A confidence level describing the confidence of the reader or writer in handling the given data...
Definition: mitkIFileIO.h:45
void swap(CustomMimeType &l, CustomMimeType &r)
The MimeType class represens a registered mime-type. It is an immutable wrapper for mitk::CustomMimeT...
Definition: mitkMimeType.h:36
The common interface for all MITK file readers.