Renamed FireLance library to GSMParser

This commit is contained in:
2020-06-27 18:49:18 +01:00
parent aaff08bae4
commit d3b8cd1b6b
27 changed files with 813 additions and 5 deletions
+47
View File
@@ -0,0 +1,47 @@
public static class QueryBuilder
{
private static string NewQueryFromCommand(string select, string from, string where, string query, bool modalRecord, bool exactMatch)
{
string _query = string.Empty;
_query += ($"SELECT \"{select}\"");
if (modalRecord == true)
{
_query += ",* ";
}
else
{
_query += " ";
}
_query += ($"FROM \"main\".\"{from}\"" +
$"WHERE \"{where}\" ");
if (exactMatch == true)
{
_query += ($"LIKE '{query}'");
}
else
{
_query += ($"LIKE '%{query}%'");
}
return _query;
}
public static string GameByName(string name)
{
return NewQueryFromCommand("GameName", "GameEntry", "GameName", name, true, false);
}
public static string GameById(string id)
{
return NewQueryFromCommand("GameName", "GameEntry", "id", id, true, true);
}
public static string DirectoryById(string id)
{
return NewQueryFromCommand("Path", "Directories", "GameID", id, true, true);
}
}