ctkLDAPSearchFilter.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) 2010 German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #include "ctkLDAPSearchFilter.h"
  16. class ctkLDAPSearchFilterPrivate {
  17. public:
  18. ctkLDAPSearchFilterPrivate()
  19. : ref(1)
  20. {}
  21. QAtomicInt ref;
  22. };
  23. ctkLDAPSearchFilter::ctkLDAPSearchFilter(const QString& filter)
  24. : d(new ctkLDAPSearchFilterPrivate())
  25. {
  26. }
  27. ctkLDAPSearchFilter::ctkLDAPSearchFilter(const ctkLDAPSearchFilter& filter)
  28. : d(filter.d)
  29. {
  30. d->ref.ref();
  31. }
  32. ctkLDAPSearchFilter::~ctkLDAPSearchFilter()
  33. {
  34. if (!d->ref.deref())
  35. delete d;
  36. }
  37. bool ctkLDAPSearchFilter::match(const Dictionary& dictionary) const
  38. {
  39. return true;
  40. }
  41. bool ctkLDAPSearchFilter::matchCase(const Dictionary& dictionary) const
  42. {
  43. return true;
  44. }
  45. bool ctkLDAPSearchFilter::operator==(const ctkLDAPSearchFilter& other) const
  46. {
  47. // TODO
  48. return true;
  49. }
  50. ctkLDAPSearchFilter& ctkLDAPSearchFilter::operator=(const ctkLDAPSearchFilter& filter)
  51. {
  52. if (d != filter.d)
  53. {
  54. if (!d->ref.deref())
  55. delete d;
  56. d = filter.d;
  57. d->ref.ref();
  58. }
  59. return *this;
  60. }