CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Demangle Class Reference

#include <ClassName.h>

Public Member Functions

 Demangle (const char *sc)
 
const char * operator() () const
 
 ~Demangle ()
 

Private Attributes

char * demangle
 

Detailed Description

Definition at line 15 of file ClassName.h.

Constructor & Destructor Documentation

◆ Demangle()

Demangle::Demangle ( const char *  sc)

Definition at line 5 of file ClassName.cc.

References demangle, and mps_update::status.

5  : demangle(nullptr) {
6  if (sc == nullptr)
7  return;
8  int status;
9  demangle = abi::__cxa_demangle(sc, nullptr, nullptr, &status);
10  if (status == 0)
11  return;
12  demangle = nullptr;
13  if (status == -1)
14  throw std::bad_alloc();
15  else if (status == -2) {
16  demangle = strdup(sc);
17  }
18 }
char * demangle
Definition: ClassName.h:27

◆ ~Demangle()

Demangle::~Demangle ( )
inline

Definition at line 21 of file ClassName.h.

References demangle, and free().

21  {
22  if (demangle)
23  free((void*)demangle);
24  }
void free(void *ptr) noexcept
char * demangle
Definition: ClassName.h:27

Member Function Documentation

◆ operator()()

const char* Demangle::operator() ( ) const
inline

Definition at line 19 of file ClassName.h.

References demangle.

19 { return demangle; }
char * demangle
Definition: ClassName.h:27

Member Data Documentation

◆ demangle

char* Demangle::demangle
private

Definition at line 27 of file ClassName.h.

Referenced by Demangle(), operator()(), and ~Demangle().