private:
friend class Args;
std::unique_ptr<char[]> ptr;
+ char quote;
char *data() { return ptr.get(); }
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.
// 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())
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;
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;
}