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