clang-tools 3.8.0

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
clang::tidy::OptionsView Class Reference

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, std::string 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...

## Detailed Description

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.

## Constructor & Destructor Documentation

clang::tidy::OptionsView::OptionsView | ( | StringRef | CheckName,
|  | const ClangTidyOptions::OptionMap & | CheckOptions
| ) |  |

Initializes the instance using `CheckName` + "." as a prefix.

Definition at line 333 of file ClangTidy.cpp.

## Member Function Documentation

std::string clang::tidy::OptionsView::get | ( | StringRef | LocalName,
|  | std::string | 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 337 of file ClangTidy.cpp.

Referenced by clang::tidy::readability::IdentifierNamingCheck::IdentifierNamingCheck().

template<typename T >

std::enable_if<std::is_integral<T>::value, T>::type clang::tidy::OptionsView::get | ( | StringRef | LocalName,
|  | T | Default
| ) |  | const
| 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 60 of file ClangTidy.h.

References Result.

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 344 of file ClangTidy.cpp.

Referenced by store(), clang::tidy::modernize::UseNullptrCheck::storeOptions(), clang::tidy::modernize::LoopConvertCheck::storeOptions(), clang::tidy::modernize::PassByValueCheck::storeOptions(), clang::tidy::google::runtime::IntegerTypesCheck::storeOptions(), clang::tidy::misc::DefinitionsInHeadersCheck::storeOptions(), clang::tidy::MoveConstructorInitCheck::storeOptions(), clang::tidy::ThrowByValueCatchByReferenceCheck::storeOptions(), clang::tidy::ProBoundsConstantArrayIndexCheck::storeOptions(), clang::tidy::readability::FunctionSizeCheck::storeOptions(), clang::tidy::readability::IdentifierNamingCheck::storeOptions(), clang::tidy::AssertSideEffectCheck::storeOptions(), clang::tidy::modernize::ReplaceAutoPtrCheck::storeOptions(), clang::tidy::readability::BracesAroundStatementsCheck::storeOptions(), and clang::tidy::readability::SimplifyBooleanExprCheck::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 349 of file ClangTidy.cpp.

References store().

The documentation for this class was generated from the following files:

- ClangTidy.h
- ClangTidy.cpp