[monodoc] Add BaseFilePath property to HelpSource to determine the full folder path...
authorJeremie Laval <jeremie.laval@gmail.com>
Mon, 13 Feb 2012 16:39:20 +0000 (17:39 +0100)
committerJeremie Laval <jeremie.laval@gmail.com>
Mon, 13 Feb 2012 16:45:27 +0000 (17:45 +0100)
This module is really one of the most ugly looking code you will ever find in the Mono tree. A savory mix of all .NET idioms since 1.1, totally anarchic class layout, helpers and hacks everywhere make your eyes bleed continously.

mcs/tools/monodoc/Monodoc/provider.cs

index 100c5c2afb2df977a463f1737283aa8cba67666b..38db7012efeec287ac428c0b89155613840748ec 100644 (file)
@@ -448,6 +448,7 @@ public class HelpSource {
        int source_id;
        DateTime zipFileWriteTime;
        string name;
+       string basepath;
        TraceLevel trace_level = TraceLevel.Warning;
        protected bool nozip;
        protected string base_dir;
@@ -455,6 +456,7 @@ public class HelpSource {
        public HelpSource (string base_filename, bool create)
        {
                this.name = Path.GetFileName (base_filename);
+               this.basepath = Path.GetDirectoryName (base_filename);
                tree_filename = base_filename + ".tree";
                zip_filename = base_filename + ".zip";
                base_dir = XmlDocUtils.GetCacheDirectory (base_filename);
@@ -499,6 +501,13 @@ public class HelpSource {
                }
        }
 
+       /* This gives the full path of the source/ directory */
+       public string BaseFilePath {
+               get {
+                       return basepath;
+               }
+       }
+
        public TraceLevel TraceLevel {
                get { return trace_level; }
                set { trace_level = value; }
@@ -907,7 +916,6 @@ public class RootTree : Tree {
                                .Concat (osxExternalSources));
        }
 
-
        // Compatibility shim w/ Mono 2.6
        public static RootTree LoadTree (string indexDir, XmlDocument docTree, IEnumerable sourceFiles)
        {
@@ -1215,7 +1223,7 @@ public class RootTree : Tree {
                        return lastHelpSourceTime;
                }
        }
-       
+
        public static bool GetNamespaceAndType (string url, out string ns, out string type)
        {
                int nsidx = -1;