blob: a71998f3bc1a753a74a51175e23f310417e76e99 [file] [log] [blame]
Andrew Walbran3d2c1972020-04-07 12:24:26 +01001//===-- OptionGroupOutputFile.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
Olivier Deprezf4ef2d02021-04-20 13:36:24 +02009#ifndef LLDB_INTERPRETER_OPTIONGROUPOUTPUTFILE_H
10#define LLDB_INTERPRETER_OPTIONGROUPOUTPUTFILE_H
Andrew Walbran3d2c1972020-04-07 12:24:26 +010011
12#include "lldb/Interpreter/OptionValueBoolean.h"
13#include "lldb/Interpreter/OptionValueFileSpec.h"
14#include "lldb/Interpreter/Options.h"
15
16namespace lldb_private {
17// OptionGroupOutputFile
18
19class OptionGroupOutputFile : public OptionGroup {
20public:
21 OptionGroupOutputFile();
22
23 ~OptionGroupOutputFile() override;
24
25 llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
26
27 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value,
28 ExecutionContext *execution_context) override;
29 Status SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete;
30
31 void OptionParsingStarting(ExecutionContext *execution_context) override;
32
33 const OptionValueFileSpec &GetFile() { return m_file; }
34
35 const OptionValueBoolean &GetAppend() { return m_append; }
36
37 bool AnyOptionWasSet() const {
38 return m_file.OptionWasSet() || m_append.OptionWasSet();
39 }
40
41protected:
42 OptionValueFileSpec m_file;
43 OptionValueBoolean m_append;
44};
45
46} // namespace lldb_private
47
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020048#endif // LLDB_INTERPRETER_OPTIONGROUPOUTPUTFILE_H