LLDB mainline
ScriptedMetadata.h
Go to the documentation of this file.
1//===-- ScriptedMetadata.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_SCRIPTEDMETADATA_H
10#define LLDB_INTERPRETER_SCRIPTEDMETADATA_H
11
14
15namespace lldb_private {
17public:
18 ScriptedMetadata(llvm::StringRef class_name,
20 : m_class_name(class_name.data()), m_args_sp(dict_sp) {}
21
22 ScriptedMetadata(const ProcessInfo &process_info) {
23 lldb::ScriptedMetadataSP metadata_sp = process_info.GetScriptedMetadata();
24 if (metadata_sp) {
25 m_class_name = metadata_sp->GetClassName();
26 m_args_sp = metadata_sp->GetArgsSP();
27 }
28 }
29
30 explicit operator bool() const { return !m_class_name.empty(); }
31
32 llvm::StringRef GetClassName() const { return m_class_name; }
34
35private:
36 std::string m_class_name;
38};
39} // namespace lldb_private
40
41#endif // LLDB_INTERPRETER_SCRIPTEDMETADATA_H
lldb::ScriptedMetadataSP GetScriptedMetadata() const
Definition: ProcessInfo.h:92
ScriptedMetadata(const ProcessInfo &process_info)
llvm::StringRef GetClassName() const
StructuredData::DictionarySP GetArgsSP() const
StructuredData::DictionarySP m_args_sp
ScriptedMetadata(llvm::StringRef class_name, StructuredData::DictionarySP dict_sp)
std::shared_ptr< Dictionary > DictionarySP
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
std::shared_ptr< lldb_private::ScriptedMetadata > ScriptedMetadataSP
Definition: lldb-forward.h:399