Matcher.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 TYPEMATCHER_H
  31. #define TYPEMATCHER_H
  32. #include "CPlusPlusForwardDeclarations.h"
  33. namespace CPlusPlus {
  34. class CPLUSPLUS_EXPORT Matcher
  35. {
  36. Matcher(const Matcher &other);
  37. void operator = (const Matcher &other);
  38. public:
  39. Matcher();
  40. virtual ~Matcher();
  41. static bool match(const Type *type, const Type *otherType, Matcher *matcher = 0);
  42. static bool match(const Name *name, const Name *otherName, Matcher *matcher = 0);
  43. virtual bool match(const UndefinedType *type, const UndefinedType *otherType);
  44. virtual bool match(const VoidType *type, const VoidType *otherType);
  45. virtual bool match(const IntegerType *type, const IntegerType *otherType);
  46. virtual bool match(const FloatType *type, const FloatType *otherType);
  47. virtual bool match(const PointerToMemberType *type, const PointerToMemberType *otherType);
  48. virtual bool match(const PointerType *type, const PointerType *otherType);
  49. virtual bool match(const ReferenceType *type, const ReferenceType *otherType);
  50. virtual bool match(const ArrayType *type, const ArrayType *otherType);
  51. virtual bool match(const NamedType *type, const NamedType *otherType);
  52. virtual bool match(const Function *type, const Function *otherType);
  53. virtual bool match(const Enum *type, const Enum *otherType);
  54. virtual bool match(const Namespace *type, const Namespace *otherType);
  55. virtual bool match(const Template *type, const Template *otherType);
  56. virtual bool match(const ForwardClassDeclaration *type, const ForwardClassDeclaration *otherType);
  57. virtual bool match(const Class *type, const Class *otherType);
  58. virtual bool match(const ObjCClass *type, const ObjCClass *otherType);
  59. virtual bool match(const ObjCProtocol *type, const ObjCProtocol *otherType);
  60. virtual bool match(const ObjCForwardClassDeclaration *type, const ObjCForwardClassDeclaration *otherType);
  61. virtual bool match(const ObjCForwardProtocolDeclaration *type, const ObjCForwardProtocolDeclaration *otherType);
  62. virtual bool match(const ObjCMethod *type, const ObjCMethod *otherType);
  63. virtual bool match(const Identifier *name, const Identifier *otherName);
  64. virtual bool match(const AnonymousNameId *name, const AnonymousNameId *otherName);
  65. virtual bool match(const TemplateNameId *name, const TemplateNameId *otherName);
  66. virtual bool match(const DestructorNameId *name, const DestructorNameId *otherName);
  67. virtual bool match(const OperatorNameId *name, const OperatorNameId *otherName);
  68. virtual bool match(const ConversionNameId *name, const ConversionNameId *otherName);
  69. virtual bool match(const QualifiedNameId *name, const QualifiedNameId *otherName);
  70. virtual bool match(const SelectorNameId *name, const SelectorNameId *otherName);
  71. };
  72. } // namespace CPlusPlus
  73. #endif // TYPEMATCHER_H