fw4spl
fwCore::Demangler Class Reference

typeid, string or object name demangler. More...

#include <Demangler.hpp>

+ Inheritance diagram for fwCore::Demangler:
+ Collaboration diagram for fwCore::Demangler:

Public Member Functions

FWCORE_API std::string getLeafClassname () const
 Returns "Object" from "::some::long::namespace::Object". More...
 
FWCORE_API std::string getClassname () const
 Returns "::some::long::namespace::Object" from "::some::long::namespace::Object". More...
 
Constructor/Destructor
FWCORE_API Demangler (const std::type_info &t)
 Constructor from a typeinfo object. More...
 
FWCORE_API Demangler (const std::string &s)
 Constructor from a std::string. More...
 
template<typename T >
 Demangler (T &s)
 Constructor from any type. More...
 
virtual FWCORE_API ~Demangler ()
 Destructor.
 

Protected Member Functions

std::string demangle () const
 Process the name to demangle and return the same string whatever the OS is. More...
 

Protected Attributes

const std::string m_name
 Store the name to demangle.
 

Detailed Description

typeid, string or object name demangler.

Warning
getClassname() use on fundamentals types (int, float, ...) will give a bad result ( ex: ::int )

Definition at line 23 of file Demangler.hpp.

Constructor & Destructor Documentation

fwCore::Demangler::Demangler ( const std::type_info &  t)

Constructor from a typeinfo object.

Parameters
tTypeinfo to demangle

Definition at line 26 of file Demangler.cpp.

fwCore::Demangler::Demangler ( const std::string &  s)

Constructor from a std::string.

Parameters
sstring to demangle

Definition at line 33 of file Demangler.cpp.

template<typename T >
fwCore::Demangler::Demangler ( T &  s)
inline

Constructor from any type.

Parameters
sobject which type has to be demangled

Definition at line 50 of file Demangler.hpp.

Member Function Documentation

std::string fwCore::Demangler::demangle ( ) const
protected

Process the name to demangle and return the same string whatever the OS is.

Returns
demangled string

Definition at line 67 of file Demangler.cpp.

References m_name.

Referenced by getClassname(), and getLeafClassname().

+ Here is the caller graph for this function:

std::string fwCore::Demangler::getClassname ( ) const

Returns "::some::long::namespace::Object" from "::some::long::namespace::Object".

Returns
demangled class name with all namespaces from root

Definition at line 59 of file Demangler.cpp.

References demangle().

+ Here is the call graph for this function:

std::string fwCore::Demangler::getLeafClassname ( ) const

Returns "Object" from "::some::long::namespace::Object".

Returns
demangled class name only

Definition at line 46 of file Demangler.cpp.

References demangle().

+ Here is the call graph for this function:


The documentation for this class was generated from the following files: