Beispiel #1
0
 //=====================================================================
 /// <summary>
 /// Writes a single entry in the symbol index file.
 /// </summary>
 /// <param name="symbolName">the name of the symbol</param>
 /// <param name="htmlFileName">link to the documentation file for this symbol</param>
 /// <param name="anchor">link to the documentation file for this symbol</param>
 /// <param name="type">the type of symbol (class, method, macro, enum, etc.)</param>
 /// <param name="container">the containing class, or null</param>
 /// <param name="sourceFileName">the source file in which the symbol was defined</param>
 /// <param name="prefix">file name prefix: "../" or ""</param>
 private void WriteSymbolIndexEntry(StreamWriter w, String symbolName,
                         String htmlFileName, String anchor, String type, 
                     Modification container, SourceLoc sourceFile, String prefix)
 {
     w.Write(Hyperlink(prefix + htmlFileName, anchor, null,
                       "<code><b>" + symbolName + "</b></code>")
             + " - " + type);
     if (container != null)
         w.WriteLine(" of "
                     + Hyperlink(prefix + this.ObjectFileName(container),
                                 container.Name));
     w.WriteLine(" in " + FileLinks(sourceFile) + "<br>");
     //  Hyperlink(prefix + this.FileFileName(sourceFile), sourceFile.Name) + "<br>");
 }
Beispiel #2
0
 //=====================================================================
 /// <summary>
 /// Returns the name of the file documentation file for the given file,
 /// relative to the OutputDir.
 /// </summary>
 private String SourceFileName(SourceLoc s)
 {
     return SourceDir + "/" + s.Name + ".html";
 }
Beispiel #3
0
 //=====================================================================
 /// <summary>
 /// Returns a pair of hyperlinks for the file file and source file.
 /// </summary>
 private String FileLinks(SourceLoc s)
 {
     return Hyperlink("../" + this.FileFileName(s), s.Name) + "[" +
         Hyperlink("../" + this.SourceFileName(s), s.Line.ToString(),
                   null, s.Line.ToString()) + "]";
 }
Beispiel #4
0
        //=====================================================================
        /// <summary>
        /// Common code for writing descriptions of things.
        /// </summary>
        /// <param name="name">the name of the symbol</param>
        /// <param name="args">arguments for methods and macros, or null</param>
        /// <param name="body">the body of the macro or template, or null</param>
        /// <param name="descr">the description</param>
        /// <param name="overridden">does this symbol override a symbol in a base class?</param>
        /// <param name="src">where the symbol was defined</param>
        /// <param name="linkSource">whether to make the source file reference a hyperlink</param>
        public void WriteThingWithDescription(
            StreamWriter w, String name, ArrayList args, 
            String body, String descr, bool overridden,
            SourceLoc src, ArrayList otherSources,
            ArrayList modMethods, bool ifcOnly)
        {
            w.WriteLine("<a name=\"" + name + "\"></a>");
            w.Write("<table class=decl><tr><td>");
            w.Write("<code>" + (ifcOnly ? "// " : "") + name);
            if (args != null)
            {
                String s = "";
                foreach (String a in args)
                    s += ", " + a;
                if (s.Length == 0)
                    s = " ";
                else
                    s = s.Substring(2);
                w.Write(" (" + s + ")");
            }
            w.Write("</code>");

            if (overridden)
                w.Write("<span class=rem>OVERRIDDEN</span>");
            if (ifcOnly)
                w.Write("<span class=rem>Interface description only</span>");

            w.Write("<td align=right><code>" + this.FileLinks(src));

            if (otherSources != null)
                foreach (SourceLoc sl in otherSources)
                    w.Write(", " + this.FileLinks(sl));

            w.Write("</table>");

            w.Write("<div class=desc>");

            if (body != null)
                w.Write("<code>" + body + "</code><br>");

            if (descr == "")
                w.Write("<i>no description available</i>");
            else
                w.Write(EncodeEntities(descr));

            w.WriteLine("<p>");

            if (modMethods != null)
            {
                foreach (MethodDef m in modMethods)
                {
                    if (m.Description != "")
                    {
                        w.WriteLine("<p><i>Modified in "
                                    + FileLinks(m.Source) + ":</i><br>");
                        w.Write(EncodeEntities(m.Description));
                        w.WriteLine("<p>");
                    }
                }
            }

            w.WriteLine("</div>");
        }
Beispiel #5
0
 //=====================================================================
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="file">the source file where the enum group was found</param>
 /// <param name="line">the line where the enum group was found</param>
 public EnumGroup(String file, int line)
 {
     this.Source = new SourceLoc(file, line);
 }
Beispiel #6
0
 //=====================================================================
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="file">the source file where the symbol was found</param>
 /// <param name="line">the line where the symbol was found</param>
 protected Symbol(String file, int line)
 {
     this.Source = new SourceLoc(file, line);
 }