clang-tools
3.9.0
|
Provides access to the ClangTidyCheck
options via check-local names.
More...
#include <ClangTidy.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... | |
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 39 of file ClangTidy.h.
clang::tidy::OptionsView::OptionsView | ( | StringRef | CheckName, |
const ClangTidyOptions::OptionMap & | CheckOptions | ||
) |
Initializes the instance using CheckName
+ "." as a prefix.
Definition at line 362 of file ClangTidy.cpp.
std::string clang::tidy::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 366 of file ClangTidy.cpp.
Referenced by clang::tidy::readability::IdentifierNamingCheck::IdentifierNamingCheck().
|
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 68 of file ClangTidy.h.
References Result.
std::string clang::tidy::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 373 of file ClangTidy.cpp.
void clang::tidy::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 385 of file ClangTidy.cpp.
Referenced by store(), clang::tidy::modernize::UseNullptrCheck::storeOptions(), clang::tidy::modernize::LoopConvertCheck::storeOptions(), clang::tidy::modernize::PassByValueCheck::storeOptions(), clang::tidy::misc::SizeofExpressionCheck::storeOptions(), clang::tidy::misc::StringConstructorCheck::storeOptions(), clang::tidy::misc::SuspiciousMissingCommaCheck::storeOptions(), clang::tidy::misc::SuspiciousStringCompareCheck::storeOptions(), clang::tidy::performance::ForRangeCopyCheck::storeOptions(), clang::tidy::readability::SimplifyBooleanExprCheck::storeOptions(), clang::tidy::misc::DanglingHandleCheck::storeOptions(), clang::tidy::performance::UnnecessaryValueParamCheck::storeOptions(), clang::tidy::google::readability::GlobalNamesInHeadersCheck::storeOptions(), clang::tidy::misc::ThrowByValueCatchByReferenceCheck::storeOptions(), clang::tidy::performance::FasterStringFindCheck::storeOptions(), clang::tidy::modernize::UseEmplaceCheck::storeOptions(), clang::tidy::misc::MoveConstructorInitCheck::storeOptions(), clang::tidy::cppcoreguidelines::ProBoundsConstantArrayIndexCheck::storeOptions(), clang::tidy::readability::FunctionSizeCheck::storeOptions(), clang::tidy::google::runtime::IntegerTypesCheck::storeOptions(), clang::tidy::misc::MisplacedWideningCastCheck::storeOptions(), clang::tidy::google::build::UnnamedNamespaceInHeaderCheck::storeOptions(), clang::tidy::misc::DefinitionsInHeadersCheck::storeOptions(), clang::tidy::misc::AssertSideEffectCheck::storeOptions(), clang::tidy::readability::IdentifierNamingCheck::storeOptions(), clang::tidy::cppcoreguidelines::ProTypeMemberInitCheck::storeOptions(), clang::tidy::readability::BracesAroundStatementsCheck::storeOptions(), and clang::tidy::modernize::ReplaceAutoPtrCheck::storeOptions().
void clang::tidy::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 390 of file ClangTidy.cpp.
References store().