/// <summary> /// Returns clr object represented by given StackValue. It handles /// DS primitive types such as Int, Double, Bool, Char, String and /// Pointer if the pointer represents an FFI object. For other cases /// it returns null. /// </summary> /// <param name="sv">StackValue</param> /// <param name="core">ProtoCore.Core</param> /// <returns>System.Object</returns> internal static object GetData(StackValue sv, RuntimeCore runtimeCore) { switch (sv.optype) { case AddressType.Int: return(sv.opdata); case AddressType.Double: return(sv.RawDoubleValue); case AddressType.Boolean: return(sv.opdata != 0); case AddressType.Char: return(Convert.ToChar(sv.opdata)); case AddressType.String: return(StringUtils.GetStringValue(sv, runtimeCore)); case AddressType.Pointer: return(dataProvider.GetCLRObject(sv, runtimeCore)); default: break; } return(null); }
/// <summary> /// Returns clr object represented by given StackValue. It handles /// DS primitive types such as Int, Double, Bool, Char, String and /// Pointer if the pointer represents an FFI object. For other cases /// it returns null. /// </summary> /// <param name="sv">StackValue</param> /// <param name="core">ProtoCore.Core</param> /// <returns>System.Object</returns> internal static object GetData(StackValue sv, Core core) { switch (sv.optype) { case AddressType.Int: return(sv.opdata); case AddressType.Double: return(sv.opdata_d); case AddressType.Boolean: return(sv.opdata != 0); case AddressType.Char: return(ProtoCore.Utils.EncodingUtils.ConvertInt64ToCharacter(sv.opdata)); case AddressType.String: return(StringUtils.GetStringValue(sv, core)); case AddressType.Pointer: return(dataProvider.GetCLRObject(sv, core)); default: break; } return(null); }