clang 20.0.0git
Public Types | Public Member Functions | Protected Attributes | List of all members
clang::tooling::OptionalRefactoringOption< T, typename > Class Template Reference

A refactoring option that stores a value of type T. More...

#include "clang/Tooling/Refactoring/RefactoringOptions.h"

Inheritance diagram for clang::tooling::OptionalRefactoringOption< T, typename >:
Inheritance graph
[legend]

Public Types

using ValueType = std::optional< T >
 

Public Member Functions

void passToVisitor (RefactoringOptionVisitor &Visitor) final
 Invokes the visit method in the option consumer that's appropriate for the option's value type.
 
bool isRequired () const override
 True when this option must be specified before invoking the refactoring action.
 
const ValueTypegetValue () const
 
- Public Member Functions inherited from clang::tooling::RefactoringOption
virtual ~RefactoringOption ()
 
virtual StringRef getName () const =0
 Returns the name of the refactoring option.
 
virtual StringRef getDescription () const =0
 
virtual bool isRequired () const =0
 True when this option must be specified before invoking the refactoring action.
 
virtual void passToVisitor (RefactoringOptionVisitor &Visitor)=0
 Invokes the visit method in the option consumer that's appropriate for the option's value type.
 

Protected Attributes

std::optional< TValue
 

Detailed Description

template<typename T, typename = std::enable_if_t<traits::IsValidOptionType<T>::value>>
class clang::tooling::OptionalRefactoringOption< T, typename >

A refactoring option that stores a value of type T.

Definition at line 26 of file RefactoringOptions.h.

Member Typedef Documentation

◆ ValueType

template<typename T , typename = std::enable_if_t<traits::IsValidOptionType<T>::value>>
using clang::tooling::OptionalRefactoringOption< T, typename >::ValueType = std::optional<T>

Definition at line 34 of file RefactoringOptions.h.

Member Function Documentation

◆ getValue()

template<typename T , typename = std::enable_if_t<traits::IsValidOptionType<T>::value>>
const ValueType & clang::tooling::OptionalRefactoringOption< T, typename >::getValue ( ) const
inline

◆ isRequired()

template<typename T , typename = std::enable_if_t<traits::IsValidOptionType<T>::value>>
bool clang::tooling::OptionalRefactoringOption< T, typename >::isRequired ( ) const
inlineoverridevirtual

True when this option must be specified before invoking the refactoring action.

Implements clang::tooling::RefactoringOption.

Reimplemented in clang::tooling::RequiredRefactoringOption< T, typename >.

Definition at line 32 of file RefactoringOptions.h.

◆ passToVisitor()

template<typename T , typename = std::enable_if_t<traits::IsValidOptionType<T>::value>>
void clang::tooling::OptionalRefactoringOption< T, typename >::passToVisitor ( RefactoringOptionVisitor Visitor)
inlinefinalvirtual

Invokes the visit method in the option consumer that's appropriate for the option's value type.

For example, if the option stores a string value, this method will invoke the visit method with a reference to an std::string value.

Implements clang::tooling::RefactoringOption.

Definition at line 28 of file RefactoringOptions.h.

Member Data Documentation

◆ Value

template<typename T , typename = std::enable_if_t<traits::IsValidOptionType<T>::value>>
std::optional<T> clang::tooling::OptionalRefactoringOption< T, typename >::Value
protected

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