1 //===-- Language.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_Language_h_
11 #define liblldb_Language_h_
13 #include "lldb/lldb-private.h"
15 namespace lldb_private {
17 //----------------------------------------------------------------------
18 /// @class Language Language.h "lldb/Core/Language.h"
19 /// @brief Encapsulates the programming language for an lldb object.
21 /// Languages are represented by an enumeration value.
23 /// The enumeration values used when describing the programming language
24 /// are the same values as the latest DWARF specification.
25 //----------------------------------------------------------------------
29 //------------------------------------------------------------------
30 /// Construct with optional language enumeration.
31 //------------------------------------------------------------------
32 Language(lldb::LanguageType language = lldb::eLanguageTypeUnknown);
34 //------------------------------------------------------------------
37 /// The destructor is virtual in case this class is subclassed.
38 //------------------------------------------------------------------
42 //------------------------------------------------------------------
43 /// Get the language value as a NULL termianted C string.
46 /// The C string representation of the language. The returned
47 /// string does not need to be freed as it comes from constant
48 /// strings. NULL can be returned when the language is set to
49 /// a value that doesn't match of of the lldb::LanguageType
51 //------------------------------------------------------------------
53 AsCString (lldb::DescriptionLevel level = lldb::eDescriptionLevelBrief) const;
59 GetDescription (Stream *s, lldb::DescriptionLevel level) const;
61 //------------------------------------------------------------------
62 /// Dump the language value to the stream \a s.
65 /// The stream to which to dump the language description.
66 //------------------------------------------------------------------
68 Dump(Stream *s) const;
70 //------------------------------------------------------------------
71 /// Get accessor for the language.
74 /// The enumeration value that describes the programming
75 /// language that an object is associated with.
76 //------------------------------------------------------------------
77 virtual lldb::LanguageType
80 //------------------------------------------------------------------
81 /// Set accessor for the language.
83 /// @param[in] language
84 /// The new enumeration value that describes the programming
85 /// language that an object is associated with.
86 //------------------------------------------------------------------
88 SetLanguage(lldb::LanguageType language);
90 //------------------------------------------------------------------
91 /// Set accessor for the language.
93 /// @param[in] language_cstr
94 /// The language name as a C string.
95 //------------------------------------------------------------------
97 SetLanguageFromCString(const char *language_cstr);
101 //------------------------------------------------------------------
103 //------------------------------------------------------------------
104 lldb::LanguageType m_language; ///< The programming language enumeration value.
105 ///< The enumeration values are the same as the
106 ///< latest DWARF specification.
109 //--------------------------------------------------------------
110 /// Stream the language enumeration as a string object to a
112 //--------------------------------------------------------------
113 Stream& operator << (Stream& s, const Language& language);
115 } // namespace lldb_private
117 #endif // liblldb_Language_h_