[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang-tools-extra / clang-tidy / abseil / StringFindStrContainsCheck.h
blob67ebd6f172e10c77512f6abdd97be9e8e5a97f24
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 {
16 namespace tidy {
17 namespace abseil {
19 /// Finds s.find(...) == string::npos comparisons (for various string-like
20 /// types) and suggests replacing with absl::StrContains.
21 ///
22 /// For the user-facing documentation see:
23 /// http://clang.llvm.org/extra/clang-tidy/checks/abseil/string-find-str-contains.html
24 class StringFindStrContainsCheck : public utils::TransformerClangTidyCheck {
25 public:
26 StringFindStrContainsCheck(StringRef Name, ClangTidyContext *Context);
27 bool isLanguageVersionSupported(const LangOptions &LangOpts) const override;
28 void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
30 private:
31 const std::vector<StringRef> StringLikeClassesOption;
32 const StringRef AbseilStringsMatchHeaderOption;
35 } // namespace abseil
36 } // namespace tidy
37 } // namespace clang
39 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ABSEIL_STRINGFINDSTRCONTAINSCHECK_H