using System.IO; namespace FSO.Files.Formats.IFF { /// /// An IFF is made up of chunks. /// public abstract class IffChunk { public ushort ChunkID; public ushort ChunkFlags; public string ChunkType; //just making it easier to access public string ChunkLabel; public bool ChunkProcessed; public byte[] OriginalData; //IDE ONLY: always contains base data for any chunk. public ushort OriginalID; public bool AddedByPatch; public string OriginalLabel; public byte[] ChunkData; public IffFile ChunkParent; public ChunkRuntimeState RuntimeInfo = ChunkRuntimeState.Normal; /// /// Reads this chunk from an IFF. /// /// The IFF to read from. /// The stream to read from. public abstract void Read(IffFile iff, Stream stream); /// /// The name of this chunk. /// /// The name of this chunk as a string. public override string ToString() { return "#" + ChunkID.ToString() + " " + ChunkLabel; } /// /// Attempts to write this chunk to a stream (presumably an IFF or PIFF) /// /// /// /// True if data has been written, false if not. public virtual bool Write(IffFile iff, Stream stream) { return false; } public virtual void Dispose() { } } }