mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Improved Object.ToString for boxed values
This commit is contained in:
parent
200f95bede
commit
5cfe9e6196
1 changed files with 14 additions and 4 deletions
|
@ -94,10 +94,20 @@ namespace System
|
||||||
|
|
||||||
public virtual void ToString(String strBuffer)
|
public virtual void ToString(String strBuffer)
|
||||||
{
|
{
|
||||||
//strBuffer.Set(stack string(GetType().mName));
|
let t = RawGetType();
|
||||||
RawGetType().GetName(strBuffer);
|
if (t.IsBoxedStructPtr)
|
||||||
strBuffer.Append("@");
|
{
|
||||||
((int)Internal.UnsafeCastToPtr(this)).ToString(strBuffer, "X", null);
|
let ti = (TypeInstance)t;
|
||||||
|
let innerPtr = *(void**)((uint8*)Internal.UnsafeCastToPtr(this) + ti.[Friend]mMemberDataOffset);
|
||||||
|
strBuffer.Append("(");
|
||||||
|
ti.UnderlyingType.GetFullName(strBuffer);
|
||||||
|
strBuffer.AppendF("*)0x{0:A}", (uint)(void*)innerPtr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
t.GetFullName(strBuffer);
|
||||||
|
strBuffer.Append("@0x");
|
||||||
|
|
||||||
|
((int)Internal.UnsafeCastToPtr(this)).ToString(strBuffer, "A", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ToString(Object obj, String strBuffer)
|
private static void ToString(Object obj, String strBuffer)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue