mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[SabreTools] Add rootdir output and read
This commit is contained in:
@@ -143,6 +143,7 @@ Options:
|
|||||||
-f=, --filename= Set a new filename
|
-f=, --filename= Set a new filename
|
||||||
-n=, --name= Set a new internal name
|
-n=, --name= Set a new internal name
|
||||||
-de=, --desc= Set a new description
|
-de=, --desc= Set a new description
|
||||||
|
-r=, --root= Set a new rootdir
|
||||||
-ca=, --category= Set a new category
|
-ca=, --category= Set a new category
|
||||||
-v=, --version= Set a new version
|
-v=, --version= Set a new version
|
||||||
-da=, --date= Set a new date
|
-da=, --date= Set a new date
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ namespace SabreTools.Helper
|
|||||||
public string FileName;
|
public string FileName;
|
||||||
public string Name;
|
public string Name;
|
||||||
public string Description;
|
public string Description;
|
||||||
|
public string RootDir;
|
||||||
public string Category;
|
public string Category;
|
||||||
public string Version;
|
public string Version;
|
||||||
public string Date;
|
public string Date;
|
||||||
|
|||||||
@@ -362,6 +362,9 @@ namespace SabreTools.Helper
|
|||||||
case "description":
|
case "description":
|
||||||
datdata.Description = (String.IsNullOrEmpty(datdata.Description) ? itemval : datdata.Description);
|
datdata.Description = (String.IsNullOrEmpty(datdata.Description) ? itemval : datdata.Description);
|
||||||
break;
|
break;
|
||||||
|
case "rootdir":
|
||||||
|
datdata.RootDir = (String.IsNullOrEmpty(datdata.RootDir) ? itemval : datdata.RootDir);
|
||||||
|
break;
|
||||||
case "category":
|
case "category":
|
||||||
datdata.Category = (String.IsNullOrEmpty(datdata.Category) ? itemval : datdata.Category);
|
datdata.Category = (String.IsNullOrEmpty(datdata.Category) ? itemval : datdata.Category);
|
||||||
break;
|
break;
|
||||||
@@ -773,6 +776,10 @@ namespace SabreTools.Helper
|
|||||||
content = headreader.ReadElementContentAsString();
|
content = headreader.ReadElementContentAsString();
|
||||||
datdata.Description = (String.IsNullOrEmpty(datdata.Description) ? content : datdata.Description);
|
datdata.Description = (String.IsNullOrEmpty(datdata.Description) ? content : datdata.Description);
|
||||||
break;
|
break;
|
||||||
|
case "rootdir":
|
||||||
|
content = headreader.ReadElementContentAsString();
|
||||||
|
datdata.RootDir = (String.IsNullOrEmpty(datdata.RootDir) ? content : datdata.RootDir);
|
||||||
|
break;
|
||||||
case "category":
|
case "category":
|
||||||
content = headreader.ReadElementContentAsString();
|
content = headreader.ReadElementContentAsString();
|
||||||
datdata.Category = (String.IsNullOrEmpty(datdata.Category) ? content : datdata.Category);
|
datdata.Category = (String.IsNullOrEmpty(datdata.Category) ? content : datdata.Category);
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ namespace SabreTools.Helper
|
|||||||
header = "clrmamepro (\n" +
|
header = "clrmamepro (\n" +
|
||||||
"\tname \"" + datdata.Name + "\"\n" +
|
"\tname \"" + datdata.Name + "\"\n" +
|
||||||
"\tdescription \"" + datdata.Description + "\"\n" +
|
"\tdescription \"" + datdata.Description + "\"\n" +
|
||||||
|
"\trootdir \"" + datdata.RootDir + "\"\n" +
|
||||||
"\tcategory \"" + datdata.Category + "\"\n" +
|
"\tcategory \"" + datdata.Category + "\"\n" +
|
||||||
"\tversion \"" + datdata.Version + "\"\n" +
|
"\tversion \"" + datdata.Version + "\"\n" +
|
||||||
"\tdate \"" + datdata.Date + "\"\n" +
|
"\tdate \"" + datdata.Date + "\"\n" +
|
||||||
@@ -186,6 +187,7 @@ namespace SabreTools.Helper
|
|||||||
"\t<header>\n" +
|
"\t<header>\n" +
|
||||||
"\t\t<name>" + HttpUtility.HtmlEncode(datdata.Name) + "</name>\n" +
|
"\t\t<name>" + HttpUtility.HtmlEncode(datdata.Name) + "</name>\n" +
|
||||||
"\t\t<description>" + HttpUtility.HtmlEncode(datdata.Description) + "</description>\n" +
|
"\t\t<description>" + HttpUtility.HtmlEncode(datdata.Description) + "</description>\n" +
|
||||||
|
"\t\t<rootdir>" + HttpUtility.HtmlEncode(datdata.RootDir) + "</rootdir>\n" +
|
||||||
"\t\t<category>" + HttpUtility.HtmlEncode(datdata.Category) + "</category>\n" +
|
"\t\t<category>" + HttpUtility.HtmlEncode(datdata.Category) + "</category>\n" +
|
||||||
"\t\t<version>" + HttpUtility.HtmlEncode(datdata.Version) + "</version>\n" +
|
"\t\t<version>" + HttpUtility.HtmlEncode(datdata.Version) + "</version>\n" +
|
||||||
"\t\t<date>" + HttpUtility.HtmlEncode(datdata.Date) + "</date>\n" +
|
"\t\t<date>" + HttpUtility.HtmlEncode(datdata.Date) + "</date>\n" +
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ namespace SabreTools
|
|||||||
/// <param name="filename">New filename</param>
|
/// <param name="filename">New filename</param>
|
||||||
/// <param name="name">New name</param>
|
/// <param name="name">New name</param>
|
||||||
/// <param name="description">New description</param>
|
/// <param name="description">New description</param>
|
||||||
|
/// <param name="rootdir">New rootdir</param>
|
||||||
/// <param name="category">New category</param>
|
/// <param name="category">New category</param>
|
||||||
/// <param name="version">New version</param>
|
/// <param name="version">New version</param>
|
||||||
/// <param name="date">New date</param>
|
/// <param name="date">New date</param>
|
||||||
@@ -138,6 +139,7 @@ namespace SabreTools
|
|||||||
string filename,
|
string filename,
|
||||||
string name,
|
string name,
|
||||||
string description,
|
string description,
|
||||||
|
string rootdir,
|
||||||
string category,
|
string category,
|
||||||
string version,
|
string version,
|
||||||
string date,
|
string date,
|
||||||
@@ -287,6 +289,7 @@ namespace SabreTools
|
|||||||
FileName = filename,
|
FileName = filename,
|
||||||
Name = name,
|
Name = name,
|
||||||
Description = description,
|
Description = description,
|
||||||
|
RootDir = rootdir,
|
||||||
Category = category,
|
Category = category,
|
||||||
Version = version,
|
Version = version,
|
||||||
Date = date,
|
Date = date,
|
||||||
|
|||||||
@@ -155,10 +155,11 @@ namespace SabreTools
|
|||||||
repext = "",
|
repext = "",
|
||||||
romname = "",
|
romname = "",
|
||||||
romtype = "",
|
romtype = "",
|
||||||
|
root = "",
|
||||||
|
rootdir = "",
|
||||||
sha1 = "",
|
sha1 = "",
|
||||||
sources = "",
|
sources = "",
|
||||||
systems = "",
|
systems = "",
|
||||||
root = "",
|
|
||||||
tempdir = "",
|
tempdir = "",
|
||||||
url = "",
|
url = "",
|
||||||
version = "";
|
version = "";
|
||||||
@@ -487,6 +488,10 @@ namespace SabreTools
|
|||||||
{
|
{
|
||||||
prefix = temparg.Split('=')[1];
|
prefix = temparg.Split('=')[1];
|
||||||
}
|
}
|
||||||
|
else if (temparg.StartsWith("-r=") || temparg.StartsWith("--root="))
|
||||||
|
{
|
||||||
|
rootdir = temparg.Split('=')[1];
|
||||||
|
}
|
||||||
else if (temparg.StartsWith("-rd=") || temparg.StartsWith("--root-dir="))
|
else if (temparg.StartsWith("-rd=") || temparg.StartsWith("--root-dir="))
|
||||||
{
|
{
|
||||||
root = temparg.Split('=')[1];
|
root = temparg.Split('=')[1];
|
||||||
@@ -640,7 +645,7 @@ namespace SabreTools
|
|||||||
// Convert, update, merge, diff, and filter a DAT or folder of DATs
|
// Convert, update, merge, diff, and filter a DAT or folder of DATs
|
||||||
else if (update || outputCMP || outputMiss || outputRC || outputSD || outputXML || merge || diff)
|
else if (update || outputCMP || outputMiss || outputRC || outputSD || outputXML || merge || diff)
|
||||||
{
|
{
|
||||||
InitUpdate(inputs, filename, name, description, category, version, date, author, email, homepage, url, comment, header,
|
InitUpdate(inputs, filename, name, description, rootdir, category, version, date, author, email, homepage, url, comment, header,
|
||||||
superdat, forcemerge, forcend, forcepack, outputCMP, outputMiss, outputRC, outputSD, outputXML, usegame, prefix,
|
superdat, forcemerge, forcend, forcepack, outputCMP, outputMiss, outputRC, outputSD, outputXML, usegame, prefix,
|
||||||
postfix, quotes, repext, addext, datprefix, romba, tsv, merge, diff, cascade, inplace, bare, gamename, romname,
|
postfix, quotes, repext, addext, datprefix, romba, tsv, merge, diff, cascade, inplace, bare, gamename, romname,
|
||||||
romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, outdir, clean, softlist, dedup);
|
romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, outdir, clean, softlist, dedup);
|
||||||
|
|||||||
Reference in New Issue
Block a user