module CXXFilt

Constants

VERSION

Public Class Methods

auto() click to toggle source
static VALUE cxxfilt_get_auto(VALUE self) {
  return v_auto_demangler;
}
demangle(p1, p2 = v2) click to toggle source
static VALUE cxxfilt_demangle(int argc, VALUE *argv, VALUE self) {
  VALUE v_mangled_name;
  VALUE v_mangling_style;
  rb_scan_args(argc, argv, "11", &v_mangled_name, &v_mangling_style);

  enum demangling_styles style = auto_demangling;
  if(!NIL_P(v_mangling_style)) {
    style = cplus_demangle_name_to_style(StringValueCStr(v_mangling_style));
  }

  if(style == unknown_demangling) {
    rb_raise(rb_eRuntimeError, "no such demangling style '%s' was found", StringValueCStr(v_mangling_style)); // TODO: make an actual exception class to raise here
  }

  cplus_demangle_set_style(style);
  char *result;
  result = cplus_demangle(StringValueCStr(v_mangled_name), DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE);
  if(result == NULL) {
    return Qnil;
  }
  VALUE v_result = rb_str_new_cstr(result);
  free(result);
  return v_result;
}
demanglers() click to toggle source
# File lib/cxxfilt/cxxfilt.rb, line 13
def self.demanglers
  @demanglers
end
method_missing(sym, *args) click to toggle source
Calls superclass method
# File lib/cxxfilt/cxxfilt.rb, line 17
def self.method_missing(sym, *args)
  if @demangler_map.include?(sym) then
    return @demangler_map[sym]
  end
  super
end
respond_to_missing?(sym, include_private=false) click to toggle source
Calls superclass method
# File lib/cxxfilt/cxxfilt.rb, line 24
def self.respond_to_missing?(sym, include_private=false)
  @demangler_map.include?(sym) || super
end