1 //===-- OptionValueFileColonLine.h ------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_INTERPRETER_OPTIONVALUEFILECOLONLINE_H 10 #define LLDB_INTERPRETER_OPTIONVALUEFILECOLONLINE_H 11 12 #include "lldb/Interpreter/CommandCompletions.h" 13 #include "lldb/Interpreter/OptionValue.h" 14 #include "lldb/Utility/FileSpec.h" 15 #include "llvm/Support/Chrono.h" 16 17 namespace lldb_private { 18 19 class OptionValueFileColonLine : 20 public Cloneable<OptionValueFileColonLine, OptionValue> { 21 public: 22 OptionValueFileColonLine(); 23 OptionValueFileColonLine(const llvm::StringRef input); 24 25 ~OptionValueFileColonLine() override = default; 26 GetType()27 OptionValue::Type GetType() const override { return eTypeFileLineColumn; } 28 29 void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, 30 uint32_t dump_mask) override; 31 32 llvm::json::Value ToJSON(const ExecutionContext *exe_ctx) const override; 33 34 Status 35 SetValueFromString(llvm::StringRef value, 36 VarSetOperationType op = eVarSetOperationAssign) override; 37 Clear()38 void Clear() override { 39 m_file_spec.Clear(); 40 m_line_number = LLDB_INVALID_LINE_NUMBER; 41 m_column_number = LLDB_INVALID_COLUMN_NUMBER; 42 } 43 44 void AutoComplete(CommandInterpreter &interpreter, 45 CompletionRequest &request) override; 46 GetFileSpec()47 FileSpec &GetFileSpec() { return m_file_spec; } GetLineNumber()48 uint32_t GetLineNumber() { return m_line_number; } GetColumnNumber()49 uint32_t GetColumnNumber() { return m_column_number; } 50 SetCompletionMask(uint32_t mask)51 void SetCompletionMask(uint32_t mask) { m_completion_mask = mask; } 52 53 protected: 54 FileSpec m_file_spec; 55 uint32_t m_line_number = LLDB_INVALID_LINE_NUMBER; 56 uint32_t m_column_number = LLDB_INVALID_COLUMN_NUMBER; 57 uint32_t m_completion_mask = lldb::eSourceFileCompletion; 58 }; 59 60 } // namespace lldb_private 61 62 #endif // LLDB_INTERPRETER_OPTIONVALUEFILECOLONLINE_H 63