UltimateZoneBuilder/Source/Config/CompilerInfo.cs

103 lines
2.6 KiB
C#
Raw Normal View History

#region ================== Copyright (c) 2007 Pascal vd Heiden
/*
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#endregion
#region ================== Namespaces
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using CodeImp.DoomBuilder.IO;
using CodeImp.DoomBuilder.Data;
using System.IO;
using System.Diagnostics;
using CodeImp.DoomBuilder.Compilers;
#endregion
namespace CodeImp.DoomBuilder.Config
{
public sealed class CompilerInfo
{
#region ================== Constants
2008-11-11 16:19:50 +00:00
#endregion
2008-11-11 16:19:50 +00:00
#region ================== Variables
2008-11-11 16:19:50 +00:00
private string filename;
private string name;
private string programfile;
2008-11-11 16:19:50 +00:00
private string programinterface;
private string path;
private List<string> files;
2008-11-11 16:19:50 +00:00
#endregion
2008-11-11 16:19:50 +00:00
#region ================== Properties
public string FileName { get { return filename; } }
public string Name { get { return name; } }
public string Path { get { return path; } }
public string ProgramFile { get { return programfile; } }
2008-11-11 16:19:50 +00:00
public string ProgramInterface { get { return programinterface; } }
public List<string> Files { get { return files; } }
2008-11-11 16:19:50 +00:00
#endregion
2008-11-11 16:19:50 +00:00
#region ================== Constructor / Disposer
2008-11-11 16:19:50 +00:00
// Constructor
internal CompilerInfo(string filename, string name, string path, Configuration cfg)
{
IDictionary cfgfiles;
2008-11-11 16:19:50 +00:00
General.WriteLogLine("Registered compiler configuration '" + name + "' from '" + filename + "'");
2008-11-11 16:19:50 +00:00
// Initialize
this.filename = filename;
this.path = path;
this.name = name;
this.files = new List<string>();
2008-11-11 16:19:50 +00:00
// Read program file and interface
this.programfile = cfg.ReadSetting("compilers." + name + ".program", "");
2008-11-11 16:19:50 +00:00
this.programinterface = cfg.ReadSetting("compilers." + name + ".interface", "");
// Make list of files required
cfgfiles = cfg.ReadSetting("compilers." + name, new Hashtable());
foreach(DictionaryEntry de in cfgfiles)
2008-11-11 16:19:50 +00:00
{
if(de.Key.ToString() != "interface")
files.Add(de.Value.ToString());
}
}
2008-11-11 16:19:50 +00:00
#endregion
2008-11-11 16:19:50 +00:00
#region ================== Methods
2008-11-11 16:19:50 +00:00
// This creates the actual compiler interface
internal Compiler Create()
{
return Compiler.Create(this);
}
2008-11-11 16:19:50 +00:00
#endregion
}
}