LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::cl::opt< DataType, ExternalStorage, ParserClass > Class Template Reference

#include "llvm/Support/CommandLine.h"

Inheritance diagram for llvm::cl::opt< DataType, ExternalStorage, ParserClass >:
Inheritance graph
[legend]

Public Member Functions

 opt (const opt &)=delete
 
optoperator= (const opt &)=delete
 
void setInitialValue (const DataType &V)
 
ParserClass & getParser ()
 
template<class T >
DataType & operator= (const T &Val)
 
template<class... Mods>
 opt (const Mods &... Ms)
 
void setCallback (std::function< void(const typename ParserClass::parser_data_type &)> CB)
 
- Public Member Functions inherited from llvm::cl::Option
enum NumOccurrencesFlag getNumOccurrencesFlag () const
 
enum ValueExpected getValueExpectedFlag () const
 
enum OptionHidden getOptionHiddenFlag () const
 
enum FormattingFlags getFormattingFlag () const
 
unsigned getMiscFlags () const
 
unsigned getPosition () const
 
unsigned getNumAdditionalVals () const
 
bool hasArgStr () const
 
bool isPositional () const
 
bool isSink () const
 
bool isDefaultOption () const
 
bool isConsumeAfter () const
 
void setArgStr (StringRef S)
 
void setDescription (StringRef S)
 
void setValueStr (StringRef S)
 
void setNumOccurrencesFlag (enum NumOccurrencesFlag Val)
 
void setValueExpectedFlag (enum ValueExpected Val)
 
void setHiddenFlag (enum OptionHidden Val)
 
void setFormattingFlag (enum FormattingFlags V)
 
void setMiscFlag (enum MiscFlags M)
 
void setPosition (unsigned pos)
 
void addCategory (OptionCategory &C)
 
void addSubCommand (SubCommand &S)
 
virtual ~Option ()=default
 
void addArgument ()
 
void removeArgument ()
 Unregisters this option from the CommandLine system.
 
virtual size_t getOptionWidth () const =0
 
virtual void printOptionInfo (size_t GlobalWidth) const =0
 
virtual void printOptionValue (size_t GlobalWidth, bool Force) const =0
 
virtual void setDefault ()=0
 
virtual void getExtraOptionNames (SmallVectorImpl< StringRef > &)
 
virtual bool addOccurrence (unsigned pos, StringRef ArgName, StringRef Value, bool MultiArg=false)
 
bool error (const Twine &Message, StringRef ArgName=StringRef(), raw_ostream &Errs=llvm::errs())
 
bool error (const Twine &Message, raw_ostream &Errs)
 
int getNumOccurrences () const
 
void reset ()
 
- Public Member Functions inherited from llvm::cl::opt_storage< DataType, ExternalStorage, isClass >
 opt_storage ()=default
 
bool setLocation (Option &O, DataType &L)
 
template<class T >
void setValue (const T &V, bool initial=false)
 
DataType & getValue ()
 
const DataType & getValue () const
 
 operator DataType () const
 
const OptionValue< DataType > & getDefault () const
 

Public Attributes

std::function< void(const typename ParserClass::parser_data_type &)> Callback
 
- Public Attributes inherited from llvm::cl::Option
StringRef ArgStr
 
StringRef HelpStr
 
StringRef ValueStr
 
SmallVector< OptionCategory *, 1 > Categories
 
SmallPtrSet< SubCommand *, 1 > Subs
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::cl::Option
static void printHelpStr (StringRef HelpStr, size_t Indent, size_t FirstLineIndentedBy)
 
static void printEnumValHelpStr (StringRef HelpStr, size_t Indent, size_t FirstLineIndentedBy)
 
- Protected Member Functions inherited from llvm::cl::Option
 Option (enum NumOccurrencesFlag OccurrencesFlag, enum OptionHidden Hidden)
 
void setNumAdditionalVals (unsigned n)
 

Detailed Description

template<class DataType, bool ExternalStorage = false, class ParserClass = parser<DataType>>
class llvm::cl::opt< DataType, ExternalStorage, ParserClass >

Definition at line 1421 of file CommandLine.h.

Constructor & Destructor Documentation

◆ opt() [1/2]

template<class DataType , bool ExternalStorage = false, class ParserClass = parser<DataType>>
llvm::cl::opt< DataType, ExternalStorage, ParserClass >::opt ( const opt< DataType, ExternalStorage, ParserClass > &  )
delete

◆ opt() [2/2]

template<class DataType , bool ExternalStorage = false, class ParserClass = parser<DataType>>
template<class... Mods>
llvm::cl::opt< DataType, ExternalStorage, ParserClass >::opt ( const Mods &...  Ms)
inlineexplicit

Definition at line 1498 of file CommandLine.h.

References llvm::cl::apply().

Member Function Documentation

◆ getParser()

template<class DataType , bool ExternalStorage = false, class ParserClass = parser<DataType>>
ParserClass & llvm::cl::opt< DataType, ExternalStorage, ParserClass >::getParser ( )
inline

Definition at line 1489 of file CommandLine.h.

◆ operator=() [1/2]

template<class DataType , bool ExternalStorage = false, class ParserClass = parser<DataType>>
opt & llvm::cl::opt< DataType, ExternalStorage, ParserClass >::operator= ( const opt< DataType, ExternalStorage, ParserClass > &  )
delete

◆ operator=() [2/2]

template<class DataType , bool ExternalStorage = false, class ParserClass = parser<DataType>>
template<class T >
DataType & llvm::cl::opt< DataType, ExternalStorage, ParserClass >::operator= ( const T Val)
inline

◆ setCallback()

template<class DataType , bool ExternalStorage = false, class ParserClass = parser<DataType>>
void llvm::cl::opt< DataType, ExternalStorage, ParserClass >::setCallback ( std::function< void(const typename ParserClass::parser_data_type &)>  CB)
inline

◆ setInitialValue()

template<class DataType , bool ExternalStorage = false, class ParserClass = parser<DataType>>
void llvm::cl::opt< DataType, ExternalStorage, ParserClass >::setInitialValue ( const DataType &  V)
inline

Member Data Documentation

◆ Callback

template<class DataType , bool ExternalStorage = false, class ParserClass = parser<DataType>>
std::function<void(const typename ParserClass::parser_data_type &)> llvm::cl::opt< DataType, ExternalStorage, ParserClass >::Callback
Initial value:
=
[](const typename ParserClass::parser_data_type &) {}

Definition at line 1509 of file CommandLine.h.

Referenced by llvm::cl::opt< DataType, ExternalStorage, ParserClass >::operator=(), and llvm::cl::opt< DataType, ExternalStorage, ParserClass >::setCallback().


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