public virtual int _intOnConvert( Context ctx, ConvOp type ) { switch( type ) { case ConvOp.ToBool: ctx.Push( ConvertToBool() ); return RC.SUCCESS; case ConvOp.ToString: ctx.Push( ConvertToString() ); return RC.SUCCESS; case ConvOp.Clone: Variable clone = OnClone( ctx ); if( clone != null ) ctx.Push( clone ); return clone != null ? RC.SUCCESS : RC.ENOTSUP; case ConvOp.ToIter: Variable iter = OnGetIterator( ctx ); if( iter != null ) ctx.Push( iter ); return iter != null ? RC.SUCCESS : RC.ENOTSUP; } return RC.ENOTSUP; }
public static int _sgsConvert(IntPtr ctx, IntPtr varobj, int type) { IObjectBase obj = _IP2Obj(varobj); return(obj._intOnConvert(Engine.GetCtx(ctx), (ConvOp)type)); }