File indexing completed on 2024-04-28 05:38:33

0001 /*
0002     SPDX-FileCopyrightText: 2020 The Qt Company Ltd.
0003     SPDX-FileCopyrightText: 2020 Lucie Gerard <lucie.gerard@qt.io>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef CLAZY_QT6_HEADER_FIXES_H
0009 #define CLAZY_QT6_HEADER_FIXES_H
0010 
0011 #include "checkbase.h"
0012 
0013 #include <string>
0014 
0015 class ClazyContext;
0016 
0017 namespace clang
0018 {
0019 class Stmt;
0020 class FixItHint;
0021 }
0022 
0023 /**
0024  * Replaces wrong headers with correct ones.
0025  *
0026  * Run only in Qt 6 code.
0027  */
0028 class Qt6HeaderFixes : public CheckBase
0029 {
0030 public:
0031     explicit Qt6HeaderFixes(const std::string &name, ClazyContext *context);
0032     void VisitInclusionDirective(clang::SourceLocation HashLoc,
0033                                  const clang::Token &IncludeTok,
0034                                  clang::StringRef FileName,
0035                                  bool IsAngled,
0036                                  clang::CharSourceRange FilenameRange,
0037                                  clazy::OptionalFileEntryRef File,
0038                                  clang::StringRef SearchPath,
0039                                  clang::StringRef RelativePath,
0040                                  const clang::Module *Imported,
0041                                  clang::SrcMgr::CharacteristicKind FileType) override;
0042 };
0043 
0044 #endif