LLVM 20.0.0git
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
llvm::cl::parser< DataType > Class Template Reference

#include "llvm/Support/CommandLine.h"

Inheritance diagram for llvm::cl::parser< DataType >:
Inheritance graph
[legend]

Classes

class  OptionInfo
 

Public Types

using parser_data_type = DataType
 

Public Member Functions

 parser (Option &O)
 
unsigned getNumOptions () const override
 
StringRef getOption (unsigned N) const override
 
StringRef getDescription (unsigned N) const override
 
const GenericOptionValuegetOptionValue (unsigned N) const override
 
bool parse (Option &O, StringRef ArgName, StringRef Arg, DataType &V)
 
template<class DT >
void addLiteralOption (StringRef Name, const DT &V, StringRef HelpStr)
 Add an entry to the mapping table.
 
void removeLiteralOption (StringRef Name)
 Remove the specified option.
 
- Public Member Functions inherited from llvm::cl::generic_parser_base
 generic_parser_base (Option &O)
 
virtual ~generic_parser_base ()=default
 
virtual unsigned getNumOptions () const =0
 
virtual StringRef getOption (unsigned N) const =0
 
virtual StringRef getDescription (unsigned N) const =0
 
virtual size_t getOptionWidth (const Option &O) const
 
virtual const GenericOptionValuegetOptionValue (unsigned N) const =0
 
virtual void printOptionInfo (const Option &O, size_t GlobalWidth) const
 
void printGenericOptionDiff (const Option &O, const GenericOptionValue &V, const GenericOptionValue &Default, size_t GlobalWidth) const
 
template<class AnyOptionValue >
void printOptionDiff (const Option &O, const AnyOptionValue &V, const AnyOptionValue &Default, size_t GlobalWidth) const
 
void initialize ()
 
void getExtraOptionNames (SmallVectorImpl< StringRef > &OptionNames)
 
enum ValueExpected getValueExpectedFlagDefault () const
 
unsigned findOption (StringRef Name)
 

Protected Attributes

SmallVector< OptionInfo, 8 > Values
 
- Protected Attributes inherited from llvm::cl::generic_parser_base
OptionOwner
 

Detailed Description

template<class DataType>
class llvm::cl::parser< DataType >

Definition at line 823 of file CommandLine.h.

Member Typedef Documentation

◆ parser_data_type

template<class DataType >
using llvm::cl::parser< DataType >::parser_data_type = DataType

Definition at line 837 of file CommandLine.h.

Constructor & Destructor Documentation

◆ parser()

template<class DataType >
llvm::cl::parser< DataType >::parser ( Option O)
inline

Definition at line 835 of file CommandLine.h.

Member Function Documentation

◆ addLiteralOption()

template<class DataType >
template<class DT >
void llvm::cl::parser< DataType >::addLiteralOption ( StringRef  Name,
const DT &  V,
StringRef  HelpStr 
)
inline

◆ getDescription()

template<class DataType >
StringRef llvm::cl::parser< DataType >::getDescription ( unsigned  N) const
inlineoverridevirtual

Implements llvm::cl::generic_parser_base.

Definition at line 842 of file CommandLine.h.

References N, and llvm::cl::parser< DataType >::Values.

◆ getNumOptions()

template<class DataType >
unsigned llvm::cl::parser< DataType >::getNumOptions ( ) const
inlineoverridevirtual

Implements llvm::cl::generic_parser_base.

Definition at line 840 of file CommandLine.h.

References llvm::cl::parser< DataType >::Values.

◆ getOption()

template<class DataType >
StringRef llvm::cl::parser< DataType >::getOption ( unsigned  N) const
inlineoverridevirtual

Implements llvm::cl::generic_parser_base.

Definition at line 841 of file CommandLine.h.

References N, and llvm::cl::parser< DataType >::Values.

◆ getOptionValue()

template<class DataType >
const GenericOptionValue & llvm::cl::parser< DataType >::getOptionValue ( unsigned  N) const
inlineoverridevirtual

Implements llvm::cl::generic_parser_base.

Definition at line 847 of file CommandLine.h.

References N, and llvm::cl::parser< DataType >::Values.

◆ parse()

template<class DataType >
bool parser::parse ( Option O,
StringRef  ArgName,
StringRef  Arg,
DataType &  V 
)
inline

◆ removeLiteralOption()

template<class DataType >
void llvm::cl::parser< DataType >::removeLiteralOption ( StringRef  Name)
inline

Remove the specified option.

Definition at line 883 of file CommandLine.h.

References assert(), llvm::cl::generic_parser_base::findOption(), N, Name, and llvm::cl::parser< DataType >::Values.

Member Data Documentation

◆ Values

template<class DataType >
SmallVector<OptionInfo, 8> llvm::cl::parser< DataType >::Values
protected

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