Medical Imaging Interaction Toolkit  2021.02.99-4e0dbe47
Medical Imaging Interaction Toolkit
usLDAPProp.h
Go to the documentation of this file.
1 /*============================================================================
2 
3  Library: CppMicroServices
4 
5  Copyright (c) German Cancer Research Center (DKFZ)
6  All rights reserved.
7 
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 ============================================================================*/
21 
22 #ifndef USLDAPPROP_H
23 #define USLDAPPROP_H
24 
25 #include <usCoreConfig.h>
26 #include <usAny.h>
27 
29 
31 class US_Core_EXPORT LDAPPropExpr
32 {
33 public:
34 
35  explicit LDAPPropExpr(const std::string& expr);
36 
37  LDAPPropExpr& operator!();
38 
39  operator std::string() const;
40 
41  bool IsNull() const;
42 
43 private:
44 
45  LDAPPropExpr& operator=(const LDAPPropExpr&);
46 
47  std::string m_ldapExpr;
48 };
50 
71 {
72 public:
73 
79  LDAPProp(const std::string& property);
80 
89  LDAPPropExpr operator==(const std::string& s) const;
90  LDAPPropExpr operator==(const us::Any& s) const;
91  template<class T>
92  LDAPPropExpr operator==(const T& s) const
93  {
94  std::stringstream ss;
95  ss << s;
96  return LDAPPropExpr("(" + m_property + "=" + ss.str() + ")");
97  }
99 
100  operator LDAPPropExpr () const;
101 
107  LDAPPropExpr operator!() const;
108 
127  LDAPPropExpr operator!=(const std::string& s) const;
128  LDAPPropExpr operator!=(const us::Any& s) const;
129  template<class T>
130  LDAPPropExpr operator!=(const T& s) const
131  {
132  std::stringstream ss;
133  ss << s;
134  return operator!=(ss.str());
135  }
137 
146  LDAPPropExpr operator>=(const std::string& s) const;
147  LDAPPropExpr operator>=(const us::Any& s) const;
148  template<class T>
149  LDAPPropExpr operator>=(const T& s) const
150  {
151  std::stringstream ss;
152  ss << s;
153  return operator>=(ss.str());
154  }
156 
165  LDAPPropExpr operator<=(const std::string& s) const;
166  LDAPPropExpr operator<=(const us::Any& s) const;
167  template<class T>
168  LDAPPropExpr operator<=(const T& s) const
169  {
170  std::stringstream ss;
171  ss << s;
172  return operator<=(ss.str());
173  }
175 
184  LDAPPropExpr Approx(const std::string& s) const;
185  LDAPPropExpr Approx(const us::Any& s) const;
186  template<class T>
187  LDAPPropExpr Approx(const T& s) const
188  {
189  std::stringstream ss;
190  ss << s;
191  return Approx(ss.str());
192  }
194 
195 private:
196 
197  LDAPProp& operator=(const LDAPProp&);
198 
199  std::string m_property;
200 };
201 
203 
213 US_Core_EXPORT us::LDAPPropExpr operator&&(const us::LDAPPropExpr& left, const us::LDAPPropExpr& right);
214 
224 US_Core_EXPORT us::LDAPPropExpr operator||(const us::LDAPPropExpr& left, const us::LDAPPropExpr& right);
225 
226 #endif // USLDAPPROP_H
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
LDAPPropExpr operator==(const T &s) const
Definition: usLDAPProp.h:92
US_Core_EXPORT us::LDAPPropExpr operator &&(const us::LDAPPropExpr &left, const us::LDAPPropExpr &right)
US_Core_EXPORT us::LDAPPropExpr operator||(const us::LDAPPropExpr &left, const us::LDAPPropExpr &right)
LDAPPropExpr Approx(const T &s) const
Definition: usLDAPProp.h:187
bool operator>=(const mitk::WeakPointer< T > &left, const mitk::WeakPointer< T > &right) noexcept
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b)
LDAPPropExpr operator>=(const T &s) const
Definition: usLDAPProp.h:149
#define US_Core_EXPORT
Definition: usCoreExport.h:21
Definition: usAny.h:163
LDAPPropExpr operator<=(const T &s) const
Definition: usLDAPProp.h:168
#define US_END_NAMESPACE
LDAPPropExpr operator!=(const T &s) const
Definition: usLDAPProp.h:130
#define US_BEGIN_NAMESPACE
bool operator<=(const mitk::WeakPointer< T > &left, const mitk::WeakPointer< T > &right) noexcept