1 //===-- OptionValueFileSpec.h -----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_OptionValueFileSpec_h_
11 #define liblldb_OptionValueFileSpec_h_
15 // Other libraries and framework includes
17 #include "lldb/Host/FileSpec.h"
18 #include "lldb/Interpreter/OptionValue.h"
20 namespace lldb_private {
22 class OptionValueFileSpec : public OptionValue
25 OptionValueFileSpec ();
27 OptionValueFileSpec (const FileSpec &value);
29 OptionValueFileSpec (const FileSpec ¤t_value,
30 const FileSpec &default_value);
33 ~OptionValueFileSpec()
37 //---------------------------------------------------------------------
38 // Virtual subclass pure virtual overrides
39 //---------------------------------------------------------------------
41 virtual OptionValue::Type
48 DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
51 SetValueFromCString (const char *value,
52 VarSetOperationType op = eVarSetOperationAssign);
57 m_current_value = m_default_value;
58 m_value_was_set = false;
63 virtual lldb::OptionValueSP
67 AutoComplete (CommandInterpreter &interpreter,
69 int match_start_point,
70 int max_return_elements,
74 //---------------------------------------------------------------------
75 // Subclass specific functions
76 //---------------------------------------------------------------------
81 return m_current_value;
85 GetCurrentValue() const
87 return m_current_value;
91 GetDefaultValue() const
93 return m_default_value;
97 SetCurrentValue (const FileSpec &value, bool set_value_was_set)
99 m_current_value = value;
100 if (set_value_was_set)
101 m_value_was_set = true;
106 SetDefaultValue (const FileSpec &value)
108 m_default_value = value;
111 const lldb::DataBufferSP &
112 GetFileContents(bool null_terminate);
115 SetCompletionMask (uint32_t mask)
117 m_completion_mask = mask;
121 FileSpec m_current_value;
122 FileSpec m_default_value;
123 lldb::DataBufferSP m_data_sp;
124 uint32_t m_completion_mask;
127 } // namespace lldb_private
129 #endif // liblldb_OptionValueFileSpec_h_