Refactor OptionValue::SetValueFromCString to use llvm::StringRef

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7676

llvm-svn: 230005
This commit is contained in:
Pavel Labath
2015-02-20 11:14:59 +00:00
parent 0c5f059865
commit c95f7e2a7c
48 changed files with 130 additions and 152 deletions

View File

@@ -36,7 +36,7 @@ OptionValueFormat::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uin
}
Error
OptionValueFormat::SetValueFromCString (const char *value_cstr, VarSetOperationType op)
OptionValueFormat::SetValueFromString (llvm::StringRef value, VarSetOperationType op)
{
Error error;
switch (op)
@@ -50,7 +50,7 @@ OptionValueFormat::SetValueFromCString (const char *value_cstr, VarSetOperationT
case eVarSetOperationAssign:
{
Format new_format;
error = Args::StringToFormat (value_cstr, new_format, nullptr);
error = Args::StringToFormat (value.str().c_str(), new_format, nullptr);
if (error.Success())
{
m_value_was_set = true;
@@ -65,7 +65,7 @@ OptionValueFormat::SetValueFromCString (const char *value_cstr, VarSetOperationT
case eVarSetOperationRemove:
case eVarSetOperationAppend:
case eVarSetOperationInvalid:
error = OptionValue::SetValueFromCString (value_cstr, op);
error = OptionValue::SetValueFromString (value, op);
break;
}
return error;