using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using Biff8Excel.Interfaces; namespace Biff8Excel.Records { [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)] struct RecordINdex { public ushort opcode; public ushort length; public uint notUsed; public uint firstrowUsed; //zero based public uint lastRowUsedplus; //zero based public uint defColOffset; } internal class INdex : IRecords { RecordINdex index; int m_NumberOfRowBlocks; uint[] m_RowBlockOffsets; public INdex() { index.opcode = 0x20B; index.firstrowUsed = 0x0; index.lastRowUsedplus = 0x0; } public ushort ID { get {return index.opcode;} } public ushort RecordSize { get { return (ushort)(20 + 4 * m_NumberOfRowBlocks);} } public uint FirstRowIndex { set { index.firstrowUsed = value; } } public uint LastRowIndex { set { index.lastRowUsedplus = value; } } public uint DefColumnRecordOffset { set { index.defColOffset = value; } } public uint[] DBCellOffsets //public List DBCellOffsets { set { //m_NumberOfRowBlocks = (int)value.Length; m_NumberOfRowBlocks = value.Length; m_RowBlockOffsets = value; } } #region IRecords ³ΙΤ± public byte[] GetByte() { byte[] b; int ln = 20 + (4 * m_NumberOfRowBlocks); b = new byte[ln]; index.length = (ushort)(ln - 4); Globals.GetStructToBytes(index).CopyTo(b, 0); int pos = 20; for (int i = 0; i < m_NumberOfRowBlocks; i++, pos += 4) { BitConverter.GetBytes(m_RowBlockOffsets[i]).CopyTo(b, pos); } return b; } #endregion } }