LLDB  mainline
OptionGroupFile.cpp
Go to the documentation of this file.
1 //===-- OptionGroupFile.cpp -------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
11 #include "lldb/Host/OptionParser.h"
12 
13 using namespace lldb;
14 using namespace lldb_private;
15 
16 OptionGroupFile::OptionGroupFile(uint32_t usage_mask, bool required,
17  const char *long_option, int short_option,
18  uint32_t completion_type,
19  lldb::CommandArgumentType argument_type,
20  const char *usage_text)
21  : m_file() {
22  m_option_definition.usage_mask = usage_mask;
23  m_option_definition.required = required;
24  m_option_definition.long_option = long_option;
25  m_option_definition.short_option = short_option;
26  m_option_definition.validator = nullptr;
28  m_option_definition.enum_values = {};
29  m_option_definition.completion_type = completion_type;
30  m_option_definition.argument_type = argument_type;
31  m_option_definition.usage_text = usage_text;
32 }
33 
35 
37  llvm::StringRef option_arg,
38  ExecutionContext *execution_context) {
39  Status error(m_file.SetValueFromString(option_arg));
40  return error;
41 }
42 
44  ExecutionContext *execution_context) {
45  m_file.Clear();
46 }
47 
49  uint32_t usage_mask, bool required, const char *long_option,
50  int short_option, uint32_t completion_type,
51  lldb::CommandArgumentType argument_type, const char *usage_text)
52  : m_file_list() {
53  m_option_definition.usage_mask = usage_mask;
54  m_option_definition.required = required;
55  m_option_definition.long_option = long_option;
56  m_option_definition.short_option = short_option;
57  m_option_definition.validator = nullptr;
59  m_option_definition.enum_values = {};
60  m_option_definition.completion_type = completion_type;
61  m_option_definition.argument_type = argument_type;
62  m_option_definition.usage_text = usage_text;
63 }
64 
66 
67 Status
69  llvm::StringRef option_value,
70  ExecutionContext *execution_context) {
71  Status error(m_file_list.SetValueFromString(option_value));
72  return error;
73 }
74 
76  ExecutionContext *execution_context) {
78 }
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
OptionValueFileSpec m_file
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void OptionParsingStarting(ExecutionContext *execution_context) override
OptionValueFileSpecList m_file_list
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
OptionGroupFileList(uint32_t usage_mask, bool required, const char *long_option, int short_option, uint32_t completion_type, lldb::CommandArgumentType argument_type, const char *usage_text)
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
Definition: SBAddress.h:15
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
OptionDefinition m_option_definition
An error handling class.
Definition: Status.h:44