blob: 6a54c2177bf957009e96ff481bf1f582f5afa79f [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- SBModule.cpp --------------------------------------------*- 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#include "lldb/API/SBModule.h"
11#include "lldb/API/SBFileSpec.h"
12#include "lldb/Core/Module.h"
13
14using namespace lldb;
15
16
17SBModule::SBModule () :
18 m_lldb_object_sp ()
19{
20}
21
22SBModule::SBModule (const lldb::ModuleSP& module_sp) :
23 m_lldb_object_sp (module_sp)
24{
25}
26
27SBModule::~SBModule ()
28{
29}
30
31bool
32SBModule::IsValid () const
33{
34 return m_lldb_object_sp.get() != NULL;
35}
36
37SBFileSpec
38SBModule::GetFileSpec () const
39{
40 SBFileSpec file_spec;
41 if (m_lldb_object_sp)
42 file_spec.SetFileSpec(m_lldb_object_sp->GetFileSpec());
43 return file_spec;
44}
45
46const uint8_t *
47SBModule::GetUUIDBytes () const
48{
49 if (m_lldb_object_sp)
50 return (const uint8_t *)m_lldb_object_sp->GetUUID().GetBytes();
51 return NULL;
52}
53
54
55bool
56SBModule::operator == (const SBModule &rhs) const
57{
58 if (m_lldb_object_sp)
59 return m_lldb_object_sp.get() == rhs.m_lldb_object_sp.get();
60 return false;
61}
62
63bool
64SBModule::operator != (const SBModule &rhs) const
65{
66 if (m_lldb_object_sp)
67 return m_lldb_object_sp.get() != rhs.m_lldb_object_sp.get();
68 return false;
69}
70
71lldb::ModuleSP &
72SBModule::operator *()
73{
74 return m_lldb_object_sp;
75}
76
77lldb_private::Module *
78SBModule::operator ->()
79{
80 return m_lldb_object_sp.get();
81}
82
83const lldb_private::Module *
84SBModule::operator ->() const
85{
86 return m_lldb_object_sp.get();
87}
88
89lldb_private::Module *
90SBModule::get()
91{
92 return m_lldb_object_sp.get();
93}
94
95const lldb_private::Module *
96SBModule::get() const
97{
98 return m_lldb_object_sp.get();
99}
100
101
102void
103SBModule::SetModule (const lldb::ModuleSP& module_sp)
104{
105 m_lldb_object_sp = module_sp;
106}
107