[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang-tools-extra / clang-tidy / abseil / StringFindStrContainsCheck.h
blob68b827c5de0e1643af0500a2a259b6b7208eae70
1 //===--- StringFindStrContainsCheck.h - clang-tidy---------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTRCONTAINSCHECK_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTRCONTAINSCHECK_H
12 #include "../ClangTidyCheck.h"
13 #include "../utils/TransformerClangTidyCheck.h"
15 namespace clang::tidy::abseil {
17 /// Finds s.find(...) == string::npos comparisons (for various string-like
18 /// types) and suggests replacing with absl::StrContains.
19 ///
20 /// For the user-facing documentation see:
21 /// http://clang.llvm.org/extra/clang-tidy/checks/abseil/string-find-str-contains.html
22 class StringFindStrContainsCheck : public utils::TransformerClangTidyCheck {
23 public:
24 StringFindStrContainsCheck(StringRef Name, ClangTidyContext *Context);
25 bool isLanguageVersionSupported(const LangOptions &LangOpts) const override;
26 void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
28 private:
29 const std::vector<StringRef> StringLikeClassesOption;
30 const StringRef AbseilStringsMatchHeaderOption;
33 } // namespace clang::tidy::abseil
35 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTRCONTAINSCHECK_H