1 //===-- SBSymbol.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/SBSymbol.h"
11 #include "lldb/Symbol/Symbol.h"
12 
13 using namespace lldb;
14 
15 
16 SBSymbol::SBSymbol () :
17     m_lldb_object_ptr (NULL)
18 {
19 }
20 
21 SBSymbol::SBSymbol (lldb_private::Symbol *lldb_object_ptr) :
22     m_lldb_object_ptr (lldb_object_ptr)
23 {
24 }
25 
26 SBSymbol::~SBSymbol ()
27 {
28     m_lldb_object_ptr = NULL;
29 }
30 
31 bool
32 SBSymbol::IsValid () const
33 {
34     return m_lldb_object_ptr != NULL;
35 }
36 
37 const char *
38 SBSymbol::GetName() const
39 {
40     if (m_lldb_object_ptr)
41         return m_lldb_object_ptr->GetMangled().GetName().AsCString();
42     return NULL;
43 }
44 
45 const char *
46 SBSymbol::GetMangledName () const
47 {
48     if (m_lldb_object_ptr)
49         return m_lldb_object_ptr->GetMangled().GetMangledName().AsCString();
50     return NULL;
51 }
52 
53 
54 bool
55 SBSymbol::operator == (const SBSymbol &rhs) const
56 {
57     return m_lldb_object_ptr == rhs.m_lldb_object_ptr;
58 }
59 
60 bool
61 SBSymbol::operator != (const SBSymbol &rhs) const
62 {
63     return m_lldb_object_ptr != rhs.m_lldb_object_ptr;
64 }
65