LLDB
mainline
llvm-project
lldb
include
lldb
Interpreter
OptionValueFileSpecList.h
Go to the documentation of this file.
1
//===-- OptionValueFileSpecList.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_OPTIONVALUEFILESPECLIST_H
10
#define LLDB_INTERPRETER_OPTIONVALUEFILESPECLIST_H
11
12
#include <mutex>
13
14
#include "
lldb/Interpreter/OptionValue.h
"
15
#include "
lldb/Utility/FileSpecList.h
"
16
17
namespace
lldb_private
{
18
19
class
OptionValueFileSpecList
20
:
public
Cloneable
<OptionValueFileSpecList, OptionValue> {
21
public
:
22
OptionValueFileSpecList
() =
default
;
23
24
OptionValueFileSpecList
(
const
OptionValueFileSpecList
&other)
25
:
Cloneable
(other),
m_current_value
(other.
GetCurrentValue
()) {}
26
27
~OptionValueFileSpecList
()
override
=
default
;
28
29
// Virtual subclass pure virtual overrides
30
31
OptionValue::Type
GetType
()
const override
{
return
eTypeFileSpecList
; }
32
33
void
DumpValue
(
const
ExecutionContext
*exe_ctx,
Stream
&strm,
34
uint32_t dump_mask)
override
;
35
36
Status
37
SetValueFromString
(llvm::StringRef value,
38
VarSetOperationType
op =
eVarSetOperationAssign
)
override
;
39
40
void
Clear
()
override
{
41
std::lock_guard<std::recursive_mutex> lock(
m_mutex
);
42
m_current_value
.
Clear
();
43
m_value_was_set
=
false
;
44
}
45
46
bool
IsAggregateValue
()
const override
{
return
true
; }
47
48
// Subclass specific functions
49
50
FileSpecList
GetCurrentValue
()
const
{
51
std::lock_guard<std::recursive_mutex> lock(
m_mutex
);
52
return
m_current_value
;
53
}
54
55
void
SetCurrentValue
(
const
FileSpecList
&value) {
56
std::lock_guard<std::recursive_mutex> lock(
m_mutex
);
57
m_current_value
= value;
58
}
59
60
void
AppendCurrentValue
(
const
FileSpec
&value) {
61
std::lock_guard<std::recursive_mutex> lock(
m_mutex
);
62
m_current_value
.
Append
(value);
63
}
64
65
protected
:
66
lldb::OptionValueSP
Clone
()
const override
;
67
68
mutable
std::recursive_mutex
m_mutex
;
69
FileSpecList
m_current_value
;
70
};
71
72
}
// namespace lldb_private
73
74
#endif
// LLDB_INTERPRETER_OPTIONVALUEFILESPECLIST_H
FileSpecList.h
OptionValue.h
lldb_private::Cloneable
A class that implements CRTP-based "virtual constructor" idiom.
Definition:
Cloneable.h:40
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::FileSpecList
A file collection class.
Definition:
FileSpecList.h:91
lldb_private::FileSpecList::Clear
void Clear()
Clears the file list.
Definition:
FileSpecList.cpp:59
lldb_private::FileSpecList::Append
void Append(const FileSpec &file)
Append a FileSpec object to the list.
Definition:
FileSpecList.cpp:28
lldb_private::FileSpec
A file utility class.
Definition:
FileSpec.h:56
lldb_private::OptionValueFileSpecList
Definition:
OptionValueFileSpecList.h:20
lldb_private::OptionValueFileSpecList::SetValueFromString
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
Definition:
OptionValueFileSpecList.cpp:44
lldb_private::OptionValueFileSpecList::AppendCurrentValue
void AppendCurrentValue(const FileSpec &value)
Definition:
OptionValueFileSpecList.h:60
lldb_private::OptionValueFileSpecList::IsAggregateValue
bool IsAggregateValue() const override
Definition:
OptionValueFileSpecList.h:46
lldb_private::OptionValueFileSpecList::SetCurrentValue
void SetCurrentValue(const FileSpecList &value)
Definition:
OptionValueFileSpecList.h:55
lldb_private::OptionValueFileSpecList::m_current_value
FileSpecList m_current_value
Definition:
OptionValueFileSpecList.h:69
lldb_private::OptionValueFileSpecList::DumpValue
void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) override
Definition:
OptionValueFileSpecList.cpp:17
lldb_private::OptionValueFileSpecList::~OptionValueFileSpecList
~OptionValueFileSpecList() override=default
lldb_private::OptionValueFileSpecList::OptionValueFileSpecList
OptionValueFileSpecList(const OptionValueFileSpecList &other)
Definition:
OptionValueFileSpecList.h:24
lldb_private::OptionValueFileSpecList::Clone
lldb::OptionValueSP Clone() const override
Definition:
OptionValueFileSpecList.cpp:166
lldb_private::OptionValueFileSpecList::Clear
void Clear() override
Definition:
OptionValueFileSpecList.h:40
lldb_private::OptionValueFileSpecList::GetType
OptionValue::Type GetType() const override
Definition:
OptionValueFileSpecList.h:31
lldb_private::OptionValueFileSpecList::m_mutex
std::recursive_mutex m_mutex
Definition:
OptionValueFileSpecList.h:68
lldb_private::OptionValueFileSpecList::OptionValueFileSpecList
OptionValueFileSpecList()=default
lldb_private::OptionValueFileSpecList::GetCurrentValue
FileSpecList GetCurrentValue() const
Definition:
OptionValueFileSpecList.h:50
lldb_private::OptionValue::m_value_was_set
bool m_value_was_set
Definition:
OptionValue.h:347
lldb_private::OptionValue::Type
Type
Definition:
OptionValue.h:33
lldb_private::OptionValue::eTypeFileSpecList
@ eTypeFileSpecList
Definition:
OptionValue.h:44
lldb_private::Status
An error handling class.
Definition:
Status.h:115
lldb_private::Stream
A stream class that can stream formatted output to a file.
Definition:
Stream.h:28
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAddressRange.h:14
lldb_private::VarSetOperationType
VarSetOperationType
Settable state variable types.
Definition:
lldb-private-enumerations.h:86
lldb_private::eVarSetOperationAssign
@ eVarSetOperationAssign
Definition:
lldb-private-enumerations.h:93
lldb::OptionValueSP
std::shared_ptr< lldb_private::OptionValue > OptionValueSP
Definition:
lldb-forward.h:384
Generated on Fri Dec 20 2024 17:26:47 for LLDB by
1.9.6