MeVisLab Toolbox Reference
mlDicomMessageFilter.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
7 
12 //----------------------------------------------------------------------------------
13 
14 #pragma once
15 
17 #include "mlTypeDefs.h"
18 #include <ThirdPartyWarningsDisable.h>
19 #include <string>
20 #include <vector>
21 #include <ThirdPartyWarningsRestore.h>
22 
23 ML_START_NAMESPACE
24 
29 public:
31  typedef std::vector<std::string> DicomMessageListType;
32 
34  DicomMessageFilter(const std::string &filterIdString,
35  const DicomMessageListType &filterSubStrings=DicomMessageListType(),
36  bool useCaseSensitiveFiltering=true):
37  _filterIdString(filterIdString)
38  ,_filterSubStrings(filterSubStrings)
39  ,_useCaseSensitiveFiltering(useCaseSensitiveFiltering)
40  {};
41 
43  virtual ~DicomMessageFilter(){};
44 
46  const std::string& filterIdString() const { return _filterIdString; }
47 
49  bool useCaseSensitiveFiltering() const { return _isFiltered; }
50 
52  bool &useCaseSensitiveFiltering() { return _isFiltered; }
53 
55  bool isFiltered() const { return _isFiltered; }
56 
58  bool &isFiltered() { return _isFiltered; }
59 
61  const DicomMessageListType& filterSubStrings() const { return _filterSubStrings; }
62 
64  DicomMessageListType& filterSubStrings() { return _filterSubStrings; }
65 
67  bool matches(std::string message) const;
68 
69 private:
71  std::string _filterIdString;
72 
74  DicomMessageListType _filterSubStrings;
75 
77  bool _useCaseSensitiveFiltering = false;
78 
80  bool _isFiltered = false;
81 };
82 
83 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLDicomMessageFilter_EXPORT
DLL export macro definition.
Class describing a string id of a message, a set of substrings how it can be found by searching them ...
bool isFiltered() const
Returns true if message shall be filtered / suppressed, otherwise false.
virtual ~DicomMessageFilter()
Virtual destructor.
DicomMessageFilter(const std::string &filterIdString, const DicomMessageListType &filterSubStrings=DicomMessageListType(), bool useCaseSensitiveFiltering=true)
Creates an empty message with no filter features.
DicomMessageListType & filterSubStrings()
Returns the modifiable list of string which must be found in a message to filter it out.
bool & useCaseSensitiveFiltering()
Returns true if message is be filtered case sensitively, otherwise false.
bool matches(std::string message) const
Returns false if none of filterSubStrings() can be found in message, otherwise true.
bool useCaseSensitiveFiltering() const
Returns true if message is be filtered case sensitively, otherwise false.
std::vector< std::string > DicomMessageListType
Container type of the list of filtered substring.
const DicomMessageListType & filterSubStrings() const
Returns the constant list of string which must be found in a message to filter it out.
bool & isFiltered()
Returns true if message shall be filtered / suppressed, otherwise false.
const std::string & filterIdString() const
Returns the constructor argument filterIdString.