clang-tools 6.0.0

PropertyDeclarationCheck.h
Go to the documentation of this file.
1 //===--- PropertyDeclarationCheck.h - clang-tidy-----------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H
12
13 #include "../ClangTidy.h"
14 #include <string>
15 #include <vector>
16
17 namespace clang {
18 namespace tidy {
19 namespace objc {
20
21 /// Finds Objective-C property declarations which
22 /// are not in Lower Camel Case.
23 ///
24 /// The format of property should look like:
25 /// @property(nonatomic) NSString *lowerCamelCase;
26 ///
27 /// For the user-facing documentation see:
28 /// http://clang.llvm.org/extra/clang-tidy/checks/objc-property-declaration.html
29 class PropertyDeclarationCheck : public ClangTidyCheck {
30 public:
31 PropertyDeclarationCheck(StringRef Name, ClangTidyContext *Context);
32 void registerMatchers(ast_matchers::MatchFinder *Finder) override;
33 void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
34 void storeOptions(ClangTidyOptions::OptionMap &Options) override;
35
36 private:
37 const std::vector<std::string> SpecialAcronyms;
38 };
39
40 } // namespace objc
41 } // namespace tidy
42 } // namespace clang
43
44 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_OBJC_PROPERTY_DECLARATION_H
clang::tidy::objc::PropertyDeclarationCheck::PropertyDeclarationCheck
PropertyDeclarationCheck(StringRef Name, ClangTidyContext *Context)
Definition: PropertyDeclarationCheck.cpp:82
clang::tidy::objc::PropertyDeclarationCheck::storeOptions
void storeOptions(ClangTidyOptions::OptionMap &Options) override
Should store all options supported by this check with their current values or default values for opti...
Definition: PropertyDeclarationCheck.cpp:108
Name
StringHandle Name
Definition: PreprocessorTracker.cpp:525
clang::tidy::objc::PropertyDeclarationCheck
Definition: PropertyDeclarationCheck.h:29
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition: ClangTidy.h:127
clang::tidy::ClangTidyCheck::Options
OptionsView Options
Definition: ClangTidy.h:183
clang::tidy::ClangTidyOptions::OptionMap
std::map< std::string, std::string > OptionMap
Definition: ClangTidyOptions.h:99
clang
Definition: AndroidTidyModule.cpp:28
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition: ClangTidyDiagnosticConsumer.h:104
clang::tidy::objc::PropertyDeclarationCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Definition: PropertyDeclarationCheck.cpp:98
clang::tidy::objc::PropertyDeclarationCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Definition: PropertyDeclarationCheck.cpp:88