Files
SabreTools/SabreTools.Library/DatFiles/DatHeader.cs

247 lines
6.8 KiB
C#
Raw Normal View History

using System;
using SabreTools.Library.Data;
2017-10-06 20:46:43 -07:00
namespace SabreTools.Library.DatFiles
{
2019-01-08 11:06:26 -08:00
/// <summary>
/// Represents all possible DAT header information
/// </summary>
public class DatHeader : ICloneable
{
#region Publicly facing variables
#region Data common to most DAT types
/// <summary>
/// External name of the DAT
/// </summary>
2019-01-08 11:06:26 -08:00
public string FileName { get; set; }
/// <summary>
/// Internal name of the DAT
/// </summary>
2019-01-08 11:06:26 -08:00
public string Name { get; set; }
/// <summary>
/// DAT description
/// </summary>
2019-01-08 11:06:26 -08:00
public string Description { get; set; }
/// <summary>
/// Root directory for the files; currently TruRip/EmuARC-exclusive
/// </summary>
2019-01-08 11:06:26 -08:00
public string RootDir { get; set; }
/// <summary>
/// General category of items found in the DAT
/// </summary>
2019-01-08 11:06:26 -08:00
public string Category { get; set; }
/// <summary>
/// Version of the DAT
/// </summary>
2019-01-08 11:06:26 -08:00
public string Version { get; set; }
/// <summary>
/// Creation or modification date
/// </summary>
2019-01-08 11:06:26 -08:00
public string Date { get; set; }
/// <summary>
/// List of authors who contributed to the DAT
/// </summary>
2019-01-08 11:06:26 -08:00
public string Author { get; set; }
/// <summary>
/// Email address for DAT author(s)
/// </summary>
2019-01-08 11:06:26 -08:00
public string Email { get; set; }
/// <summary>
/// Author or distribution homepage name
/// </summary>
2019-01-08 11:06:26 -08:00
public string Homepage { get; set; }
/// <summary>
/// Author or distribution URL
/// </summary>
2019-01-08 11:06:26 -08:00
public string Url { get; set; }
/// <summary>
/// Any comment that does not already fit an existing field
/// </summary>
2019-01-08 11:06:26 -08:00
public string Comment { get; set; }
/// <summary>
/// Header skipper to be used when loading the DAT
/// </summary>
2019-01-08 11:06:26 -08:00
public string Header { get; set; }
/// <summary>
/// Classification of the DAT. Generally only used for SuperDAT
/// </summary>
public string Type { get; set; }
/// <summary>
/// Force a merging style when loaded
/// </summary>
2019-01-08 11:06:26 -08:00
public ForceMerging ForceMerging { get; set; }
/// <summary>
/// Force nodump handling when loaded
/// </summary>
2019-01-08 11:06:26 -08:00
public ForceNodump ForceNodump { get; set; }
/// <summary>
/// Force output packing when loaded
/// </summary>
2019-01-08 11:06:26 -08:00
public ForcePacking ForcePacking { get; set; }
/// <summary>
/// Read or write format
/// </summary>
2019-01-08 11:06:26 -08:00
public DatFormat DatFormat { get; set; }
/// <summary>
/// List of fields in machine and items to exclude from writing
/// </summary>
2019-01-08 11:06:26 -08:00
public bool[] ExcludeFields { get; set; } = new bool[Enum.GetNames(typeof(Field)).Length];
/// <summary>
/// Enable "One Rom, One Region (1G1R)" mode
/// </summary>
2019-01-08 11:06:26 -08:00
public bool OneRom { get; set; }
/// <summary>
/// Keep machines that don't contain any items
/// </summary>
2019-01-08 11:06:26 -08:00
public bool KeepEmptyGames { get; set; }
/// <summary>
/// Remove scene dates from the beginning of machine names
/// </summary>
2019-01-08 11:06:26 -08:00
public bool SceneDateStrip { get; set; }
/// <summary>
/// Deduplicate items using the given method
/// </summary>
2019-01-08 11:06:26 -08:00
public DedupeType DedupeRoms { get; set; }
/// <summary>
/// Strip hash types from items
/// </summary>
2019-01-08 11:06:26 -08:00
public Hash StripHash { get; private set; }
#endregion
#region Write pre-processing
/// <summary>
/// Text to prepend to all outputted lines
/// </summary>
2019-01-08 11:06:26 -08:00
public string Prefix { get; set; }
/// <summary>
/// Text to append to all outputted lines
/// </summary>
2019-01-08 11:06:26 -08:00
public string Postfix { get; set; }
/// <summary>
/// Add a new extension to all items
/// </summary>
2019-01-08 11:06:26 -08:00
public string AddExtension { get; set; }
/// <summary>
/// Replace all item extensions
/// </summary>
public string ReplaceExtension { get; set; }
/// <summary>
/// Remove all item extensions
/// </summary>
2019-01-08 11:06:26 -08:00
public bool RemoveExtension { get; set; }
/// <summary>
/// Romba output mode
/// </summary>
2019-01-08 11:06:26 -08:00
public bool Romba { get; set; }
/// <summary>
/// Output the machine name
/// </summary>
public bool GameName { get; set; }
/// <summary>
/// Wrap quotes around the entire line, sans prefix and postfix
/// </summary>
public bool Quotes { get; set; }
#endregion
#region Data specific to the Miss DAT type
/// <summary>
/// Output the item name
/// </summary>
public bool UseRomName { get; set; }
#endregion
2019-01-08 11:06:26 -08:00
#endregion
2019-01-08 11:06:26 -08:00
#region Instance Methods
2019-01-08 11:06:26 -08:00
#region Cloning Methods
2019-01-08 11:06:26 -08:00
/// <summary>
/// Clone the current header
/// </summary>
/// <returns></returns>
public object Clone()
{
return new DatHeader()
{
FileName = this.FileName,
Name = this.Name,
Description = this.Description,
RootDir = this.RootDir,
Category = this.Category,
Version = this.Version,
Date = this.Date,
Author = this.Author,
Email = this.Email,
Homepage = this.Homepage,
Url = this.Url,
Comment = this.Comment,
Header = this.Header,
Type = this.Type,
ForceMerging = this.ForceMerging,
ForceNodump = this.ForceNodump,
ForcePacking = this.ForcePacking,
DatFormat = this.DatFormat,
ExcludeFields = this.ExcludeFields,
OneRom = this.OneRom,
KeepEmptyGames = this.KeepEmptyGames,
SceneDateStrip = this.SceneDateStrip,
DedupeRoms = this.DedupeRoms,
StripHash = this.StripHash,
2019-01-08 11:06:26 -08:00
UseRomName = this.UseRomName,
Prefix = this.Prefix,
Postfix = this.Postfix,
Quotes = this.Quotes,
ReplaceExtension = this.ReplaceExtension,
AddExtension = this.AddExtension,
RemoveExtension = this.RemoveExtension,
GameName = this.GameName,
Romba = this.Romba,
};
}
2019-01-08 11:06:26 -08:00
#endregion
2019-01-08 11:06:26 -08:00
#endregion // Instance Methods
}
}