示例#1
0
        public override String ToString()
        {
            StringBuilder buffer = new StringBuilder();

            buffer.Append("[AI]\n");
            buffer.Append("    .linkType             = ")
            .Append(HexDump.ByteToHex(LinkType)).Append('\n');
            buffer.Append(Environment.NewLine);
            buffer.Append("    .referenceType        = ").Append(HexDump.ByteToHex(ReferenceType)).Append('\n');
            buffer.Append(Environment.NewLine);
            buffer.Append("    .options              = ").Append(HexDump.ShortToHex(Options)).Append('\n');
            buffer.Append(Environment.NewLine);
            buffer.Append("         .customNumberFormat       = ").Append(IsCustomNumberFormat).Append('\n');
            buffer.Append("    .indexNumberFmtRecord = ")
            .Append(HexDump.ShortToHex(IndexNumberFmtRecord)).Append('\n');
            buffer.Append(Environment.NewLine);
            buffer.Append("    .formulaOfLink        = ");
            Ptg[] ptgs = field_5_formulaOfLink.Tokens;
            for (int i = 0; i < ptgs.Length; i++)
            {
                Ptg ptg = ptgs[i];
                buffer.Append(ptg.ToString()).Append(ptg.RVAType).Append('\n');
            }

            buffer.Append("[/AI]\n");
            return(buffer.ToString());
        }
示例#2
0
        public override String ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("[ftPictFmla]\n");
            sb.Append("    .f2unknown     = ").Append(HexDump.IntToHex(field_1_unknown_int)).Append("\n");
            if (field_2_refPtg == null)
            {
                sb.Append("    .f3unknown     = ").Append(HexDump.ToHex(field_2_unknownFormulaData)).Append("\n");
            }
            else
            {
                sb.Append("    .formula       = ").Append(field_2_refPtg.ToString()).Append("\n");
            }
            if (field_4_ole_classname != null)
            {
                sb.Append("    .unicodeFlag   = ").Append(field_3_unicode_flag).Append("\n");
                sb.Append("    .oleClassname  = ").Append(field_4_ole_classname).Append("\n");
            }
            if (field_4_unknownByte != null)
            {
                sb.Append("    .f4unknown   = ").Append(HexDump.ByteToHex(Convert.ToByte(field_4_unknownByte, CultureInfo.InvariantCulture))).Append("\n");
            }
            if (field_5_stream_id != null)
            {
                sb.Append("    .streamId      = ").Append(HexDump.IntToHex(Convert.ToInt32(field_5_stream_id, CultureInfo.InvariantCulture))).Append("\n");
            }
            if (field_6_unknown.Length > 0)
            {
                sb.Append("    .f7unknown     = ").Append(HexDump.ToHex(field_6_unknown)).Append("\n");
            }
            sb.Append("[/ftPictFmla]");
            return(sb.ToString());
        }
示例#3
0
        public override String ToString()
        {
            StringBuilder buffer = new StringBuilder();

            buffer.Append("[BOUNDSHEET]\n");
            buffer.Append("    .bof        = ").Append(HexDump.IntToHex(PositionOfBof)).Append("\n");
            buffer.Append("    .visibility = ").Append(HexDump.ShortToHex(field_2_visibility)).Append("\n");
            buffer.Append("    .type       = ").Append(HexDump.ByteToHex(field_3_type)).Append("\n");
            buffer.Append("    .sheetname  = ").Append(Sheetname).Append("\n");
            buffer.Append("[/BOUNDSHEET]\n");
            return(buffer.ToString());
        }
示例#4
0
        public override String ToString()
        {
            StringBuilder buffer = new StringBuilder();

            buffer.Append("[BOUNDSHEET]\n");
            buffer.Append("    .bof        = ").Append(HexDump.IntToHex(PositionOfBof)).Append("\n");
            buffer.Append("    .options    = ").Append(HexDump.ShortToHex(field_2_option_flags)).Append("\n");
            buffer.Append("    .unicodeflag= ").Append(HexDump.ByteToHex(field_4_isMultibyteUnicode)).Append("\n");
            buffer.Append("    .sheetname  = ").Append(field_5_sheetname).Append("\n");
            buffer.Append("[/BOUNDSHEET]\n");
            return(buffer.ToString());
        }
        public override String ToString()
        {
            StringBuilder buffer = new StringBuilder();

            buffer.Append("[CHARTFRTINFO]\n");
            buffer.Append("    .rt           =").Append(HexDump.ShortToHex(rt)).Append('\n');
            buffer.Append("    .grbitFrt     =").Append(HexDump.ShortToHex(grbitFrt)).Append('\n');
            buffer.Append("    .verOriginator=").Append(HexDump.ByteToHex(verOriginator)).Append('\n');
            buffer.Append("    .verWriter    =").Append(HexDump.ByteToHex(verOriginator)).Append('\n');
            buffer.Append("    .nCFRTIDs     =").Append(HexDump.ShortToHex(rgCFRTID.Length)).Append('\n');
            buffer.Append("[/CHARTFRTINFO]\n");
            return(buffer.ToString());
        }
示例#6
0
        public override string ToString()
        {
            StringBuilder buffer = new StringBuilder();

            buffer.Append("[SXVDEX]\n");

            buffer.Append("    .grbit1 =").Append(HexDump.IntToHex(grbit1)).Append("\n");
            buffer.Append("    .grbit2 =").Append(HexDump.ByteToHex(grbit2)).Append("\n");
            buffer.Append("    .citmShow =").Append(HexDump.ByteToHex(citmShow)).Append("\n");
            buffer.Append("    .isxdiSort =").Append(HexDump.ShortToHex(isxdiSort)).Append("\n");
            buffer.Append("    .isxdiShow =").Append(HexDump.ShortToHex(isxdiShow)).Append("\n");
            buffer.Append("    .subName =").Append(subName).Append("\n");
            buffer.Append("[/SXVDEX]\n");
            return(buffer.ToString());
        }
示例#7
0
        public override String ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("[NAMECMT]\n");
            sb.Append("    .record type            = ").Append(HexDump.ShortToHex(field_1_record_type)).Append("\n");
            sb.Append("    .frt cell ref flag      = ").Append(HexDump.ByteToHex(field_2_frt_cell_ref_flag)).Append("\n");
            sb.Append("    .reserved               = ").Append(field_3_reserved).Append("\n");
            sb.Append("    .name length            = ").Append(field_6_name_text.Length).Append("\n");
            sb.Append("    .comment length         = ").Append(field_7_comment_text.Length).Append("\n");
            sb.Append("    .name                   = ").Append(field_6_name_text).Append("\n");
            sb.Append("    .comment                = ").Append(field_7_comment_text).Append("\n");
            sb.Append("[/NAMECMT]\n");

            return(sb.ToString());
        }
示例#8
0
        public override String ToString()
        {
            StringBuilder buffer = new StringBuilder();

            buffer.Append("[TABLE]\n");
            buffer.Append("    .range    = ").Append(Range.ToString()).Append("\n");
            buffer.Append("    .flags    = ").Append(HexDump.ByteToHex(field_5_flags)).Append("\n");
            buffer.Append("    .alwaysClc= ").Append(IsAlwaysCalc).Append("\n");
            buffer.Append("    .reserved = ").Append(HexDump.IntToHex(field_6_res)).Append("\n");
            CellReference crRowInput = cr(field_7_rowInputRow, field_8_colInputRow);
            CellReference crColInput = cr(field_9_rowInputCol, field_10_colInputCol);

            buffer.Append("    .rowInput = ").Append(crRowInput.FormatAsString()).Append("\n");
            buffer.Append("    .colInput = ").Append(crColInput.FormatAsString()).Append("\n");
            buffer.Append("[/TABLE]\n");
            return(buffer.ToString());
        }
示例#9
0
        private static void CheckZeros(Stream in1, int avail)
        {
            int count = 0;

            while (true)
            {
                int b = (int)in1.ReadByte();
                if (b < 0)
                {
                    break;
                }
                if (b != 0)
                {
                    Console.Error.WriteLine(HexDump.ByteToHex(b));
                }
                count++;
            }
            if (avail != count)
            {
                Console.Error.WriteLine("avail!=count (" + avail + "!=" + count + ").");
            }
        }
示例#10
0
        /// <summary>
        /// Confirms data sections are equal
        /// </summary>
        /// <param name="msgPrefix">message prefix to be displayed in case of failure</param>
        /// <param name="expectedSid"></param>
        /// <param name="expectedData">just raw data (without ushort sid, ushort size)</param>
        /// <param name="actualRecordBytes">this includes 4 prefix bytes (sid & size)</param>
        public static void ConfirmRecordEncoding(String msgPrefix, int expectedSid, byte[] expectedData, byte[] actualRecordBytes)
        {
            int expectedDataSize = expectedData.Length;

            Assert.AreEqual(actualRecordBytes.Length - 4, expectedDataSize, "Size of encode data mismatch");
            Assert.AreEqual(expectedSid, LittleEndian.GetShort(actualRecordBytes, 0));
            Assert.AreEqual(expectedDataSize, LittleEndian.GetShort(actualRecordBytes, 2));
            for (int i = 0; i < expectedDataSize; i++)
            {
                if (expectedData[i] != actualRecordBytes[i + 4])
                {
                    StringBuilder sb = new StringBuilder(64);
                    if (msgPrefix != null)
                    {
                        sb.Append(msgPrefix).Append(": ");
                    }
                    sb.Append("At offset ").Append(i);
                    sb.Append(": expected ").Append(HexDump.ByteToHex(expectedData[i]));
                    sb.Append(" but found ").Append(HexDump.ByteToHex(actualRecordBytes[i + 4]));
                    throw new AssertionException(sb.ToString());
                }
            }
        }
示例#11
0
        // end builtin records
        public override String ToString()
        {
            StringBuilder buffer = new StringBuilder();

            buffer.Append("[STYLE]\n");
            buffer.Append("    .xf_index_raw    = ")
            .Append(HexDump.ShortToHex(field_1_xf_index)).Append("\n");
            buffer.Append("        .type        = ")
            .Append(IsBuiltin?"built-in":"user-defined").Append("\n");
            buffer.Append("        .xf_index    = ")
            .Append(HexDump.ShortToHex(XFIndex)).Append("\n");
            if (IsBuiltin)
            {
                buffer.Append("    .builtin_style   = ").Append(HexDump.ByteToHex(field_2_builtin_style)).Append("\n");
                buffer.Append("    .outline_level   = ").Append(HexDump.ByteToHex(field_3_outline_style_level)).Append("\n");
            }
            else
            {
                buffer.Append("    .name            = ").Append(Name).Append("\n");
            }
            buffer.Append("[/STYLE]\n");
            return(buffer.ToString());
        }
示例#12
0
 public void ConfirmByte(int expVal)
 {
     cmp(HexDump.ByteToHex(expVal), HexDump.ByteToHex(_bds.ReadUByte()));
 }