-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMemberNamesCheck.h
More file actions
44 lines (36 loc) · 1.37 KB
/
MemberNamesCheck.h
File metadata and controls
44 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//===--- MemberNamesCheck.h - clang-tidy-------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALICEO2_MEMBER_NAMES_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALICEO2_MEMBER_NAMES_H
#include "../ClangTidy.h"
#include "../ClangTidyCheck.h"
#include <regex>
namespace clang {
namespace tidy {
namespace aliceO2 {
/// Checking the class member naming convention
///
class MemberNamesCheck : public ClangTidyCheck {
private:
const std::string Pattern; // the regular expression string
const std::regex Regex; // the regular expression class
public:
MemberNamesCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context), Pattern(Options.get("Pattern","m[A-Z].*")), Regex(Pattern)
{}
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
void storeOptions(ClangTidyOptions::OptionMap &Opts) override {
Options.store(Opts, "Pattern", Pattern);
}
};
} // namespace aliceO2
} // namespace tidy
} // namespace clang
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALICEO2_MEMBER_NAMES_H