public ExprStrOps(KaitaiStream p__io, KaitaiStruct p__parent = null, ExprStrOps p__root = null) : base(p__io) { m_parent = p__parent; m_root = p__root ?? this; f_oneSubstr3To3 = false; f_toIR8 = false; f_toIR16 = false; f_twoSubstr0To10 = false; f_oneLen = false; f_twoLen = false; f_oneSubstr2To5 = false; f_toIR2 = false; f_twoRev = false; f_two = false; f_twoSubstr4To10 = false; f_toIR10 = false; f_twoSubstr0To7 = false; f_toIAttr = false; f_oneSubstr0To3 = false; f_oneRev = false; _read(); }
public void TestExprStrOps() { var r = ExprStrOps.FromFile(SourceFile("term_strz.bin")); Assert.AreEqual(r.One, "foo|b"); Assert.AreEqual(r.OneLen, 5); Assert.AreEqual(r.OneRev, "b|oof"); Assert.AreEqual(r.OneSubstr0To3, "foo"); Assert.AreEqual(r.OneSubstr2To5, "o|b"); Assert.AreEqual(r.OneSubstr3To3, ""); Assert.AreEqual(r.Two, "0123456789"); Assert.AreEqual(r.TwoLen, 10); Assert.AreEqual(r.TwoRev, "9876543210"); Assert.AreEqual(r.TwoSubstr0To7, "0123456"); Assert.AreEqual(r.TwoSubstr4To10, "456789"); Assert.AreEqual(r.TwoSubstr0To10, "0123456789"); Assert.AreEqual(r.ToIAttr, 9173); Assert.AreEqual(r.ToIR10, -72); Assert.AreEqual(r.ToIR2, 86); Assert.AreEqual(r.ToIR8, 465); Assert.AreEqual(r.ToIR16, 18383); }