Files
BinaryObjectScanner/BurnOutSharp/External/libmspack/CHM/Header.cs
2022-05-19 11:20:44 -07:00

136 lines
4.7 KiB
C#

/* libmspack -- a library for working with Microsoft compression formats.
* (C) 2003-2019 Stuart Caie <kyzer@cabextract.org.uk>
*
* libmspack is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License (LGPL) version 2.1
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
namespace LibMSPackSharp.CHM
{
/// <summary>
/// A structure which represents a CHM helpfile.
///
/// All fields are READ ONLY.
/// </summary>
public class Header
{
/// <summary>
/// The version of the CHM file format used in this file.
/// </summary>
public uint Version { get; set; }
/// <summary>
/// The "timestamp" of the CHM helpfile.
///
/// It is the lower 32 bits of a 64-bit value representing the number of
/// centiseconds since 1601-01-01 00:00:00 UTC, plus 42. It is not useful
/// as a timestamp, but it is useful as a semi-unique ID.
/// </summary>
public uint Timestamp { get; set; }
/// <summary>
/// The default Language and Country ID (LCID) of the user who ran the
/// HTMLHelp Compiler. This is not the language of the CHM file itself.
/// </summary>
public uint Language { get; set; }
/// <summary>
/// The filename of the CHM helpfile. This is given by the library user
/// and may be in any format.
/// </summary>
public string Filename { get; set; }
/// <summary>
/// The length of the CHM helpfile, in bytes.
/// </summary>
public long Length { get; set; }
/// <summary>
/// A list of all non-system files in the CHM helpfile.
/// </summary>
public DecompressFile Files { get; set; }
/// <summary>
/// A list of all system files in the CHM helpfile.
///
/// System files are files which begin with "::". They are meta-files
/// generated by the CHM creation process.
/// </summary>
public DecompressFile SysFiles { get; set; }
/// <summary>
/// The section 0 (uncompressed) data in this CHM helpfile.
/// </summary>
public UncompressedSection Sec0 { get; set; }
/// <summary>
/// The section 1 (MSCompressed) data in this CHM helpfile.
/// </summary>
public MSCompressedSection Sec1 { get; set; }
/// <summary>
/// The file offset of the first PMGL/PMGI directory chunk.
/// </summary>
public long DirOffset { get; set; }
/// <summary>
/// The number of PMGL/PMGI directory chunks in this CHM helpfile.
/// </summary>
public uint NumChunks { get; set; }
/// <summary>
/// The size of each PMGL/PMGI chunk, in bytes.
/// </summary>
public uint ChunkSize { get; set; }
/// <summary>
/// The "density" of the quick-reference section in PMGL/PMGI chunks.
/// </summary>
public uint Density { get; set; }
/// <summary>
/// The depth of the index tree.
///
/// - if 1, there are no PMGI chunks, only PMGL chunks.
/// - if 2, there is 1 PMGI chunk. All chunk indices point to PMGL chunks.
/// - if 3, the root PMGI chunk points to secondary PMGI chunks, which in turn point to PMGL chunks.
/// - and so on...
/// </summary>
public uint Depth { get; set; }
/// <summary>
/// The number of the root PMGI chunk.
///
/// If there is no index in the CHM helpfile, this will be 0xFFFFFFFF.
/// </summary>
public uint IndexRoot { get; set; }
/// <summary>
/// The number of the first PMGL chunk. Usually zero.
/// Available only in CHM decoder version 2 and above.
/// </summary>
public uint FirstPMGL { get; set; }
/// <summary>
/// The number of the last PMGL chunk. Usually num_chunks-1.
/// Available only in CHM decoder version 2 and above.
/// </summary>
public uint LastPMGL { get; set; }
/// <summary>
/// A cache of loaded chunks, filled in by mschm_decoder::fast_find().
/// Available only in CHM decoder version 2 and above.
/// </summary>
public byte[][] ChunkCache { get; set; }
}
}