From 2a57eb2b0fe1e0c312d09c35bbf440bbd2e1cc59 Mon Sep 17 00:00:00 2001 From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498> Date: Thu, 10 Sep 2009 02:06:02 +0000 Subject: [PATCH] Scanner Map now outputs HTML with hyper links. --- source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs | 37 +++++++++++++++++++++-- source2/Users/Kudzu/HelloWorld/Program.cs | 2 +- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs index 8eadac983..281503a6e 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs @@ -65,21 +65,52 @@ namespace Cosmos.IL2CPU { public void Dispose() { if (mLogEnabled) { + // Create bookmarks, but also a dictionary that + // we can find the items in + var xBookmarks = new Dictionary(); + int xBookmark = 0; + foreach (var xList in mLogMap) { + xBookmarks.Add(xList.Key, xBookmark); + xBookmark++; + } + //TODO: Change to output HTML with src each item hyper linked to where // it is listed under another source using (mLogWriter = new StreamWriter(mMapPathname, false)) { + mLogWriter.WriteLine(""); foreach (var xList in mLogMap) { - mLogWriter.WriteLine(); + mLogWriter.WriteLine("

"); + mLogWriter.WriteLine("

"); if (xList.Key == null) { mLogWriter.WriteLine("Unspecified Source"); } else { mLogWriter.WriteLine(xList.Key.ToString()); } + mLogWriter.WriteLine("

"); + + mLogWriter.WriteLine(""); } + mLogWriter.WriteLine(""); } } } diff --git a/source2/Users/Kudzu/HelloWorld/Program.cs b/source2/Users/Kudzu/HelloWorld/Program.cs index db4ab9862..178383167 100644 --- a/source2/Users/Kudzu/HelloWorld/Program.cs +++ b/source2/Users/Kudzu/HelloWorld/Program.cs @@ -27,7 +27,7 @@ namespace HelloWorld { xAsmblr.Initialize(); using (var xScanner = new ILScanner(xAsmblr)) { - xScanner.EnableLogging(xOutPath + "Scanner Map.txt"); + xScanner.EnableLogging(xOutPath + "Scanner Map.html"); var xEntryPoint = typeof(Program).GetMethod("Init", BindingFlags.Public | BindingFlags.Static); xScanner.Execute(xEntryPoint);