コード例 #1
0
 public SwitchCast(KaitaiStream p__io, KaitaiStruct p__parent = null, SwitchCast p__root = null) : base(p__io)
 {
     m_parent    = p__parent;
     m_root      = p__root ?? this;
     f_firstObj  = false;
     f_secondVal = false;
     f_errCast   = false;
     _read();
 }
コード例 #2
0
        public void TestSwitchCast()
        {
            var r = SwitchCast.FromFile(SourceFile("switch_opcodes.bin"));

            Assert.AreEqual(r.FirstObj.Value, "foobar");
            Assert.AreEqual(r.SecondVal, 0x42);
            Assert.Throws <InvalidCastException>(
                delegate {
                var tmp = r.ErrCast;
            }
                );
        }
コード例 #3
0
 public Intval(KaitaiStream p__io, SwitchCast.Opcode p__parent = null, SwitchCast p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root;
     _read();
 }