model_server/dd/src/ddict.h.cxx
// walk through the c++ function decl element node to generate a "demangled" name
walk through the c++ function decl element node to generate a "demangled" name
walk through the c ++ function decl element node to generate a " demangled " name
void ddElement::regenerate_name()
{
  char *p;
  char const *pc;
  int lpfix;
  int len;
  ddElementPtr parent;
  ddElementPtr ep;
  Initialize(ddElement::regenerate_name);
  p= strchr (get_ddname(), '(');
  if ( p == NULL )
    return;
  len= 0;
  parent=NULL;
  ep = member_get_class();
  if ( ep && dd_is_structure(ep->get_kind()) ) {
    len += ep->get_name_length();
    len+= 2;  
    parent= ep;
  }
  char const *pbasic= get_ddname();
  pc= strchr (get_ddname(), ':');
  if ( pc ) {
    pc++ ;
    pc++ ; 
    pbasic= pc;
  }
  else
    pc = pbasic;
  lpfix= p - pc + 1;
  genString ppname;
  if ( parent ) {
    ppname += parent->get_ddname();
    ppname += "::";
  }
  int lpfixx = lpfix + 1;
  char *ttmp = new char[lpfixx];
  strncpy(ttmp, pbasic, lpfix);
  ttmp[lpfix] = 0;
  ppname += ttmp;
  for (ddElement* chp= checked_cast(ddElement,get_first());  chp; ) {
    ppname += chp->get_def();
    chp = checked_cast(ddElement,chp->get_next());
    if (chp)
      ppname += ", ";
  }
  ppname += ")";
  if ( is_const() ) {
    ppname += " const";
  }
  if ( is_volatile() ) {
    ppname += " volatile";
  }
  genString on = get_ddname();
  delete name;
  name = strsav(ppname);
  delete old_name;
  old_name = strsav(name);
  update_name(on, 0);
  return;
}
void ddElement :: regenerate_name ( ) { char * p ; char const * pc ; int lpfix ; int len ; ddElementPtr parent ; ddElementPtr ep ; Initialize ( ddElement :: regenerate_name ) ; p = strchr ( get_ddname ( ) , ' ' ) ; if ( p == NULL ) return ; len = 0 ; parent = NULL ; ep = member_get_class ( ) ; if ( ep && dd_is_structure ( ep -> get_kind ( ) ) ) { len += ep -> get_name_length ( ) ; len += 2 ; parent = ep ; } char const * pbasic = get_ddname ( ) ; pc = strchr ( get_ddname ( ) , ' ' ) ; if ( pc ) { pc ++ ; pc ++ ; pbasic = pc ; } else pc = pbasic ; lpfix = p - pc + 1 ; genString ppname ; if ( parent ) { ppname += parent -> get_ddname ( ) ; ppname += " " ; } int lpfixx = lpfix + 1 ; char * ttmp = new char [ lpfixx ] ; strncpy ( ttmp , pbasic , lpfix ) ; ttmp [ lpfix ] = 0 ; ppname += ttmp ; for ( ddElement * chp = checked_cast ( ddElement , get_first ( ) ) ; chp ; ) { ppname += chp -> get_def ( ) ; chp = checked_cast ( ddElement , chp -> get_next ( ) ) ; if ( chp ) ppname += " " ; } ppname += " " ; if ( is_const ( ) ) { ppname += " " ; } if ( is_volatile ( ) ) { ppname += " " ; } genString on = get_ddname ( ) ; delete name ; name = strsav ( ppname ) ; delete old_name ; old_name = strsav ( name ) ; update_name ( on , 0 ) ; return ; }
walk through the c++ function decl element node to generate a "demangled" name
walk through the c ++ function decl element node to generate a " demangled " name
// how long will this name be????; // for the "::" ; // beginning of basic name; // when pc is NULL, set it to the beginning of array // + 1 is for the left parenthesis.