This commit is contained in:
2008-10-03 11:09:04 +00:00
parent a775337ba0
commit 4ea65e4bf6
10 changed files with 361 additions and 220 deletions

View File

@@ -15,8 +15,12 @@ namespace fmtxml
private StreamWriter strGenXml;
private string genName;
public GenToXml(string nm)
private string MyPath;
private string MyResPath;
public GenToXml(string nm, string path, string resPath)
{
MyPath = path;
MyResPath = resPath;
genName = nm;
try
{
@@ -32,9 +36,9 @@ namespace fmtxml
public void OpenFiles()
{
if (!Directory.Exists("E:\\proms.net\\genmac.xml\\convert"))
Directory.CreateDirectory("E:\\proms.net\\genmac.xml\\convert");
string fnm = "E:\\proms.net\\genmac.xml\\convert\\" + genName;
if (!Directory.Exists(MyResPath + @"\genmacall\convert"))
Directory.CreateDirectory(MyResPath + @"\genmacall\convert");
string fnm = MyResPath + @"\genmacall\convert" + @"\" + genName;
string outnm = fnm.Substring(0,fnm.LastIndexOf(".")) + ".xml";
strGenXml = new StreamWriter(outnm,false,System.Text.Encoding.ASCII);
}
@@ -50,7 +54,7 @@ namespace fmtxml
try
{
// use regular expressions to read in the genmac C file and convert to XML.
StreamReader sr = new StreamReader("E:\\promsnt\\genmac\\preproc\\"+genName);
StreamReader sr = new StreamReader(MyPath + @"\preproc\"+genName);
linein = sr.ReadToEnd();
sr.Close();
}