clang-tools  3.8.0
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,
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
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: