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
|
||||
-n=, --name= Set a new internal name
|
||||
-de=, --desc= Set a new description
|
||||
-r=, --root= Set a new rootdir
|
||||
-ca=, --category= Set a new category
|
||||
-v=, --version= Set a new version
|
||||
-da=, --date= Set a new date
|
||||
|
||||
@@ -83,6 +83,7 @@ namespace SabreTools.Helper
|
||||
public string FileName;
|
||||
public string Name;
|
||||
public string Description;
|
||||
public string RootDir;
|
||||
public string Category;
|
||||
public string Version;
|
||||
public string Date;
|
||||
|
||||
@@ -362,6 +362,9 @@ namespace SabreTools.Helper
|
||||
case "description":
|
||||
datdata.Description = (String.IsNullOrEmpty(datdata.Description) ? itemval : datdata.Description);
|
||||
break;
|
||||
case "rootdir":
|
||||
datdata.RootDir = (String.IsNullOrEmpty(datdata.RootDir) ? itemval : datdata.RootDir);
|
||||
break;
|
||||
case "category":
|
||||
datdata.Category = (String.IsNullOrEmpty(datdata.Category) ? itemval : datdata.Category);
|
||||
break;
|
||||
@@ -773,6 +776,10 @@ namespace SabreTools.Helper
|
||||
content = headreader.ReadElementContentAsString();
|
||||
datdata.Description = (String.IsNullOrEmpty(datdata.Description) ? content : datdata.Description);
|
||||
break;
|
||||
case "rootdir":
|
||||
content = headreader.ReadElementContentAsString();
|
||||
datdata.RootDir = (String.IsNullOrEmpty(datdata.RootDir) ? content : datdata.RootDir);
|
||||
break;
|
||||
case "category":
|
||||
content = headreader.ReadElementContentAsString();
|
||||
datdata.Category = (String.IsNullOrEmpty(datdata.Category) ? content : datdata.Category);
|
||||
|
||||
@@ -147,6 +147,7 @@ namespace SabreTools.Helper
|
||||
header = "clrmamepro (\n" +
|
||||
"\tname \"" + datdata.Name + "\"\n" +
|
||||
"\tdescription \"" + datdata.Description + "\"\n" +
|
||||
"\trootdir \"" + datdata.RootDir + "\"\n" +
|
||||
"\tcategory \"" + datdata.Category + "\"\n" +
|
||||
"\tversion \"" + datdata.Version + "\"\n" +
|
||||
"\tdate \"" + datdata.Date + "\"\n" +
|
||||
@@ -186,6 +187,7 @@ namespace SabreTools.Helper
|
||||
"\t<header>\n" +
|
||||
"\t\t<name>" + HttpUtility.HtmlEncode(datdata.Name) + "</name>\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<version>" + HttpUtility.HtmlEncode(datdata.Version) + "</version>\n" +
|
||||
"\t\t<date>" + HttpUtility.HtmlEncode(datdata.Date) + "</date>\n" +
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace SabreTools
|
||||
/// <param name="filename">New filename</param>
|
||||
/// <param name="name">New name</param>
|
||||
/// <param name="description">New description</param>
|
||||
/// <param name="rootdir">New rootdir</param>
|
||||
/// <param name="category">New category</param>
|
||||
/// <param name="version">New version</param>
|
||||
/// <param name="date">New date</param>
|
||||
@@ -138,6 +139,7 @@ namespace SabreTools
|
||||
string filename,
|
||||
string name,
|
||||
string description,
|
||||
string rootdir,
|
||||
string category,
|
||||
string version,
|
||||
string date,
|
||||
@@ -287,6 +289,7 @@ namespace SabreTools
|
||||
FileName = filename,
|
||||
Name = name,
|
||||
Description = description,
|
||||
RootDir = rootdir,
|
||||
Category = category,
|
||||
Version = version,
|
||||
Date = date,
|
||||
|
||||
@@ -155,10 +155,11 @@ namespace SabreTools
|
||||
repext = "",
|
||||
romname = "",
|
||||
romtype = "",
|
||||
root = "",
|
||||
rootdir = "",
|
||||
sha1 = "",
|
||||
sources = "",
|
||||
systems = "",
|
||||
root = "",
|
||||
tempdir = "",
|
||||
url = "",
|
||||
version = "";
|
||||
@@ -487,6 +488,10 @@ namespace SabreTools
|
||||
{
|
||||
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="))
|
||||
{
|
||||
root = temparg.Split('=')[1];
|
||||
@@ -640,7 +645,7 @@ namespace SabreTools
|
||||
// Convert, update, merge, diff, and filter a DAT or folder of DATs
|
||||
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,
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user