mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[SabreTools, DatFile] Make method signatures cleaner
This commit is contained in:
@@ -603,7 +603,7 @@ namespace SabreTools.Library.DatFiles
|
||||
_datHeader.Quotes = value;
|
||||
}
|
||||
}
|
||||
public string RepExt
|
||||
public string ReplaceExtension
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -612,7 +612,7 @@ namespace SabreTools.Library.DatFiles
|
||||
_datHeader = new DatHeader();
|
||||
}
|
||||
|
||||
return _datHeader.RepExt;
|
||||
return _datHeader.ReplaceExtension;
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -621,10 +621,10 @@ namespace SabreTools.Library.DatFiles
|
||||
_datHeader = new DatHeader();
|
||||
}
|
||||
|
||||
_datHeader.RepExt = value;
|
||||
_datHeader.ReplaceExtension = value;
|
||||
}
|
||||
}
|
||||
public string AddExt
|
||||
public string AddExtension
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -633,7 +633,7 @@ namespace SabreTools.Library.DatFiles
|
||||
_datHeader = new DatHeader();
|
||||
}
|
||||
|
||||
return _datHeader.AddExt;
|
||||
return _datHeader.AddExtension;
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -642,10 +642,10 @@ namespace SabreTools.Library.DatFiles
|
||||
_datHeader = new DatHeader();
|
||||
}
|
||||
|
||||
_datHeader.AddExt = value;
|
||||
_datHeader.AddExtension = value;
|
||||
}
|
||||
}
|
||||
public bool RemExt
|
||||
public bool RemoveExtension
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -654,7 +654,7 @@ namespace SabreTools.Library.DatFiles
|
||||
_datHeader = new DatHeader();
|
||||
}
|
||||
|
||||
return _datHeader.RemExt;
|
||||
return _datHeader.RemoveExtension;
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -663,7 +663,7 @@ namespace SabreTools.Library.DatFiles
|
||||
_datHeader = new DatHeader();
|
||||
}
|
||||
|
||||
_datHeader.RemExt = value;
|
||||
_datHeader.RemoveExtension = value;
|
||||
}
|
||||
}
|
||||
public bool GameName
|
||||
@@ -1553,6 +1553,15 @@ namespace SabreTools.Library.DatFiles
|
||||
_datHeader = (DatHeader)datFile._datHeader.Clone();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new DatFile from an existing DatHeader
|
||||
/// </summary>
|
||||
/// <param name="datHeader"></param>
|
||||
public DatFile(DatHeader datHeader)
|
||||
{
|
||||
_datHeader = (DatHeader)datHeader.Clone();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Converting and Updating
|
||||
|
||||
@@ -184,17 +184,17 @@ namespace SabreTools.Library.DatFiles
|
||||
get { return _quotes; }
|
||||
set { _quotes = value; }
|
||||
}
|
||||
public string RepExt
|
||||
public string ReplaceExtension
|
||||
{
|
||||
get { return _repExt; }
|
||||
set { _repExt = value; }
|
||||
}
|
||||
public string AddExt
|
||||
public string AddExtension
|
||||
{
|
||||
get { return _addExt; }
|
||||
set { _addExt = value; }
|
||||
}
|
||||
public bool RemExt
|
||||
public bool RemoveExtension
|
||||
{
|
||||
get { return _remExt; }
|
||||
set { _remExt = value; }
|
||||
|
||||
@@ -269,20 +269,20 @@ namespace SabreTools.Library.DatFiles
|
||||
else
|
||||
{
|
||||
name = (UseGame ? rom.MachineName : rom.Name);
|
||||
if (RepExt != "" || RemExt)
|
||||
if (ReplaceExtension != "" || RemoveExtension)
|
||||
{
|
||||
if (RemExt)
|
||||
if (RemoveExtension)
|
||||
{
|
||||
RepExt = "";
|
||||
ReplaceExtension = "";
|
||||
}
|
||||
|
||||
string dir = Path.GetDirectoryName(name);
|
||||
dir = (dir.StartsWith(Path.DirectorySeparatorChar.ToString()) ? dir.Remove(0, 1) : dir);
|
||||
name = Path.Combine(dir, Path.GetFileNameWithoutExtension(name) + RepExt);
|
||||
name = Path.Combine(dir, Path.GetFileNameWithoutExtension(name) + ReplaceExtension);
|
||||
}
|
||||
if (AddExt != "")
|
||||
if (AddExtension != "")
|
||||
{
|
||||
name += AddExt;
|
||||
name += AddExtension;
|
||||
}
|
||||
if (!UseGame && GameName)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user