LLDB mainline
Classes | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
CommandObjectScriptingObjectParsed::CommandOptions Class Reference
Inheritance diagram for CommandObjectScriptingObjectParsed::CommandOptions:
Inheritance graph
[legend]

Classes

struct  EnumValueStorage
 

Public Member Functions

 CommandOptions (CommandInterpreter &interpreter, StructuredData::GenericSP cmd_obj_sp)
 
 ~CommandOptions () override=default
 
Status SetOptionValue (uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
 Set the value of an option.
 
void OptionParsingStarting (ExecutionContext *execution_context) override
 
llvm::ArrayRef< OptionDefinitionGetDefinitions () override
 
Status SetOptionsFromArray (StructuredData::Dictionary &options)
 
size_t GetNumOptions ()
 
void PrepareOptionsForCompletion (CompletionRequest &request, OptionElementVector &option_vec, ExecutionContext *exe_ctx)
 
void ProcessCompletionDict (CompletionRequest &request, StructuredData::DictionarySP &completion_dict_sp)
 
void HandleOptionArgumentCompletion (lldb_private::CompletionRequest &request, OptionElementVector &option_vec, int opt_element_index, CommandInterpreter &interpreter) override
 Handles the generic bits of figuring out whether we are in an option, and if so completing it.
 
- Public Member Functions inherited from lldb_private::Options
 Options ()
 
virtual ~Options ()
 
void BuildGetoptTable ()
 
void BuildValidOptionSets ()
 
uint32_t NumCommandOptions ()
 
OptionGetLongOptions ()
 Get the option definitions to use when parsing Args options.
 
void OptionSeen (int short_option)
 
bool VerifyOptions (CommandReturnObject &result)
 
bool VerifyPartialOptions (CommandReturnObject &result)
 
void OutputFormattedUsageText (Stream &strm, const OptionDefinition &option_def, uint32_t output_max_columns)
 
void GenerateOptionUsage (Stream &strm, CommandObject &cmd, uint32_t screen_width)
 
bool SupportsLongOption (const char *long_option)
 
virtual llvm::ArrayRef< OptionDefinitionGetDefinitions ()
 
void NotifyOptionParsingStarting (ExecutionContext *execution_context)
 
llvm::Expected< ArgsParse (const Args &args, ExecutionContext *execution_context, lldb::PlatformSP platform_sp, bool require_validation)
 Parse the provided arguments.
 
llvm::Expected< ArgsParseAlias (const Args &args, OptionArgVector *option_arg_vector, std::string &input_line)
 
OptionElementVector ParseForCompletion (const Args &args, uint32_t cursor_index)
 
Status NotifyOptionParsingFinished (ExecutionContext *execution_context)
 
virtual Status SetOptionValue (uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context)=0
 Set the value of an option.
 
bool HandleOptionCompletion (lldb_private::CompletionRequest &request, OptionElementVector &option_map, CommandInterpreter &interpreter)
 Handles the generic bits of figuring out whether we are in an option, and if so completing it.
 
virtual void HandleOptionArgumentCompletion (lldb_private::CompletionRequest &request, OptionElementVector &opt_element_vector, int opt_element_index, CommandInterpreter &interpreter)
 Handles the generic bits of figuring out whether we are in an option, and if so completing it.
 

Static Public Member Functions

static Status ParseUsageMaskFromArray (StructuredData::ObjectSP obj_sp, size_t counter, uint32_t &usage_mask)
 

Private Attributes

size_t m_num_options = 0
 
std::unique_ptr< OptionDefinitionm_options_definition_up
 
std::vector< std::vector< EnumValueStorage > > m_enum_storage
 
std::vector< std::vector< OptionEnumValueElement > > m_enum_vector
 
std::vector< std::string > m_usage_container
 
CommandInterpreterm_interpreter
 
StructuredData::GenericSP m_cmd_obj_sp
 

Static Private Attributes

static std::unordered_set< std::string > g_string_storer
 

Additional Inherited Members

- Protected Types inherited from lldb_private::Options
typedef std::set< int > OptionSet
 
typedef std::vector< OptionSetOptionSetVector
 
- Protected Member Functions inherited from lldb_private::Options
OptionSetVectorGetRequiredOptions ()
 
OptionSetVectorGetOptionalOptions ()
 
bool IsASubset (const OptionSet &set_a, const OptionSet &set_b)
 
size_t OptionsSetDiff (const OptionSet &set_a, const OptionSet &set_b, OptionSet &diffs)
 
void OptionsSetUnion (const OptionSet &set_a, const OptionSet &set_b, OptionSet &union_set)
 
virtual void OptionParsingStarting (ExecutionContext *execution_context)=0
 
virtual Status OptionParsingFinished (ExecutionContext *execution_context)
 
- Protected Attributes inherited from lldb_private::Options
std::vector< Optionm_getopt_table
 
OptionSet m_seen_options
 
OptionSetVector m_required_options
 
OptionSetVector m_optional_options
 

Detailed Description

Definition at line 1239 of file CommandObjectCommands.cpp.

Constructor & Destructor Documentation

◆ CommandOptions()

CommandObjectScriptingObjectParsed::CommandOptions::CommandOptions ( CommandInterpreter interpreter,
StructuredData::GenericSP  cmd_obj_sp 
)
inline

Definition at line 1241 of file CommandObjectCommands.cpp.

◆ ~CommandOptions()

CommandObjectScriptingObjectParsed::CommandOptions::~CommandOptions ( )
overridedefault

Member Function Documentation

◆ GetDefinitions()

llvm::ArrayRef< OptionDefinition > CommandObjectScriptingObjectParsed::CommandOptions::GetDefinitions ( )
inlineoverridevirtual

◆ GetNumOptions()

size_t CommandObjectScriptingObjectParsed::CommandOptions::GetNumOptions ( )
inline

Definition at line 1638 of file CommandObjectCommands.cpp.

References m_num_options.

Referenced by CommandObjectScriptingObjectParsed::GetOptions().

◆ HandleOptionArgumentCompletion()

void CommandObjectScriptingObjectParsed::CommandOptions::HandleOptionArgumentCompletion ( lldb_private::CompletionRequest request,
OptionElementVector opt_element_vector,
int  opt_element_index,
CommandInterpreter interpreter 
)
inlineoverridevirtual

Handles the generic bits of figuring out whether we are in an option, and if so completing it.

Parameters
[in,out]requestThe completion request that we need to act upon.
[in]interpreterThe command interpreter doing the completion.

Reimplemented from lldb_private::Options.

Definition at line 1726 of file CommandObjectCommands.cpp.

References lldb_private::CompletionRequest::GetCursorCharPos(), lldb_private::CommandInterpreter::GetDebugger(), GetDefinitions(), lldb_private::CommandInterpreter::GetExecutionContext(), lldb_private::Debugger::GetScriptInterpreter(), lldb_private::Options::HandleOptionArgumentCompletion(), lldb_private::ScriptInterpreter::HandleOptionArgumentCompletionForScriptedCommand(), m_cmd_obj_sp, PrepareOptionsForCompletion(), and ProcessCompletionDict().

◆ OptionParsingStarting()

void CommandObjectScriptingObjectParsed::CommandOptions::OptionParsingStarting ( ExecutionContext execution_context)
inlineoverridevirtual

◆ ParseUsageMaskFromArray()

static Status CommandObjectScriptingObjectParsed::CommandOptions::ParseUsageMaskFromArray ( StructuredData::ObjectSP  obj_sp,
size_t  counter,
uint32_t &  usage_mask 
)
inlinestatic

◆ PrepareOptionsForCompletion()

void CommandObjectScriptingObjectParsed::CommandOptions::PrepareOptionsForCompletion ( CompletionRequest request,
OptionElementVector option_vec,
ExecutionContext exe_ctx 
)
inline

◆ ProcessCompletionDict()

void CommandObjectScriptingObjectParsed::CommandOptions::ProcessCompletionDict ( CompletionRequest request,
StructuredData::DictionarySP completion_dict_sp 
)
inline

◆ SetOptionsFromArray()

Status CommandObjectScriptingObjectParsed::CommandOptions::SetOptionsFromArray ( StructuredData::Dictionary options)
inline

Definition at line 1395 of file CommandObjectCommands.cpp.

References lldb_private::OptionDefinition::argument_type, lldb_private::OptionDefinition::completion_type, lldb::eArgTypeLastArg, lldb::eArgTypeNone, lldb::eCustomCompletion, lldb::eNoCompletion, lldb_private::OptionDefinition::enum_values, error(), lldb_private::StructuredData::Dictionary::ForEach(), lldb_private::StructuredData::Array::ForEach(), lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormatv(), g_string_storer, lldb_private::StructuredData::Object::GetAsArray(), lldb_private::StructuredData::Object::GetAsBoolean(), lldb_private::StructuredData::Object::GetAsDictionary(), lldb_private::StructuredData::Object::GetAsUnsignedInteger(), lldb_private::StructuredData::Array::GetItemAtIndex(), lldb_private::StructuredData::Array::GetSize(), lldb_private::StructuredData::Dictionary::GetSize(), lldb_private::StructuredData::Integer< N >::GetValue(), lldb_private::StructuredData::Boolean::GetValue(), lldb_private::StructuredData::Dictionary::GetValueForKey(), lldb_private::OptionDefinition::long_option, m_enum_storage, m_enum_vector, m_num_options, m_options_definition_up, m_usage_container, lldb_private::OptionDefinition::option_has_arg, ParseUsageMaskFromArray(), lldb_private::OptionDefinition::required, lldb_private::OptionDefinition::short_option, lldb_private::OptionDefinition::usage_mask, lldb_private::OptionDefinition::usage_text, and lldb_private::OptionDefinition::validator.

Referenced by CommandObjectScriptingObjectParsed::CommandObjectScriptingObjectParsed().

◆ SetOptionValue()

Status CommandObjectScriptingObjectParsed::CommandOptions::SetOptionValue ( uint32_t  option_idx,
llvm::StringRef  option_arg,
ExecutionContext execution_context 
)
inlineoverridevirtual

Set the value of an option.

Parameters
[in]option_idxThe index into the "struct option" array that was returned by Options::GetLongOptions().
[in]option_argThe argument value for the option that the user entered, or nullptr if there is no argument for the current option.
[in]execution_contextThe execution context to use for evaluating the option. May be nullptr if the option is to be evaluated outside any particular context.
See also
Args::ParseOptions (Options&)
man getopt_long_only

Implements lldb_private::Options.

Definition at line 1247 of file CommandObjectCommands.cpp.

References error(), lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormatv(), lldb_private::CommandInterpreter::GetDebugger(), lldb_private::Debugger::GetScriptInterpreter(), m_cmd_obj_sp, m_interpreter, m_options_definition_up, and lldb_private::ScriptInterpreter::SetOptionValueForCommandObject().

Referenced by PrepareOptionsForCompletion().

Member Data Documentation

◆ g_string_storer

std::unordered_set< std::string > CommandObjectScriptingObjectParsed::CommandOptions::g_string_storer
staticprivate

Definition at line 1815 of file CommandObjectCommands.cpp.

Referenced by SetOptionsFromArray().

◆ m_cmd_obj_sp

StructuredData::GenericSP CommandObjectScriptingObjectParsed::CommandOptions::m_cmd_obj_sp
private

◆ m_enum_storage

std::vector<std::vector<EnumValueStorage> > CommandObjectScriptingObjectParsed::CommandOptions::m_enum_storage
private

Definition at line 1810 of file CommandObjectCommands.cpp.

Referenced by SetOptionsFromArray().

◆ m_enum_vector

std::vector<std::vector<OptionEnumValueElement> > CommandObjectScriptingObjectParsed::CommandOptions::m_enum_vector
private

Definition at line 1811 of file CommandObjectCommands.cpp.

Referenced by SetOptionsFromArray().

◆ m_interpreter

CommandInterpreter& CommandObjectScriptingObjectParsed::CommandOptions::m_interpreter
private

Definition at line 1813 of file CommandObjectCommands.cpp.

Referenced by OptionParsingStarting(), and SetOptionValue().

◆ m_num_options

size_t CommandObjectScriptingObjectParsed::CommandOptions::m_num_options = 0
private

Definition at line 1808 of file CommandObjectCommands.cpp.

Referenced by GetDefinitions(), GetNumOptions(), and SetOptionsFromArray().

◆ m_options_definition_up

std::unique_ptr<OptionDefinition> CommandObjectScriptingObjectParsed::CommandOptions::m_options_definition_up
private

Definition at line 1809 of file CommandObjectCommands.cpp.

Referenced by GetDefinitions(), SetOptionsFromArray(), and SetOptionValue().

◆ m_usage_container

std::vector<std::string> CommandObjectScriptingObjectParsed::CommandOptions::m_usage_container
private

Definition at line 1812 of file CommandObjectCommands.cpp.

Referenced by SetOptionsFromArray().


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