ctkLDAPSearchFilter.cxx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. namespace ctk {
  17. class LDAPSearchFilterPrivate {
  18. public:
  19. LDAPSearchFilterPrivate()
  20. : ref(1)
  21. {}
  22. QAtomicInt ref;
  23. };
  24. LDAPSearchFilter::LDAPSearchFilter(const QString& filter)
  25. : d(new LDAPSearchFilterPrivate())
  26. {
  27. }
  28. LDAPSearchFilter::LDAPSearchFilter(const LDAPSearchFilter& filter)
  29. : d(filter.d)
  30. {
  31. d->ref.ref();
  32. }
  33. LDAPSearchFilter::~LDAPSearchFilter()
  34. {
  35. if (!d->ref.deref())
  36. delete d;
  37. }
  38. bool LDAPSearchFilter::match(const Dictionary& dictionary) const
  39. {
  40. return true;
  41. }
  42. bool LDAPSearchFilter::matchCase(const Dictionary& dictionary) const
  43. {
  44. return true;
  45. }
  46. bool LDAPSearchFilter::operator==(const LDAPSearchFilter& other) const
  47. {
  48. // TODO
  49. return true;
  50. }
  51. LDAPSearchFilter& LDAPSearchFilter::operator=(const LDAPSearchFilter& filter)
  52. {
  53. if (d != filter.d)
  54. {
  55. if (!d->ref.deref())
  56. delete d;
  57. d = filter.d;
  58. d->ref.ref();
  59. }
  60. return *this;
  61. }
  62. }