ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
dbgtypedemangler.hpp
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of the \aliblong. It does not belong to an \alibmod and is
4 * included in any \alibdist.
5 *
6 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
7 * Published under \ref mainpage_license "Boost Software License".
8 *
9 * \note
10 * To reduce complexity, this header is not shown in inclusion graphs of this documentation.
11 **************************************************************************************************/
12#ifndef HPP_ALIB_LANG_DBGTYPEDEMANGLER
13#define HPP_ALIB_LANG_DBGTYPEDEMANGLER 1
14
15#if !defined(HPP_ALIB) && !defined(ALIB_DOX)
16# include "alib/alib.hpp"
17#endif
18
19#if ALIB_DEBUG
20
21// #################################################################################################
22// Type De-mangling
23// #################################################################################################
24#if !defined (_TYPEINFO) && !defined(_TYPEINFO_)
25 #include <typeinfo>
26#endif
27
28namespace alib::lang {
29
30/** ********************************************************************************************
31 * Retrieves human readable names from C++ run-time type information.<br>
32 * This class is available only with debug builds of \alib.
33 **********************************************************************************************/
35{
36 protected:
37 /** The translated name name. */
38 const char* name;
39
40 public:
41 /** ************************************************************************************
42 * Constructor
43 * @param typeInfo The information struct on the C++ type.
44 **************************************************************************************/
46 DbgTypeDemangler( const std::type_info& typeInfo );
47
48 /** ************************************************************************************
49 * Destructor
50 **************************************************************************************/
53
54 /** ************************************************************************************
55 * Returns the demangled, human readable name of the type which was provided in the
56 * constructor.
57 * @return The demangled type name.
58 **************************************************************************************/
60 const char* Get();
61}; // class DbgTypeDemangler
62
63} // namespace [alib::lang]
64
65#endif // ALIB_DEBUG
66
67#endif // HPP_ALIB_LANG_DBGTYPEDEMANGLER
ALIB_API const char * Get()
ALIB_API DbgTypeDemangler(const std::type_info &typeInfo)
#define ALIB_API
Definition alib.hpp:538