Inheritance: kOS.Safe.Serialization.SerializableStructure, IHasSafeSharedObjects
Exemple #1
0
        // Required for all IDumpers for them to work, but can't enforced by the interface because it's static:
        public static PathValue CreateFromDump(SafeSharedObjects shared, Dump d)
        {
            var newObj = new PathValue();

            newObj.Shared = shared;
            newObj.LoadDump(d);
            return(newObj);
        }
Exemple #2
0
        public override bool Equals(object other)
        {
            PathValue pVal = other as PathValue;

            if (!ReferenceEquals(pVal, null)) // ReferenceEquals prevents infinite recursion with overloaded == operator.
            {
                return(Path == pVal.Path);
            }
            GlobalPath gVal = other as GlobalPath;

            if (!ReferenceEquals(gVal, null)) // ReferenceEquals prevents infinite recursion with overloaded == operator.
            {
                return(Path == gVal);
            }

            // fallback:
            return(base.Equals(other));
        }
Exemple #3
0
            public override void Execute(SafeSharedObjects shared)
            {
                int remaining = CountRemainingArgs(shared);

                GlobalPath path;

                if (remaining == 0)
                {
                    path = GlobalPath.FromVolumePath(shared.VolumeMgr.CurrentDirectory.Path,
                                                     shared.VolumeMgr.GetVolumeRawIdentifier(shared.VolumeMgr.CurrentVolume));
                }
                else
                {
                    object pathObject = PopValueAssert(shared, true);
                    path = shared.VolumeMgr.GlobalPathFromObject(pathObject);
                }

                AssertArgBottomAndConsume(shared);

                ReturnValue = new PathValue(path, shared);
            }
Exemple #4
0
        public override void Execute(SharedObjects shared)
        {
            AssertArgBottomAndConsume(shared);

            int currentOpcode = shared.Cpu.GetCallTrace()[0];
            Opcode opcode = shared.Cpu.GetOpcodeAt(currentOpcode);

            ReturnValue = new PathValue(opcode.SourcePath, shared);
        }
Exemple #5
0
        public override void Execute(SharedObjects shared)
        {
            int remaining = CountRemainingArgs(shared);

            GlobalPath path;

            if (remaining == 0)
            {
                path = GlobalPath.FromVolumePath(shared.VolumeMgr.CurrentDirectory.Path,
                    shared.VolumeMgr.GetVolumeRawIdentifier(shared.VolumeMgr.CurrentVolume));
            }
            else
            {
                object pathObject = PopValueAssert(shared, true);
                path = shared.VolumeMgr.GlobalPathFromObject(pathObject);
            }

            AssertArgBottomAndConsume(shared);

            ReturnValue = new PathValue(path, shared);
        }