diff options
author | Pavel Labath <labath@google.com> | 2018-04-10 09:03:59 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-04-10 09:03:59 +0000 |
commit | 47cbf4a07bdfe8f5ef56be7a0caf003f91a00a9e (patch) | |
tree | 9d619d8e076a6c0a5113264c2b3d96369f85e275 /lldb/source/Interpreter/Property.cpp | |
parent | bfa20dddcbf31e05be41c3bd993bf25578bfa179 (diff) | |
download | bcm5719-llvm-47cbf4a07bdfe8f5ef56be7a0caf003f91a00a9e.tar.gz bcm5719-llvm-47cbf4a07bdfe8f5ef56be7a0caf003f91a00a9e.zip |
Move Args::StringTo*** functions to a new OptionArgParser class
Summary:
The idea behind this is to move the functionality which depend on other lldb
classes into a separate class. This way, the Args class can be turned
into a lightweight arc+argv wrapper and moved into the lower lldb
layers.
Reviewers: jingham, zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D44306
llvm-svn: 329677
Diffstat (limited to 'lldb/source/Interpreter/Property.cpp')
-rw-r--r-- | lldb/source/Interpreter/Property.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/source/Interpreter/Property.cpp b/lldb/source/Interpreter/Property.cpp index 5bac5ea0002..7e55da2f396 100644 --- a/lldb/source/Interpreter/Property.cpp +++ b/lldb/source/Interpreter/Property.cpp @@ -16,6 +16,7 @@ #include "lldb/Core/UserSettingsController.h" #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionValues.h" #include "lldb/Target/Language.h" @@ -53,7 +54,7 @@ Property::Property(const PropertyDefinition &definition) // "definition.default_cstr_value" as a string value that represents the // default value. if (definition.default_cstr_value) - m_value_sp.reset(new OptionValueBoolean(Args::StringToBoolean( + m_value_sp.reset(new OptionValueBoolean(OptionArgParser::ToBoolean( llvm::StringRef(definition.default_cstr_value), false, nullptr))); else m_value_sp.reset( @@ -62,7 +63,8 @@ Property::Property(const PropertyDefinition &definition) case OptionValue::eTypeChar: { llvm::StringRef s(definition.default_cstr_value ? definition.default_cstr_value : ""); - m_value_sp = std::make_shared<OptionValueChar>(Args::StringToChar(s, '\0', nullptr)); + m_value_sp = std::make_shared<OptionValueChar>( + OptionArgParser::ToChar(s, '\0', nullptr)); break; } case OptionValue::eTypeDictionary: @@ -123,8 +125,8 @@ Property::Property(const PropertyDefinition &definition) { Format new_format = eFormatInvalid; if (definition.default_cstr_value) - Args::StringToFormat(definition.default_cstr_value, new_format, - nullptr); + OptionArgParser::ToFormat(definition.default_cstr_value, new_format, + nullptr); else new_format = (Format)definition.default_uint_value; m_value_sp.reset(new OptionValueFormat(new_format)); |