Author: teemperor Date: Fri Sep 13 01:26:00 2019 New Revision: 371823 URL: http://llvm.org/viewvc/llvm-project?rev=371823&view=rev Log: [lldb][NFC] Make ArgEntry::quote private and provide a getter
Modified: lldb/trunk/include/lldb/Utility/Args.h lldb/trunk/source/API/SBCommandInterpreter.cpp lldb/trunk/source/Host/common/Editline.cpp lldb/trunk/source/Interpreter/Options.cpp Modified: lldb/trunk/include/lldb/Utility/Args.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Args.h?rev=371823&r1=371822&r2=371823&view=diff ============================================================================== --- lldb/trunk/include/lldb/Utility/Args.h (original) +++ lldb/trunk/include/lldb/Utility/Args.h Fri Sep 13 01:26:00 2019 @@ -35,6 +35,7 @@ public: private: friend class Args; std::unique_ptr<char[]> ptr; + char quote; char *data() { return ptr.get(); } @@ -43,11 +44,11 @@ public: ArgEntry(llvm::StringRef str, char quote); llvm::StringRef ref; - char quote; const char *c_str() const { return ptr.get(); } /// Returns true if this argument was quoted in any way. bool IsQuoted() const { return quote != '\0'; } + char GetQuoteChar() const { return quote; } }; /// Construct with an option command string. Modified: lldb/trunk/source/API/SBCommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandInterpreter.cpp?rev=371823&r1=371822&r2=371823&view=diff ============================================================================== --- lldb/trunk/source/API/SBCommandInterpreter.cpp (original) +++ lldb/trunk/source/API/SBCommandInterpreter.cpp Fri Sep 13 01:26:00 2019 @@ -394,7 +394,7 @@ int SBCommandInterpreter::HandleCompleti // If we matched a unique single command, add a space... Only do this if // the completer told us this was a complete word, however... if (lldb_matches.GetSize() == 1) { - char quote_char = request.GetParsedArg().quote; + char quote_char = request.GetParsedArg().GetQuoteChar(); common_prefix = Args::EscapeLLDBCommandArgument(common_prefix, quote_char); if (request.GetParsedArg().IsQuoted()) Modified: lldb/trunk/source/Host/common/Editline.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Editline.cpp?rev=371823&r1=371822&r2=371823&view=diff ============================================================================== --- lldb/trunk/source/Host/common/Editline.cpp (original) +++ lldb/trunk/source/Host/common/Editline.cpp Fri Sep 13 01:26:00 2019 @@ -949,7 +949,7 @@ unsigned char Editline::TabCommand(int c std::string to_add = completion.GetCompletion(); to_add = to_add.substr(request.GetCursorArgumentPrefix().size()); if (request.GetParsedArg().IsQuoted()) - to_add.push_back(request.GetParsedArg().quote); + to_add.push_back(request.GetParsedArg().GetQuoteChar()); to_add.push_back(' '); el_insertstr(m_editline, to_add.c_str()); break; Modified: lldb/trunk/source/Interpreter/Options.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=371823&r1=371822&r2=371823&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Options.cpp (original) +++ lldb/trunk/source/Interpreter/Options.cpp Fri Sep 13 01:26:00 2019 @@ -937,7 +937,7 @@ static Args ReconstituteArgsAfterParsing for (const char *arg : parsed) { auto pos = FindOriginalIter(arg, original); assert(pos != original.end()); - result.AppendArgument(pos->ref, pos->quote); + result.AppendArgument(pos->ref, pos->GetQuoteChar()); } return result; } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits