1 //===-- ClangNamespaceDecl.h ------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ClangNamespaceDecl_h_
11 #define liblldb_ClangNamespaceDecl_h_
15 #include "lldb/lldb-public.h"
16 #include "lldb/Core/ClangForward.h"
18 namespace lldb_private {
20 class ClangNamespaceDecl
23 ClangNamespaceDecl () :
25 m_namespace_decl (NULL)
29 ClangNamespaceDecl (clang::ASTContext *ast, clang::NamespaceDecl *namespace_decl) :
31 m_namespace_decl (namespace_decl)
35 ClangNamespaceDecl (const ClangNamespaceDecl &rhs) :
37 m_namespace_decl (rhs.m_namespace_decl)
41 const ClangNamespaceDecl &
42 operator = (const ClangNamespaceDecl &rhs)
45 m_namespace_decl = rhs.m_namespace_decl;
49 //------------------------------------------------------------------
50 /// Convert to bool operator.
52 /// This allows code to check a ClangNamespaceDecl object to see if
53 /// it contains a valid namespace decl using code such as:
56 /// ClangNamespaceDecl ns_decl(...);
62 /// /b True this object contains a valid namespace decl, \b
64 //------------------------------------------------------------------
65 explicit operator bool() const
67 return m_ast != NULL && m_namespace_decl != NULL;
77 SetASTContext (clang::ASTContext *ast)
82 clang::NamespaceDecl *
83 GetNamespaceDecl () const
85 return m_namespace_decl;
89 SetNamespaceDecl (clang::NamespaceDecl *namespace_decl)
91 m_namespace_decl = namespace_decl;
95 GetQualifiedName () const;
98 clang::ASTContext *m_ast;
99 clang::NamespaceDecl *m_namespace_decl;
103 } // namespace lldb_private
105 #endif // #ifndef liblldb_ClangNamespaceDecl_h_