class OptionRequirement

Declaration

template <typename OptionType>
class OptionRequirement : public RefactoringOptionsRequirement { /* full declaration omitted */ };

Description

A requirement that evaluates to the value of the given \c OptionType when the \c OptionType is a required option. When the \c OptionType is an optional option, the requirement will evaluate to \c None if the option is not specified or to an appropriate value otherwise.

Declared at: clang/include/clang/Tooling/Refactoring/RefactoringActionRuleRequirements.h:96

Inherits from: RefactoringOptionsRequirement

Templates

OptionType

Member Variables

private std::shared_ptr<RefactoringOption> Opt
The ownership of the option is shared among the different requirements because the same option can be used by multiple rules in one refactoring action.

Method Overview

Inherited from RefactoringOptionsRequirement:

Methods

OptionRequirement<OptionType>()

Declared at: clang/include/clang/Tooling/Refactoring/RefactoringActionRuleRequirements.h:98

Expected<typename OptionType::ValueType> evaluate(
    clang::tooling::RefactoringRuleContext&) const

Declared at: clang/include/clang/Tooling/Refactoring/RefactoringActionRuleRequirements.h:106

Parameters

clang::tooling::RefactoringRuleContext&

ArrayRef<std::shared_ptr<RefactoringOption>>
getRefactoringOptions() const

Description

Returns the set of refactoring options that are used when evaluating this requirement.

Declared at: clang/include/clang/Tooling/Refactoring/RefactoringActionRuleRequirements.h:101