Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:58

0001 //===-- ScriptedMetadata.h ------------------------------------ -*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_INTERPRETER_SCRIPTEDMETADATA_H
0010 #define LLDB_INTERPRETER_SCRIPTEDMETADATA_H
0011 
0012 #include "lldb/Utility/ProcessInfo.h"
0013 #include "lldb/Utility/StructuredData.h"
0014 
0015 namespace lldb_private {
0016 class ScriptedMetadata {
0017 public:
0018   ScriptedMetadata(llvm::StringRef class_name,
0019                    StructuredData::DictionarySP dict_sp)
0020       : m_class_name(class_name.data()), m_args_sp(dict_sp) {}
0021 
0022   ScriptedMetadata(const ProcessInfo &process_info) {
0023     lldb::ScriptedMetadataSP metadata_sp = process_info.GetScriptedMetadata();
0024     if (metadata_sp) {
0025       m_class_name = metadata_sp->GetClassName();
0026       m_args_sp = metadata_sp->GetArgsSP();
0027     }
0028   }
0029 
0030   explicit operator bool() const { return !m_class_name.empty(); }
0031 
0032   llvm::StringRef GetClassName() const { return m_class_name; }
0033   StructuredData::DictionarySP GetArgsSP() const { return m_args_sp; }
0034 
0035 private:
0036   std::string m_class_name;
0037   StructuredData::DictionarySP m_args_sp;
0038 };
0039 } // namespace lldb_private
0040 
0041 #endif // LLDB_INTERPRETER_SCRIPTEDMETADATA_H