Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 (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 MITKMIMETYPE_H
14 #define MITKMIMETYPE_H
15 
16 #include <MitkCoreExports.h>
17 
18 #include <usSharedData.h>
19 
20 #include <vector>
21 
22 namespace mitk
23 {
24  class CustomMimeType;
25 
37  {
38  public:
39  MimeType();
40  MimeType(const MimeType &other);
41  MimeType(const CustomMimeType &x, int rank, long id);
42 
43  ~MimeType();
44 
45  MimeType &operator=(const MimeType &other);
46  bool operator==(const MimeType &other) const;
47 
48  bool operator<(const MimeType &other) const;
49 
51  std::string GetName() const;
52 
54  std::string GetCategory() const;
55 
57  std::vector<std::string> GetExtensions() const;
58 
60  std::string GetComment() const;
61 
63  std::string GetFilenameWithoutExtension(const std::string &path) const;
64 
66  bool AppliesTo(const std::string &path) const;
67 
69  bool MatchesExtension(const std::string &path) const;
70 
72  bool IsValid() const;
73 
75  void Swap(MimeType &m);
76 
77  private:
78  struct Impl;
79 
80  // Use C++11 shared_ptr instead
82  };
83 
84  MITKCORE_EXPORT void swap(MimeType &m1, MimeType &m2);
85 
86  MITKCORE_EXPORT std::ostream &operator<<(std::ostream &os, const MimeType &mimeType);
87 }
88 
89 #endif // MITKMIMETYPE_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.
MITKCORE_EXPORT std ::ostream & operator<<(std ::ostream &o, DataNode::Pointer &dtn)
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:36
static std::string GetName(std::string fileName, std::string suffix)