SafeMatcher.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
  4. ** Contact: http://www.qt-project.org/legal
  5. **
  6. ** This file is part of Qt Creator.
  7. **
  8. ** Commercial License Usage
  9. ** Licensees holding valid commercial Qt licenses may use this file in
  10. ** accordance with the commercial license agreement provided with the
  11. ** Software or, alternatively, in accordance with the terms contained in
  12. ** a written agreement between you and Digia. For licensing terms and
  13. ** conditions see http://www.qt.io/licensing. For further information
  14. ** use the contact form at http://www.qt.io/contact-us.
  15. **
  16. ** GNU Lesser General Public License Usage
  17. ** Alternatively, this file may be used under the terms of the GNU Lesser
  18. ** General Public License version 2.1 or version 3 as published by the Free
  19. ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
  20. ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
  21. ** following information to ensure the GNU Lesser General Public License
  22. ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
  23. ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
  24. **
  25. ** In addition, as a special exception, Digia gives you certain additional
  26. ** rights. These rights are described in the Digia Qt LGPL Exception
  27. ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
  28. **
  29. ****************************************************************************/
  30. #ifndef CPLUSPLUS_SAFETYPEMATCHER_H
  31. #define CPLUSPLUS_SAFETYPEMATCHER_H
  32. #include "Matcher.h"
  33. #include <vector>
  34. namespace CPlusPlus {
  35. class SafeMatcher : public Matcher
  36. {
  37. public:
  38. SafeMatcher();
  39. ~SafeMatcher();
  40. bool match(const PointerToMemberType *type, const PointerToMemberType *otherType);
  41. bool match(const PointerType *type, const PointerType *otherType);
  42. bool match(const ReferenceType *type, const ReferenceType *otherType);
  43. bool match(const ArrayType *type, const ArrayType *otherType);
  44. bool match(const NamedType *type, const NamedType *otherType);
  45. bool match(const TemplateNameId *name, const TemplateNameId *otherName);
  46. bool match(const DestructorNameId *name, const DestructorNameId *otherName);
  47. bool match(const ConversionNameId *name, const ConversionNameId *otherName);
  48. bool match(const QualifiedNameId *name, const QualifiedNameId *otherName);
  49. bool match(const SelectorNameId *name, const SelectorNameId *otherName);
  50. private:
  51. std::vector<const Type *> _blockedTypes;
  52. std::vector<const Name *> _blockedNames;
  53. };
  54. } // CPlusPlus namespace
  55. #endif // CPLUSPLUS_SAFETYPEMATCHER_H