]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - source/Interpreter/OptionGroupUInt64.cpp
Vendor import of lldb trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / source / Interpreter / OptionGroupUInt64.cpp
1 //===-- OptionGroupUInt64.cpp ----------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "lldb/Interpreter/OptionGroupUInt64.h"
11
12 #include "lldb/Host/OptionParser.h"
13
14 using namespace lldb;
15 using namespace lldb_private;
16
17 OptionGroupUInt64::OptionGroupUInt64(uint32_t usage_mask, bool required,
18                                      const char *long_option, int short_option,
19                                      uint32_t completion_type,
20                                      lldb::CommandArgumentType argument_type,
21                                      const char *usage_text,
22                                      uint64_t default_value)
23     : m_value(default_value, default_value) {
24   m_option_definition.usage_mask = usage_mask;
25   m_option_definition.required = required;
26   m_option_definition.long_option = long_option;
27   m_option_definition.short_option = short_option;
28   m_option_definition.validator = nullptr;
29   m_option_definition.option_has_arg = OptionParser::eRequiredArgument;
30   m_option_definition.enum_values = {};
31   m_option_definition.completion_type = completion_type;
32   m_option_definition.argument_type = argument_type;
33   m_option_definition.usage_text = usage_text;
34 }
35
36 OptionGroupUInt64::~OptionGroupUInt64() {}
37
38 Status OptionGroupUInt64::SetOptionValue(uint32_t option_idx,
39                                          llvm::StringRef option_arg,
40                                          ExecutionContext *execution_context) {
41   Status error(m_value.SetValueFromString(option_arg));
42   return error;
43 }
44
45 void OptionGroupUInt64::OptionParsingStarting(
46     ExecutionContext *execution_context) {
47   m_value.Clear();
48 }