mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +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)
|
||||
{
|
||||
//strBuffer.Set(stack string(GetType().mName));
|
||||
RawGetType().GetName(strBuffer);
|
||||
strBuffer.Append("@");
|
||||
((int)Internal.UnsafeCastToPtr(this)).ToString(strBuffer, "X", null);
|
||||
let t = RawGetType();
|
||||
if (t.IsBoxedStructPtr)
|
||||
{
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue