core.demangle

The demangle module converts mangled D symbols to a representation similar to what would have existed in code.

Types 8

aliasCXX_DEMANGLER = char * function (const char * mangled_name, char * output_buffer, size_t * length, int * status) nothrow pure @trusted
private structNoHooks
private structDemangle(Hooks = NoHooks)
Fields
const(char)[] buf
Buffer dst
size_t pos
size_t brp
AddType addType
bool mute
Hooks hooks
Methods
bool isAlpha( char val )
bool isDigit( char val ) nothrow
bool isHexDigit( char val )
ubyte ascii2hex( out bool errStatus, char val ) nothrow
BufSlice shift(scope const BufSlice val) return scope
void putComma(size_t n)
void put(char c) return scope
void put(scope BufSlice val) return scope
void put(scope const(char)[] val) return scope nothrow
void putAsHex( size_t val, int width = 0 )
void pad( const(char)[] val )
void silent( out bool err_status, void delegate(out bool err_status) pure @safe nothrow dg ) nothrow
bool empty() @property
char front() @property
char peek( size_t n )
bool test( char val ) nothrow
void popFront() nothrow
void popFront(int i) nothrow
bool match( char val ) nothrow
bool match( const(char)[] val ) nothrow
void eat( char val )
bool isSymbolNameFront(out bool errStatus) nothrow
char peekBackref() nothrow
size_t decodeBackref(size_t peekAt = 0)() nothrow
const(char)[] sliceNumber() return scope
size_t decodeNumber(out bool errStatus) scope nothrow
size_t decodeNumber( out bool errStatus, scope const(char)[] num ) scope nothrow
void parseReal(out bool errStatus) scope nothrow
void parseLName(out string errMsg) scope nothrow
BufSlice parseType(out bool errStatus) return scope nothrow
void parseCallConvention(out bool errStatus) nothrow
ushort parseModifier()Returns: Flags of `TypeCtor`
ushort parseFuncAttr(out bool errStatus) nothrow
void parseFuncArguments(out bool errStatus) scope nothrow
BufSlice parseTypeFunction(out bool errStatus, IsDelegate isdg = IsDelegate.no) return scope nothrow
bool isCallConvention( char ch )
void parseValue(out bool errStatus) scope nothrow
void parseValue(out bool errStatus, scope BufSlice name, char type = '\0' ) scope nothrow
void parseIntegerValue( out bool errStatus, scope BufSlice name, char type = '\0' ) scope nothrow
void parseTemplateArgs(out bool errStatus) scope nothrow
bool mayBeMangledNameArg() nothrow
bool parseMangledNameArg() nothrow
void parseTemplateInstanceName(out bool errStatus, bool hasNumber) scope nothrow
bool mayBeTemplateInstanceName() scope nothrow
void parseSymbolName(out bool errStatus) scope nothrow
BufSlice parseFunctionTypeNoReturn( bool keepAttr = false ) return scope nothrow
void parseQualifiedName(out bool errStatus) return scope nothrow
void parseMangledName( out bool errStatus, bool displayType, size_t n = 0 ) scope nothrow
void parseMangledName(out bool errStatus) nothrow
char[] doDemangle(alias FUNC)() return scope nothrow
char[] demangleName() nothrow
char[] demangleType() nothrow
Constructors
this( return scope const(char)[] buf_, return scope char[] dst_ = null )
this( return scope const(char)[] buf_, AddType addType_, return scope char[] dst_ = null )
Nested Templates
AddType
IsDelegate
private structManglingFlagInfo
Fields
ushort flagThe flag value to use
string valueHuman-readable representation
private enumTypeCtor : ushort
None = 0
Const = (1 << 1)/ 'x'
Immutable = (1 << 2)'y'
Shared = (1 << 3)'O'
InOut = (1 << 4)
private enumFuncAttributes : ushort
None = 0
Pure = (1 << 1)/ 'a'
Nothrow = (1 << 2)/ 'b'
Ref = (1 << 3)/ 'c'
Property = (1 << 4)/ 'd'
Trusted = (1 << 5)/ 'e'
Safe = (1 << 6)/ 'f'
NoGC = (1 << 7)/ 'i'
Return = (1 << 8)/ 'j'
Scope = (1 << 9)/ 'l'
Live = (1 << 10)/ 'm'
ReturnScope = (1 << 11)Their order matter
ScopeReturn = (1 << 12)
private structBuffer
Fields
size_t minSize
private char[] dst
private size_t len
Methods
size_t length() const scope @safe pure nothrow @nogc
BufSlice opSlice(size_t from, size_t to) return scope @safe pure nothrow @nogc
bool contains(scope const(char)[] a, scope const BufSlice b) @safe nothrow
char[] copyInput(scope const(char)[] buf) return scope nothrow
private void checkAndStretchBuf(size_t len_to_add) scope nothrow
BufSlice shift(scope const BufSlice val) return scope nothrow
void remove(scope BufSlice val) scope nothrow
void append(scope const(char)[] val) scope nothrow
private scope bslice(size_t from, size_t to) nothrow
private static scope bslice_empty() nothrow
private structBufSlice
Fields
char[] buf
size_t from
size_t to
Methods
auto getSlice() inout nothrow scope
size_t length() const scope
Constructors
this(return scope char[] buf)
this(return scope char[] buf, size_t from, size_t to, bool lastArgIsLen = false)

Functions 10

fnchar[] demangle(return scope const(char)[] buf, return scope char[] dst = null, CXX_DEMANGLER __cxa_demangle = null) nothrow pure @safeDemangles D/C++ mangled names. If it is not a D/C++ mangled name, it returns its argument name.
fnchar[] demangleType( const(char)[] buf, char[] dst = null ) nothrow pure @safeDemangles a D mangled type.
fnchar[] reencodeMangled(return scope const(char)[] mangled) nothrow pure @safereencode a mangled symbol name that might include duplicate occurrences of the same identifier by replacing all but the first occurence with a back reference.
fnchar[] mangle(T)(return scope const(char)[] fqn, return scope char[] dst = null) @safe pure nothrowMangles a D symbol.
fnchar[] mangleFunc(T: FT *, FT)(return scope const(char)[] fqn, return scope char[] dst = null) if (is(FT == function)) @safe pure nothrowMangles a D function.
fnvoid pureReprintReal(char[] nptr) pure @trusted @nogc nothrow
fnvoid fakePureReprintReal(char[] nptr)
private fnstring toStringConsume(immutable ManglingFlagInfo[] infos, ref ushort base) @safe pure nothrow @nogc
fnCXX_DEMANGLER getCXXDemangler() nothrow @trustedReturns: a CXX_DEMANGLER if a C++ stdlib is loaded
private fnchar[] demangleCXX(return scope const(char)[] buf, CXX_DEMANGLER __cxa_demangle, return scope char[] dst = null,) nothrow pure @trustedDemangles C++ mangled names. If it is not a C++ mangled name, it returns its argument name.

Variables 4

private enumvarhasTypeBackRef = (int function(void * *, void * *)).mangleof[$ - 4 .. $] == "QdZi"
private varManglingFlagInfo[] typeCtors
private varManglingFlagInfo[] funcAttrs
private varCXX_DEMANGLER __cxa_demangle

Templates 3

tmplisExternD(FT) if (is(FT == function))
tmplisExternCPP(FT) if (is(FT == function))
tmplhasPlainMangling(FT) if (is(FT == function))