parameters: (sig)
return_statement: return sig.strip()
docstring: Clean everything from the C++ signature that prohibits doxygen from automatically creating the correct link.
docstring_summary: Clean everything from the C++ signature that prohibits doxygen from automatically creating the correct link.
docstring_tokens: Clean everything from the C ++ signature that prohibits doxygen from automatically creating the correct link .
function: def clean_cpp_signature(sig):
      """Clean everything from the C++ signature that prohibits doxygen from automatically creating the correct link."""
  
      def strip_defaults_from_param_sig(param_sig):
          # strip default parameter values
          split_was_at_equal_sign = [False]
          for c in param_sig:
              if c == "=":
                  split_was_at_equal_sign.append(True)
              elif c == ",":
                  split_was_at_equal_sign.append(False)
          l = param_sig.replace("=", ",").split(",")
          l = [l for l, was in zip(l, split_was_at_equal_sign) if not was]
          return ",".join(l)
  
      def strip_defaults(sig):
          pbegin = sig.index("(") + 1
          pend = sig.rindex(")")
          param_sig = sig[pbegin:pend]
          return sig[:pbegin] + strip_defaults_from_param_sig(param_sig) + sig[pend:]
  
      def strip_output(sig):
          beg = sig.index("(")
          tmp = sig[:beg].replace("*", "").replace("&", "")
          return tmp.strip().split(" ")[-1] + sig[beg:]
  
      # replace new lines
      sig = sig.replace("\n", " ")
  
      # remove semicolons
      sig = sig.replace(";", "")
  
      # remove default parameters in the signature
      sig = strip_defaults(sig)
  
      # remove output parameter from signature
      sig = strip_output(sig)
  
      # remove double whitespaces
      while "  " in sig:
          sig = sig.replace("  ", " ")
  
      # return processed signature with whitespaces stripped from beginning and end
      return sig.strip()
function_tokens: def clean_cpp_signature ( sig ) : def strip_defaults_from_param_sig ( param_sig ) : # strip default parameter values split_was_at_equal_sign = [ False ] for c in param_sig : if c == "=" : split_was_at_equal_sign . append ( True ) elif c == "," : split_was_at_equal_sign . append ( False ) l = param_sig . replace ( "=" , "," ) . split ( "," ) l = [ l for l , was in zip ( l , split_was_at_equal_sign ) if not was ] return "," . join ( l ) def strip_defaults ( sig ) : pbegin = sig . index ( "(" ) + 1 pend = sig . rindex ( ")" ) param_sig = sig [ pbegin : pend ] return sig [ : pbegin ] + strip_defaults_from_param_sig ( param_sig ) + sig [ pend : ] def strip_output ( sig ) : beg = sig . index ( "(" ) tmp = sig [ : beg ] . replace ( "*" , "" ) . replace ( "&" , "" ) return tmp . strip ( ) . split ( " " ) [ - 1 ] + sig [ beg : ] # replace new lines sig = sig . replace ( "\n" , " " ) # remove semicolons sig = sig . replace ( ";" , "" ) # remove default parameters in the signature sig = strip_defaults ( sig ) # remove output parameter from signature sig = strip_output ( sig ) # remove double whitespaces while "  " in sig : sig = sig . replace ( "  " , " " ) # return processed signature with whitespaces stripped from beginning and end return sig . strip ( )