1 //===-- OptionGroupOutputFile.h ---------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef liblldb_OptionGroupOutputFile_h_
11 #define liblldb_OptionGroupOutputFile_h_
12 
13 #include "lldb/Interpreter/OptionValueBoolean.h"
14 #include "lldb/Interpreter/OptionValueFileSpec.h"
15 #include "lldb/Interpreter/Options.h"
16 
17 namespace lldb_private {
18 //-------------------------------------------------------------------------
19 // OptionGroupOutputFile
20 //-------------------------------------------------------------------------
21 
22 class OptionGroupOutputFile : public OptionGroup {
23 public:
24   OptionGroupOutputFile();
25 
26   ~OptionGroupOutputFile() override;
27 
28   llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
29 
30   Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
31                         ExecutionContext *execution_context) override;
32   Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
33 
34   void OptionParsingStarting(ExecutionContext *execution_context) override;
35 
GetFile()36   const OptionValueFileSpec &GetFile() { return m_file; }
37 
GetAppend()38   const OptionValueBoolean &GetAppend() { return m_append; }
39 
AnyOptionWasSet()40   bool AnyOptionWasSet() const {
41     return m_file.OptionWasSet() || m_append.OptionWasSet();
42   }
43 
44 protected:
45   OptionValueFileSpec m_file;
46   OptionValueBoolean m_append;
47 };
48 
49 } // namespace lldb_private
50 
51 #endif // liblldb_OptionGroupOutputFile_h_
52