clang-tools
10.0.0svn
|
Provides access to the ClangTidyCheck
options via check-local names.
More...
#include <ClangTidyCheck.h>
Public Member Functions | |
OptionsView (StringRef CheckName, const ClangTidyOptions::OptionMap &CheckOptions) | |
Initializes the instance using CheckName + "." as a prefix. More... | |
std::string | get (StringRef LocalName, StringRef Default) const |
Read a named option from the Context . More... | |
std::string | getLocalOrGlobal (StringRef LocalName, StringRef Default) const |
Read a named option from the Context . More... | |
template<typename T > | |
std::enable_if< std::is_integral< T >::value, T >::type | get (StringRef LocalName, T Default) const |
Read a named option from the Context and parse it as an integral type T . More... | |
template<typename T > | |
std::enable_if< std::is_integral< T >::value, T >::type | getLocalOrGlobal (StringRef LocalName, T Default) const |
Read a named option from the Context and parse it as an integral type T . More... | |
void | store (ClangTidyOptions::OptionMap &Options, StringRef LocalName, StringRef Value) const |
Stores an option with the check-local name LocalName with string value Value to Options . More... | |
void | store (ClangTidyOptions::OptionMap &Options, StringRef LocalName, int64_t Value) const |
Stores an option with the check-local name LocalName with int64_t value Value to Options . More... | |
Provides access to the ClangTidyCheck
options via check-local names.
Methods of this class prepend CheckName + "."
to translate check-local option names to global option names.
Definition at line 108 of file ClangTidyCheck.h.
clang::tidy::ClangTidyCheck::OptionsView::OptionsView | ( | StringRef | CheckName, |
const ClangTidyOptions::OptionMap & | CheckOptions | ||
) |
Initializes the instance using CheckName
+ "." as a prefix.
Definition at line 33 of file ClangTidyCheck.cpp.
std::string clang::tidy::ClangTidyCheck::OptionsView::get | ( | StringRef | LocalName, |
StringRef | Default | ||
) | const |
Read a named option from the Context
.
Reads the option with the check-local name LocalName
from the CheckOptions
. If the corresponding key is not present, returns Default
.
Definition at line 37 of file ClangTidyCheck.cpp.
|
inline |
Read a named option from the Context
and parse it as an integral type T
.
Reads the option with the check-local name LocalName
from the CheckOptions
. If the corresponding key is not present, returns Default
.
Definition at line 137 of file ClangTidyCheck.h.
std::string clang::tidy::ClangTidyCheck::OptionsView::getLocalOrGlobal | ( | StringRef | LocalName, |
StringRef | Default | ||
) | const |
Read a named option from the Context
.
Reads the option with the check-local name LocalName
from local or global CheckOptions
. Gets local option first. If local is not present, falls back to get global option. If global option is not present either, returns Default.
Definition at line 46 of file ClangTidyCheck.cpp.
Referenced by getLocalOrGlobal().
|
inline |
Read a named option from the Context
and parse it as an integral type T
.
Reads the option with the check-local name LocalName
from local or global CheckOptions
. Gets local option first. If local is not present, falls back to get global option. If global option is not present either, returns Default.
Definition at line 154 of file ClangTidyCheck.h.
References getLocalOrGlobal().
void clang::tidy::ClangTidyCheck::OptionsView::store | ( | ClangTidyOptions::OptionMap & | Options, |
StringRef | LocalName, | ||
StringRef | Value | ||
) | const |
Stores an option with the check-local name LocalName
with string value Value
to Options
.
Definition at line 58 of file ClangTidyCheck.cpp.
Referenced by store().
void clang::tidy::ClangTidyCheck::OptionsView::store | ( | ClangTidyOptions::OptionMap & | Options, |
StringRef | LocalName, | ||
int64_t | Value | ||
) | const |
Stores an option with the check-local name LocalName
with int64_t
value Value
to Options
.
Definition at line 64 of file ClangTidyCheck.cpp.
References store().