Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkMimeType.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 MITKMIMETYPE_H
18 #define MITKMIMETYPE_H
19 
20 #include <MitkCoreExports.h>
21 
22 #include <usSharedData.h>
23 
24 #include <vector>
25 
26 #ifdef _MSC_VER
27 #pragma warning(push)
28 #pragma warning(disable : 4251)
29 #endif
30 
31 namespace mitk
32 {
33  class CustomMimeType;
34 
46  {
47  public:
48  MimeType();
49  MimeType(const MimeType &other);
50  MimeType(const CustomMimeType &x, int rank, long id);
51 
52  ~MimeType();
53 
54  MimeType &operator=(const MimeType &other);
55  bool operator==(const MimeType &other) const;
56 
57  bool operator<(const MimeType &other) const;
58 
60  std::string GetName() const;
61 
63  std::string GetCategory() const;
64 
66  std::vector<std::string> GetExtensions() const;
67 
69  std::string GetComment() const;
70 
72  std::string GetFilenameWithoutExtension(const std::string &path) const;
73 
75  bool AppliesTo(const std::string &path) const;
76 
78  bool MatchesExtension(const std::string &path) const;
79 
81  bool IsValid() const;
82 
84  void Swap(MimeType &m);
85 
86  private:
87  struct Impl;
88 
89  // Use C++11 shared_ptr instead
91  };
92 
93  void swap(MimeType &m1, MimeType &m2);
94 
95  std::ostream &operator<<(std::ostream &os, const MimeType &mimeType);
96 }
97 
98 #ifdef _MSC_VER
99 #pragma warning(pop)
100 #endif
101 
102 #endif // MITKMIMETYPE_H
#define MITKCORE_EXPORT
MITKCORE_EXPORT std::ostream & operator<<(std::ostream &o, DataNode::Pointer &dtn)
DataCollection - Class to facilitate loading/accessing structured data.
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
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:45
static std::string GetName(std::string fileName, std::string suffix)