Ejemplo n.º 1
0
        public void WriteListItem(UdnWriter Writer, bool bWithType)
        {
            // Enter the object
            Writer.EnterObject(bWithType? "FunctionListItemWithType" : "FunctionListItem");

            // Get all the icons
            List <Icon> ItemIcons = new List <Icon> {
                Icons.Function[(int)Protection]
            };

            if (IsStatic)
            {
                ItemIcons.Add(Icons.StaticFunction);
            }
            if (IsVirtual)
            {
                ItemIcons.Add(Icons.VirtualFunction);
            }
            if (MetadataDirective != null)
            {
                ItemIcons.Add(Icons.ReflectedFunction);
                ItemIcons.AddRange(MetadataDirective.Icons);
            }
            Writer.WriteParam("icons", ItemIcons);

            // Write the return type
            Writer.WriteParam("type", Markdown.Truncate(ReturnType, 12, "..."));

            // Write the name
            if (Parameters.Count == 0)
            {
                Writer.WriteParam("name", Name + "()");
                Writer.WriteParam("arguments", "");
            }
            else
            {
                Writer.WriteParam("name", Name);
                Writer.EnterParam("arguments");
                if (Parameters.Count > 0)
                {
                    Writer.WriteEscapedLine("(  ");
                    for (int Idx = 0; Idx < Parameters.Count; Idx++)
                    {
                        string Separator  = (Idx + 1 == Parameters.Count) ? "" : ",";
                        string Definition = Markdown.Truncate(APIMember.RemoveElaborations(Parameters[Idx].Definition), 35, "...");
                        Writer.WriteLine(UdnWriter.TabSpaces + Definition + Separator + "  ");
                    }
                    Writer.WriteEscapedLine(")  ");
                }
                Writer.LeaveParam();
            }

            // Write the other parameters
            Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");
            Writer.WriteParam("description", BriefDescription);

            // Leave the object
            Writer.LeaveObject();
        }
Ejemplo n.º 2
0
        public void WriteListItem(UdnWriter Writer)
        {
            // Enter the object
            Writer.EnterObject("FunctionListItem");

            // Get all the icons
            List <Icon> ItemIcons = new List <Icon> {
                Icons.Function[(int)Protection]
            };

            if (IsStatic)
            {
                ItemIcons.Add(Icons.StaticFunction);
            }
            if (IsVirtual)
            {
                ItemIcons.Add(Icons.VirtualFunction);
            }
            if (MetadataDirective != null)
            {
                ItemIcons.Add(Icons.ReflectedFunction);
                ItemIcons.AddRange(MetadataDirective.Icons);
            }
            Writer.WriteParam("icons", ItemIcons);

            // Write the name
            Writer.WriteParam("name", Name);
            Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");

            // Add the parameter section if need be
            Writer.EnterParam("arguments");
            if (Parameters.Count > 0)
            {
                Writer.WriteEscapedLine("(  ");
                for (int Idx = 0; Idx < Parameters.Count; Idx++)
                {
                    string Separator  = (Idx + 1 == Parameters.Count) ? "" : ",";
                    string Definition = Markdown.Truncate(Parameters[Idx].GetAbbreviatedDefinition(), 35, "...");
                    Writer.WriteLine(UdnWriter.TabSpaces + Definition + Separator + "  ");
                }
                Writer.WriteEscapedLine(")  ");
            }
            Writer.LeaveParam();

            // Write the description
            Writer.WriteParam("description", BriefDescription);

            // Leave the object
            Writer.LeaveObject();
        }
Ejemplo n.º 3
0
        public void WriteExpandable(UdnWriter Writer, string UniqueId)
        {
            // Top level modules
            if (Modules.Count > 0)
            {
                Writer.WriteList(Modules.OrderBy(x => x.Name).Select(x => x.GetListItem()));
            }

            // CSS region for indenting
//			Writer.EnterRegion("module-sections-list");

            // Expandable section for each subcategory
            int UniqueIdSuffix = 1;

            foreach (APIModuleCategory Category in Categories.OrderBy(x => x.Name))
            {
                if (!Category.IsEmpty)
                {
                    string NewUniqueId = String.Format("{0}_{1}", UniqueId, UniqueIdSuffix);

                    Writer.EnterTag(Category.Expanded? "[OBJECT:ModuleSectionExpanded]" : "[OBJECT:ModuleSection]");

                    Writer.WriteLine("[PARAMLITERAL:id]");
                    Writer.WriteEscapedLine(NewUniqueId);
                    Writer.WriteLine("[/PARAMLITERAL]");

                    Writer.WriteLine("[PARAM:heading]");
                    Writer.WriteEscapedLine(Category.Name);
                    Writer.WriteLine("[/PARAM]");

                    Writer.EnterTag("[PARAM:content]");
                    Category.WriteExpandable(Writer, NewUniqueId);
                    Writer.LeaveTag("[/PARAM]");

                    Writer.LeaveTag("[/OBJECT]");

                    UniqueIdSuffix++;
                }
            }

            // End of CSS region
//			Writer.LeaveRegion();
        }
Ejemplo n.º 4
0
        public void WriteListItem(UdnWriter Writer, bool bWithType)
        {
            // Enter the object
            Writer.EnterObject(bWithType? "FunctionListItemWithType" : "FunctionListItem");

            // Get all the icons
            List<Icon> ItemIcons = new List<Icon>{ Icons.Function[(int)Protection] };
            if (IsStatic)
            {
                ItemIcons.Add(Icons.StaticFunction);
            }
            if (IsVirtual)
            {
                ItemIcons.Add(Icons.VirtualFunction);
            }
            if (MetadataDirective != null)
            {
                ItemIcons.Add(Icons.ReflectedFunction);
                ItemIcons.AddRange(MetadataDirective.Icons);
            }
            Writer.WriteParam("icons", ItemIcons);

            // Write the return type
            Writer.WriteParam("type", Markdown.Truncate(ReturnType, 12, "..."));

            // Write the name
            if(Parameters.Count == 0)
            {
                Writer.WriteParam("name", Name + "()");
                Writer.WriteParam("arguments", "");
            }
            else
            {
                Writer.WriteParam("name", Name);
                Writer.EnterParam("arguments");
                if (Parameters.Count > 0)
                {
                    Writer.WriteEscapedLine("(  ");
                    for (int Idx = 0; Idx < Parameters.Count; Idx++)
                    {
                        string Separator = (Idx + 1 == Parameters.Count) ? "" : ",";
                        string Definition = Markdown.Truncate(APIMember.RemoveElaborations(Parameters[Idx].Definition), 35, "...");
                        // Fix spacing around pointer/reference punctuation to match Epic code standards.
                        if (Definition != null)
                        {
                            Definition = Definition.Replace(" *", "*").Replace(" &", "&");
                        }
                        Writer.WriteLine(UdnWriter.TabSpaces + Definition + Separator + "  ");
                    }
                    Writer.WriteEscapedLine(")  ");
                }
                Writer.LeaveParam();
            }

            // Write the other parameters
            Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");
            Writer.WriteParam("description", BriefDescription);

            // Leave the object
            Writer.LeaveObject();
        }
Ejemplo n.º 5
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);
                Writer.EnterTag("[OBJECT:Class]");

                // Write the brief description
                Writer.WriteLine("[PARAM:briefdesc]");
                if (!Utility.IsNullOrWhitespace(BriefDescription))
                {
                    Writer.WriteLine(BriefDescription);
                }
                Writer.WriteLine("[/PARAM]");

                // Write the hierarchy
                Writer.EnterTag("[PARAM:hierarchy]");
                if (HierarchyNode != null)
                {
                    Writer.EnterSection("hierarchy", "Inheritance Hierarchy");
                    Writer.EnterTag("[REGION:hierarchy]");
                    APIHierarchy.WriteHierarchy(Writer, HierarchyNode, "hrch");
                    Writer.LeaveTag("[/REGION]");
                    Writer.LeaveSection();
                }
                Writer.LeaveTag("[/PARAM]");

                // Write the record definition
                Writer.EnterTag("[PARAM:syntax]");
                if (!Utility.IsNullOrWhitespace(Definition))
                {
                    Writer.EnterSection("syntax", "Syntax");
                    WriteDefinition(Writer);
                    Writer.LeaveSection();
                }
                Writer.LeaveTag("[/PARAM]");

                // Write the metadata section
                Writer.WriteLine("[PARAM:meta]");
                if (MetadataDirective != null)
                {
                    MetadataDirective.WriteListSection(Writer, "metadata", "Metadata", MetadataLookup.ClassTags);
                }
                Writer.WriteLine("[/PARAM]");

                // Build a list of all the functions
                List<APIFunction> AllFunctions = new List<APIFunction>();
                AllFunctions.AddRange(Children.OfType<APIFunction>().Where(x => x.Protection != APIProtection.Private));
                AllFunctions.AddRange(Children.OfType<APIFunctionGroup>().SelectMany(x => x.Children.OfType<APIFunction>()).Where(x => x.Protection != APIProtection.Private));
                AllFunctions.Sort((x, y) => String.Compare(x.Name, y.Name));

                // Write all the specializations
                Writer.EnterTag("[PARAM:specializations]");
                if (TemplateSpecializations.Count > 0)
                {
                    Writer.EnterSection("specializations", "Specializations");
                    foreach (APIRecord Specialization in TemplateSpecializations)
                    {
                        Writer.WriteLine("[{0}]({1})  ", Specialization.Name, Specialization.LinkPath);
                    }
                    Writer.LeaveSection();
                }
                Writer.LeaveTag("[/PARAM]");

                // Write all the typedefs
                Writer.EnterTag("[PARAM:typedefs]");
                Writer.WriteListSection("typedefs", "Typedefs", "Name", "Description", Children.OfType<APITypeDef>().Select(x => x.GetListItem()));
                Writer.LeaveTag("[/PARAM]");

                // Write all the constructors
                Writer.EnterTag("[PARAM:constructors]");
                if (!APIFunction.WriteListSection(Writer, "constructor", "Constructors", AllFunctions.Where(x => x.FunctionType == APIFunctionType.Constructor).OrderBy(x => x.LinkPath)) && HasAnyPrivateFunction(Name))
                {
                    Writer.EnterSection("constructor", "Constructors");
                    Writer.WriteLine("No constructors are accessible with public or protected access.");
                    Writer.LeaveSection();
                }
                Writer.LeaveTag("[/PARAM]");

                // Write all the destructors
                Writer.EnterTag("[PARAM:destructors]");
                if (!APIFunction.WriteListSection(Writer, "destructor", "Destructors", AllFunctions.Where(x => x.FunctionType == APIFunctionType.Destructor)) && HasAnyPrivateFunction("~" + Name))
                {
                    Writer.EnterSection("destructors", "Destructors");
                    Writer.WriteLine("No destructors are accessible with public or protected access.");
                    Writer.LeaveSection();
                }
                Writer.LeaveTag("[/PARAM]");

                // Write all the enums
                Writer.EnterTag("[PARAM:enums]");
                Writer.WriteListSection("enums", "Enums", "Name", "Description", Children.OfType<APIEnum>().OrderBy(x => x.Name).Select(x => x.GetListItem()));
                Writer.LeaveTag("[/PARAM]");

                // Write all the inner structures
                Writer.EnterTag("[PARAM:classes]");
                Writer.WriteListSection("classes", "Classes", "Name", "Description", Children.OfType<APIRecord>().Where(x => x.Protection != APIProtection.Private).OrderBy(x => x.Name).Select(x => x.GetListItem()));
                Writer.LeaveTag("[/PARAM]");

                // Write all the constants
                Writer.EnterTag("[PARAM:constants]");
                Writer.WriteListSection("constants", "Constants", "Name", "Description", Children.OfType<APIConstant>().Select(x => x.GetListItem()));
                Writer.LeaveTag("[/PARAM]");

                // Write all the variables
                Writer.EnterTag("[PARAM:variables]");
                Writer.WriteListSection("variables", "Variables", "Name", "Description", Children.OfType<APIVariable>().Where(x => x.Protection != APIProtection.Private).OrderBy(x => x.Name).Select(x => x.GetListItem()));
                Writer.LeaveTag("[/PARAM]");

                // Write the functions
                Writer.EnterTag("[PARAM:methods]");
                APIFunction.WriteListSection(Writer, "methods", "Methods", AllFunctions.Where(x => x.FunctionType == APIFunctionType.Normal));
                Writer.LeaveTag("[/PARAM]");

                // Write the operator list
                Writer.EnterTag("[PARAM:operators]");
                APIFunction.WriteListSection(Writer, "operators", "Operators", AllFunctions.Where(x => x.FunctionType == APIFunctionType.UnaryOperator || x.FunctionType == APIFunctionType.BinaryOperator));
                Writer.LeaveTag("[/PARAM]");

                // Write class description
                Writer.EnterTag("[PARAM:description]");
                if (!Utility.IsNullOrWhitespace(FullDescription) && FullDescription != BriefDescription)
                {
                    Writer.EnterSection("description", "Remarks");
                    Writer.WriteLine(FullDescription);
                    Writer.LeaveSection();
                }
                Writer.LeaveTag("[/PARAM]");

                // Write the marshalling parameters
                Writer.EnterTag("[PARAM:marshalling]");
                if (DelegateEventParameters != null)
                {
                    Writer.EnterSection("marshalling", "Marshalling");
                    Writer.WriteLine("Parameters are marshalled using [{0}]({1})", DelegateEventParameters.FullName, DelegateEventParameters.LinkPath);
                    Writer.LeaveSection();
                }
                Writer.LeaveTag("[/PARAM]");

                // Write the declaration file
                Writer.EnterTag("[PARAM:declaration]");
                if (!Utility.IsNullOrWhitespace(DeclarationFile))
                {
                    Writer.EnterSection("declaration", "Declaration");
                    Writer.WriteEscapedLine(DeclarationFile);
                    Writer.LeaveSection();
                }
                Writer.LeaveTag("[/PARAM]");

                Writer.LeaveTag("[/OBJECT]");
            }
        }
Ejemplo n.º 6
0
        public void WriteExpandable(UdnWriter Writer, string UniqueId)
        {
            // Top level modules
            if(Modules.Count > 0)
            {
                Writer.WriteList(Modules.OrderBy(x => x.Name).Select(x => x.GetListItem()));
            }

            // CSS region for indenting
            //			Writer.EnterRegion("module-sections-list");

            // Expandable section for each subcategory
            int UniqueIdSuffix = 1;
            foreach (APIModuleCategory Category in Categories.OrderBy(x => x.Name))
            {
                if(!Category.IsEmpty)
                {
                    string NewUniqueId = String.Format("{0}_{1}", UniqueId, UniqueIdSuffix);

                    Writer.EnterTag(Category.Expanded? "[OBJECT:ModuleSectionExpanded]" : "[OBJECT:ModuleSection]");

                    Writer.WriteLine("[PARAMLITERAL:id]");
                    Writer.WriteEscapedLine(NewUniqueId);
                    Writer.WriteLine("[/PARAMLITERAL]");

                    Writer.WriteLine("[PARAM:heading]");
                    Writer.WriteEscapedLine(Category.Name);
                    Writer.WriteLine("[/PARAM]");

                    Writer.EnterTag("[PARAM:content]");
                    Category.WriteExpandable(Writer, NewUniqueId);
                    Writer.LeaveTag("[/PARAM]");

                    Writer.LeaveTag("[/OBJECT]");

                    UniqueIdSuffix++;
                }
            }

            // End of CSS region
            //			Writer.LeaveRegion();
        }
Ejemplo n.º 7
0
        public void WriteListItem(UdnWriter Writer)
        {
            // Enter the object
            Writer.EnterObject("FunctionListItem");

            // Get all the icons
            List<Icon> ItemIcons = new List<Icon>{ Icons.Function[(int)Protection] };
            if (IsStatic)
            {
                ItemIcons.Add(Icons.StaticFunction);
            }
            if (IsVirtual)
            {
                ItemIcons.Add(Icons.VirtualFunction);
            }
            if (MetadataDirective != null)
            {
                ItemIcons.Add(Icons.ReflectedFunction);
                ItemIcons.AddRange(MetadataDirective.Icons);
            }
            Writer.WriteParam("icons", ItemIcons);

            // Write the name
            Writer.WriteParam("name", Name);
            Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");

            // Add the parameter section if need be
            Writer.EnterParam("arguments");
            if (Parameters.Count > 0)
            {
                Writer.WriteEscapedLine("(  ");
                for (int Idx = 0; Idx < Parameters.Count; Idx++)
                {
                    string Separator = (Idx + 1 == Parameters.Count) ? "" : ",";
                    string Definition = Markdown.Truncate(Parameters[Idx].GetAbbreviatedDefinition(), 35, "...");
                    Writer.WriteLine(UdnWriter.TabSpaces + Definition + Separator + "  ");
                }
                Writer.WriteEscapedLine(")  ");
            }
            Writer.LeaveParam();

            // Write the description
            Writer.WriteParam("description", BriefDescription);

            // Leave the object
            Writer.LeaveObject();
        }