Exemplo n.º 1
0
 private void WritePinObjects(UdnWriter Writer, IEnumerable <APIActionPin> Pins)
 {
     foreach (var Pin in Pins)
     {
         Pin.WriteObject(Writer, CompactName == null);
     }
 }
Exemplo n.º 2
0
        private void WriteDefinition(UdnWriter Writer)
        {
            List <string> Lines = new List <string>();

            Lines.Add(String.Format("enum {0}", ShortName.StartsWith("@")? "" : ShortName));
            Lines.Add(Utility.EscapeText("{"));
            if (Values.Count > 0)
            {
                int NamePadding = Values.Max(x => x.Name.Length) + 4;
                foreach (APIEnumValue Value in Values)
                {
                    string ValueLine = UdnWriter.TabSpaces + Value.Name;
                    if (Value.Initializer != null)
                    {
                        for (int Idx = 0; Idx < NamePadding - Value.Name.Length; Idx++)
                        {
                            ValueLine += UdnWriter.Space;
                        }
                        ValueLine += Value.Initializer;
                    }
                    Lines.Add(ValueLine + ",");
                }
            }
            Lines.Add(Utility.EscapeText("}"));

            WriteNestedSimpleCode(Writer, Lines);
        }
Exemplo n.º 3
0
 private void WritePins(UdnWriter Writer, IEnumerable <APIActionPin> Pins)
 {
     foreach (var Pin in Pins)
     {
         Pin.WritePin(Writer);
     }
 }
Exemplo n.º 4
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(AnnotateAnonymousNames(Name), PageCrumbs, BriefDescription);

                // Write the syntax
                Writer.EnterSection("syntax", "Syntax");
                WriteDefinition(Writer);
                Writer.LeaveSection();

                // Write the enum values
                Writer.WriteListSection("values", "Values", "Name", "Description", Values.Select(x => x.GetListItem()));

                // Write the description
                if (!Utility.IsNullOrWhitespace(FullDescription))
                {
                    Writer.EnterSection("description", "Remarks");
                    Writer.WriteLine(FullDescription);
                    Writer.LeaveSection();
                }

                // Write the references
                WriteReferencesSection(Writer, Entity);
            }
        }
Exemplo n.º 5
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);

                // Write the warnings
                if (Warnings.Count > 0)
                {
                    Writer.EnterTag("[REGION:warning]");
                    Writer.WriteLine("**Warnings**");
                    foreach (string Warning in Warnings)
                    {
                        Writer.WriteLine("* " + Warning);
                    }
                    Writer.LeaveTag("[/REGION]");
                }

                // Write the syntax
                Writer.EnterSection("syntax", "Syntax");
                WriteDefinition(Writer);
                Writer.LeaveSection();

                // Write the description
                if (!Utility.IsNullOrWhitespace(FullDescription))
                {
                    Writer.EnterSection("description", "Remarks");
                    Writer.WriteLine(FullDescription);
                    Writer.LeaveSection();
                }
            }
        }
Exemplo n.º 6
0
        public void Write(UdnWriter Writer, int Depth)
        {
            if (!IsEmpty)
            {
                // CSS region for indenting
                Writer.EnterRegion("module-sections-list");

                // Find all the modules in this category
                if(Modules.Count > 0)
                {
                    Writer.WriteList(Modules.OrderBy(x => x.Name).Select(x => x.GetListItem()));
                }

                // Write all the subcategories
                foreach (APIModuleCategory Category in Categories.OrderBy(x => x.Name))
                {
                    Writer.WriteHeading(Depth, Category.Name);
                    Writer.WriteLine();
                    Category.Write(Writer, Depth + 1);
                }

                // End of CSS region
                Writer.LeaveRegion();
            }
        }
Exemplo n.º 7
0
        public override void WritePage(UdnManifest Manifest, string Path)
        {
            using (UdnWriter Writer = new UdnWriter(Path))
            {
                Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);

                // Write the type
                Writer.EnterSection("type", "Type");
                WriteNestedSimpleCode(Writer, new List <string> {
                    "typedef " + Type + " " + Name
                });
                Writer.LeaveSection();

                // Write the description
                if (!Utility.IsNullOrWhitespace(FullDescription))
                {
                    Writer.EnterSection("description", "Remarks");
                    Writer.WriteLine(FullDescription);
                    Writer.LeaveSection();
                }

                // Write the references
                WriteReferencesSection(Writer, Entity);
            }
        }
Exemplo n.º 8
0
        public void Write(UdnWriter Writer, int Depth)
        {
            if (!IsEmpty)
            {
                // CSS region for indenting
                Writer.EnterRegion("module-sections-list");

                // Find all the modules in this category
                if (Modules.Count > 0)
                {
                    Writer.WriteList(Modules.OrderBy(x => x.Name).Select(x => x.GetListItem()));
                }

                // Write all the subcategories
                foreach (APIModuleCategory Category in Categories.OrderBy(x => x.Name))
                {
                    Writer.WriteHeading(Depth, Category.Name);
                    Writer.WriteLine();
                    Category.Write(Writer, Depth + 1);
                }

                // End of CSS region
                Writer.LeaveRegion();
            }
        }
Exemplo n.º 9
0
        public void WriteListSection(UdnWriter Writer, string SectionId, string SectionTitle, Dictionary <string, string> Descriptions)
        {
            if (NodeList.Count > 0)
            {
                // Create the list items
                List <MetadataListItem> ListItems = new List <MetadataListItem>();
                CreateListItems(NodeList, APIDocTool.Icons.GetMetadataIconsForType(Type), Descriptions, false, ListItems);

                // Enter the section and list
                Writer.EnterSection(SectionId, SectionTitle);
                Writer.WriteObject("MetadataListHead");

                // Write the items
                foreach (MetadataListItem ListItem in ListItems)
                {
                    Writer.EnterObject("MetadataListItem");
                    Writer.WriteParam("icon", ListItem.Icon);
                    Writer.WriteParam("name", ListItem.Name);
                    Writer.EnterParam("value");
                    for (int Idx = 0; Idx < ListItem.Values.Count; Idx++)
                    {
                        Writer.WriteLine("{0}{1}  ", ListItem.Values[Idx], (Idx + 1 < ListItem.Values.Count) ? ", " : "");
                    }
                    Writer.LeaveParam();
                    Writer.WriteParam("desc", ListItem.Description);
                    Writer.LeaveObject();
                }

                // Leave the section and list
                Writer.WriteObject("MetadataListTail");
                Writer.LeaveSection();
            }
        }
Exemplo n.º 10
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);

                Writer.EnterTag("[OBJECT:Constant]");

                Writer.EnterTag("[PARAM:briefdesc]");
                if (!Utility.IsNullOrWhitespace(BriefDescription))
                {
                    Writer.WriteLine(BriefDescription);
                }
                Writer.LeaveTag("[/PARAM]");

                // Write the syntax
                Writer.EnterTag("[PARAM:syntax]");
                Writer.EnterSection("syntax", "Syntax");
                WriteDefinition(Writer);
                Writer.LeaveSection();
                Writer.LeaveTag("[/PARAM]");

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

                Writer.LeaveTag("[/OBJECT]");
            }
        }
Exemplo n.º 11
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                if (bIsRootCategory)
                {
                    Writer.WritePageHeader("Unreal Engine Blueprint API Reference", PageCrumbs, "Unreal Engine Blueprint API Reference");

                    Writer.WriteHeading(2, "Disclaimer");

                    Writer.WriteLine("The Blueprint API reference is an early work in progress, and some information may be missing or out of date. It strives to reflect all available nodes, but it is not guaranteed to be an exhaustive list.");
                    Writer.WriteLine("For tutorials, walkthroughs and detailed guides to using Blueprints in UE4, please see the [Introduction to Blueprints](http://docs.unrealengine.com/latest/INT/Engine/Blueprints/GettingStarted/index.html) on the web.");
                }
                else
                {
                    Writer.WritePageHeader(Name, PageCrumbs, Name);
                }

                if (Actions.Count > 0)
                {
                    Writer.WriteHeading(2, "Actions");
                    Writer.WriteList(Actions.OrderBy(x => x.Name).Select(x => x.GetListItem()));
                }

                if (SubCategories.Count > 0)
                {
                    Writer.WriteHeading(2, "Categories");
                    Writer.WriteList(SubCategories.OrderBy(x => x.Key).Select(x => x.Value.GetListItem()));
                }
            }
        }
Exemplo n.º 12
0
 public override void WritePage(UdnManifest Manifest, string OutputPath)
 {
     using (UdnWriter Writer = new UdnWriter(OutputPath))
     {
         Writer.WritePageHeader(Name, PageCrumbs, Name);
     }
 }
Exemplo n.º 13
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader("Unreal Engine API Reference", PageCrumbs, "Unreal Engine API Reference");

                Writer.WriteHeading(2, "Disclaimer");

                Writer.WriteLine("The API reference is an early work in progress, and some information may be missing or out of date. It serves mainly as a low level index of Engine classes and functions.");
                Writer.WriteLine("For tutorials, walkthroughs and detailed guides to programming with Unreal, please see the [Unreal Engine Programming](http://docs.unrealengine.com/latest/INT/Programming/index.html) home on the web.");
                Writer.WriteLine();
                Writer.WriteLine("To explore the API from some of the most frequently encountered Unreal concepts and types, see the API __[getting started](" + GettingStarted.LinkPath + ")__ page.");

                Writer.WriteHeading(2, "Contents");

                Writer.EnterRegion("memberindexlinks");
                Writer.WriteLine("[Getting started]({0}) &middot; [All constants]({1}) &middot; [All functions]({2}) &middot; [All enums]({3}) &middot; [All classes]({4}) &middot; [Class hierarchy]({5})", GettingStarted.LinkPath, ConstantIndex.LinkPath, FunctionIndex.LinkPath, EnumIndex.LinkPath, RecordIndex.LinkPath, RecordHierarchy.LinkPath);
                Writer.LeaveRegion();

                foreach (APIModuleIndex ChildModuleIndex in ChildModuleIndexes)
                {
                    Writer.WriteHeading(2, ChildModuleIndex.Name);
                    Writer.EnterRegion("modules-list");
                    ChildModuleIndex.WriteModuleList(Writer, 3);
                    Writer.LeaveRegion();
                }

                Writer.WriteLine("<br>");
            }
        }
Exemplo n.º 14
0
        private void WriteDefinition(UdnWriter Writer)
        {
            List <string> Lines = new List <string>();

            if (MetadataDirective != null)
            {
                Lines.AddRange(MetadataDirective.ToMarkdown());
            }

            StringBuilder Definition = new StringBuilder();

            if (IsStatic)
            {
                Definition.Append("static ");
            }
            if (IsMutable)
            {
                Definition.Append("mutable ");
            }
            Definition.Append(Type + " " + Name);
            if (Bitfield != "")
            {
                Definition.Append(": " + Bitfield);
            }
            if (ArgsString != "")
            {
                Definition.Append(ArgsString);
            }
            Definition.Append("  ");
            Lines.Add(Definition.ToString());

            WriteNestedSimpleCode(Writer, Lines);
        }
Exemplo n.º 15
0
        private void WriteDefinition(UdnWriter Writer)
        {
            List <string> Lines = new List <string>();

            if (MetadataDirective != null)
            {
                Lines.AddRange(MetadataDirective.ToMarkdown());
            }
            if (TemplateSignature != null)
            {
                Lines.Add(TemplateSignature);
            }
            if (BaseDefinitions.Count == 0)
            {
                Lines.Add(Definition);
            }
            else if (BaseDefinitions.Count == 1)
            {
                Lines.Add(Definition + " : " + BaseDefinitions[0]);
            }
            else
            {
                Lines.Add(Definition + " :");
                for (int Idx = 0; Idx < BaseDefinitions.Count; Idx++)
                {
                    Lines.Add(UdnWriter.TabSpaces + BaseDefinitions[Idx] + ((Idx < BaseDefinitions.Count - 1)? "," : ""));
                }
            }

            WriteNestedSimpleCode(Writer, Lines);
        }
Exemplo n.º 16
0
        public void WriteNestedSimpleCode(UdnWriter Writer, List <string> Lines)
        {
            Writer.EnterTag("[REGION:simplecode_api]");
            string Prefix = "";

            // Write the namespace introducers
            int LastScope = 0;

            for (int NextScope = Name.IndexOf("::"); NextScope != -1; NextScope = Name.IndexOf("::", NextScope + 2))
            {
                string Namespace = Name.Substring(LastScope, NextScope - LastScope);
                Writer.WriteLine(Prefix + "namespace " + Namespace + "  ");
                Writer.WriteLine(Prefix + Utility.EscapeText("{") + "  ");
                Prefix   += UdnWriter.TabSpaces;
                LastScope = NextScope + 2;
            }

            // Write the body
            foreach (string Line in Lines)
            {
                Writer.WriteLine(Prefix + Line.Replace('\r', ' ').Replace('\n', ' ').Trim() + "  ");
            }

            // Write the closing braces
            while (Prefix.Length > 0)
            {
                Prefix = Prefix.Substring(0, Prefix.Length - UdnWriter.TabSpaces.Length);
                Writer.WriteLine(Prefix + Utility.EscapeText("}") + "  ");
            }

            Writer.LeaveTag("[/REGION]");
        }
        public void WriteSyntax(UdnWriter Writer)
        {
            List <string> Lines = new List <string>();

            Lines.Add(String.Format("{0} {1}", Entity.Node.Attributes["kind"].Value, Entity.Name));
            Lines.Add("&#40;");
            using (XmlNodeList MemberNodeList = Entity.Node.SelectNodes("sectiondef/memberdef"))
            {
                foreach (XmlNode MemberNode in MemberNodeList)
                {
                    if (MemberNode.Attributes["kind"].Value == "variable")
                    {
                        Lines.Add(UdnWriter.TabSpaces + String.Format("{0} {1};", ConvertToMarkdown(MemberNode.SelectSingleNode("type")), MemberNode.SelectSingleNode("name").InnerText));
                    }
                    else if (MemberNode.Attributes["kind"].Value == "function")
                    {
                        Lines.Add(UdnWriter.TabSpaces);
                        Lines.Add(UdnWriter.TabSpaces + "// " + ConvertToMarkdown(MemberNode.SelectSingleNode("briefdescription")).Replace('\r', ' ').Replace('\n', ' ').Trim());
                        Lines.Add(UdnWriter.TabSpaces + ConvertFunctionNodeToMarkdown(MemberNode));
                    }
                }
            }
            Lines.Add("&#41;");
            WriteNestedSimpleCode(Writer, Lines);
        }
Exemplo n.º 18
0
        public void WriteListItem(UdnWriter Writer)
        {
            bool OutputPage = ShouldOutputPage();

            // Enter the object
            Writer.EnterObject(OutputPage? "VariableListItem" : "VariableListItemNoLink");

            // Get all the icons
            List <Icon> Icons = new List <Icon>();

            Icons.Add(APIDocTool.Icons.Variable[(int)Protection]);
            if (IsStatic)
            {
                Icons.Add(APIDocTool.Icons.StaticVariable);
            }
            if (MetadataDirective != null)
            {
                Icons.Add(APIDocTool.Icons.ReflectedVariable);
                Icons.AddRange(MetadataDirective.Icons);
            }
            Writer.WriteParam("icons", Icons);

            // Write the type
            Writer.WriteParam("type", AbbreviatedType);
            Writer.WriteParam("name", Name);
            if (OutputPage)
            {
                Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");
            }
            Writer.WriteParam("description", BriefDescription);

            // Leave the object
            Writer.LeaveObject();
        }
Exemplo n.º 19
0
        public void WritePin(UdnWriter Writer)
        {
            Writer.EnterObject("ActionPinListItem");

            Writer.EnterParam("icons");

            var PinType = GetTypeText();

            if (PinType == "exec")
            {
                Writer.WriteRegion("input_exec", "");
            }
            else if (bIsArray)
            {
                Writer.WriteRegion("input_array " + PinType, "");
            }
            else
            {
                Writer.WriteRegion("input_variable " + PinType, "");
            }
            Writer.LeaveParam();

            Writer.WriteParamLiteral("name", Name);
            Writer.WriteParamLiteral("type", TypeText);
            Writer.WriteParam("tooltip", Tooltip);
            Writer.WriteParamLiteral("id", GetId());
            Writer.LeaveObject();
        }
Exemplo n.º 20
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, Name);

                // Tooltip/description
                Writer.WriteLine(Tooltip);

                if (Pins != null && Pins.Count() > 0)
                {
                    // Visualization of the node
                    Writer.EnterRegion("graph");
                    Writer.EnterObject("BlueprintNode");
                    if (CompactName != null)
                    {
                        Writer.WriteParamLiteral("type", "compact");
                        Writer.WriteParamLiteral("title", CompactName);
                    }
                    else
                    {
                        Writer.WriteParamLiteral("type", NodeType);
                        Writer.WriteParamLiteral("title", Name);
                    }
                    Writer.EnterParam("inputs");
                    WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
                    Writer.LeaveParam();
                    Writer.EnterParam("outputs");
                    WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

                    if (bShowAddPin)
                    {
                        Writer.EnterObject("BlueprintPin");
                        Writer.WriteParamLiteral("type", "addpin");
                        Writer.WriteParamLiteral("id", "AddPin");
                        Writer.WriteParamLiteral("title", "Add pin");
                        Writer.LeaveObject();
                    }

                    Writer.LeaveParam();
                    Writer.LeaveObject();
                    Writer.LeaveRegion();

                    // Inputs
                    Writer.EnterSection("inputs", "Inputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();

                    // Outputs
                    Writer.EnterSection("outputs", "Outputs");
                    Writer.WriteObject("MemberIconListHeadBlank");
                    WritePins(Writer, Pins.Where(x => !x.bInputPin));
                    Writer.WriteObject("MemberIconListTail");
                    Writer.LeaveSection();
                }
            }
        }
Exemplo n.º 21
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();
        }
Exemplo n.º 22
0
 public static void WriteList(UdnWriter Writer, IEnumerable <APIVariable> Variables)
 {
     Writer.WriteObject("VariableListHead");
     foreach (APIVariable Variable in Variables)
     {
         Variable.WriteListItem(Writer);
     }
     Writer.WriteObject("VariableListTail");
 }
Exemplo n.º 23
0
 public static void WriteList(UdnWriter Writer, IEnumerable <APIFunction> Functions)
 {
     Writer.WriteObject("FunctionListHead");
     foreach (APIFunction Function in Functions)
     {
         Function.WriteListItem(Writer);
     }
     Writer.WriteObject("FunctionListTail");
 }
Exemplo n.º 24
0
 public static void WriteList(UdnWriter Writer, IEnumerable <APIFunction> Functions, bool bWithType)
 {
     Writer.WriteObject(bWithType? "FunctionListHeadWithType" : "FunctionListHead");
     foreach (APIFunction Function in Functions)
     {
         Function.WriteListItem(Writer, bWithType);
     }
     Writer.WriteObject("FunctionListTail");
 }
Exemplo n.º 25
0
        private void WriteSourceSection(UdnWriter Writer)
        {
            if (Entity.BodyFile != null)
            {
                DoxygenSourceFile SourceFile = Entity.Module.FindSourceFile(Entity.BodyFile);
                if (SourceFile != null)
                {
                    int BodyStart = Math.Min(Math.Max(Entity.BodyStart - 1, 0), SourceFile.Lines.Count - 1);
                    int BodyEnd   = Math.Min(Math.Max(Entity.BodyEnd, BodyStart), SourceFile.Lines.Count);
                    if (BodyEnd > BodyStart)
                    {
                        Writer.EnterSection("source", "Source");
                        Writer.EnterRegion("simplecode");

                        List <string> Lines     = new List <string>();
                        int           MinPrefix = int.MaxValue;

                        for (int LineIdx = BodyStart; LineIdx < BodyEnd; LineIdx++)
                        {
                            XmlNode Node         = SourceFile.Lines[LineIdx];
                            string  MarkdownLine = (Node == null)? "" : Markdown.ParseXmlCodeLine(Node, ResolveDoxygenLink);

                            int Prefix = 0;
                            while (Prefix < MarkdownLine.Length && MarkdownLine[Prefix] == ' ')
                            {
                                Prefix++;
                            }

                            if (Prefix < MarkdownLine.Length && Prefix < MinPrefix)
                            {
                                MinPrefix = Prefix;
                            }

                            Lines.Add(MarkdownLine);
                        }

                        for (int Idx = 0; Idx < Lines.Count; Idx++)
                        {
                            int TextIdx = Math.Min(MinPrefix, Lines[Idx].Length);
                            if (TextIdx == Lines[Idx].Length)
                            {
                                Writer.Write("&nbsp;");
                            }
                            while (TextIdx < Lines[Idx].Length && Lines[Idx][TextIdx] == ' ')
                            {
                                Writer.Write("&nbsp;");
                                TextIdx++;
                            }
                            Writer.WriteLine(Lines[Idx].Substring(TextIdx) + "  ");
                        }

                        Writer.LeaveRegion();
                        Writer.LeaveSection();
                    }
                }
            }
        }
Exemplo n.º 26
0
        public void WriteIcons(UdnWriter Writer)
        {
            List <Icon> IconList = APIDocTool.Icons.GetMetadataIcons(Type, NodeList.Select(x => x.TagText));

            foreach (Icon Icon in IconList)
            {
                Writer.WriteIcon(Icon);
            }
        }
Exemplo n.º 27
0
 public static void WriteListSection(UdnWriter Writer, string SectionId, string SectionTitle, IEnumerable<APIFilter> Categories)
 {
     APIFilter[] CategoryArray = Categories.ToArray();
     if (CategoryArray.Length > 0)
     {
         Writer.EnterSection(SectionId, SectionTitle);
         Writer.WriteFilterList(CategoryArray.Select(x => x.GetFilterListItem()).ToArray());
         Writer.LeaveSection();
     }
 }
Exemplo n.º 28
0
 public override void WritePage(UdnManifest Manifest, string OutputPath)
 {
     using (UdnWriter Writer = new UdnWriter(OutputPath))
     {
         Writer.WritePageHeader(Name, PageCrumbs, "Module Index");
         Writer.EnterRegion("modules-list");
         WriteModuleList(Writer, 2);
         Writer.LeaveRegion();
     }
 }
Exemplo n.º 29
0
 public static void WriteListSection(UdnWriter Writer, string SectionId, string SectionTitle, IEnumerable <APIFilter> Categories)
 {
     APIFilter[] CategoryArray = Categories.ToArray();
     if (CategoryArray.Length > 0)
     {
         Writer.EnterSection(SectionId, SectionTitle);
         Writer.WriteFilterList(CategoryArray.Select(x => x.GetFilterListItem()).ToArray());
         Writer.LeaveSection();
     }
 }
Exemplo n.º 30
0
 private static void WriteRelatedClass(UdnWriter Writer, KeyValuePair <XmlNode, APIRecord> Pair)
 {
     if (Pair.Value == null)
     {
         Writer.WriteLine("{0}", Pair.Key.InnerText);
     }
     else
     {
         Writer.WriteLine("[{0}]({1})  ", Pair.Key.InnerText, Pair.Value.LinkPath);
     }
 }
Exemplo n.º 31
0
        protected override void WriteDefinition(UdnWriter Writer)
        {
            List <string> Lines = new List <string>();

            Lines.Add("enum");
            Lines.Add(Utility.EscapeText("{"));
            Lines.Add(UdnWriter.TabSpaces + Name + " " + Initializer);
            Lines.Add(Utility.EscapeText("}"));

            WriteNestedSimpleCode(Writer, Lines);
        }
Exemplo n.º 32
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader("Getting started with the Unreal Engine API", PageCrumbs, "Getting started with the Unreal Engine API");

                Writer.WriteHeading(2, "Orientation");

                Writer.WriteLine("Games, programs and the Unreal Editor are all *targets* built by UnrealBuildTool. Each target is compiled from C++ *modules*, each implementing a particular area of functionality. Your game is a target, and your game code is implemented in one or more modules.");
                Writer.WriteLine();
                Writer.WriteLine("Code in each module can use other modules by referencing them in their *build rules*. Build rules for each module are given by C# scripts with the .build.cs extension. *Target rules* are given by C# scripts with the .target.cs extension.");
                Writer.WriteLine();
                Writer.WriteLine(Manifest, "Modules supplied with the Unreal Engine are divided into three categories; the {Runtime|ModuleIndex:Runtime Modules}, functionality for the {Editor|ModuleIndex:Editor Modules}, and {Developer|ModuleIndex:Developer Modules} utilities.");
                Writer.WriteLine();
                Writer.WriteLine(Manifest, "Most gameplay programming just uses runtime modules, and the three most commonly encountered are {Core|Filter:Core}, {CoreUObject|Filter:CoreUObject} and {Engine|Filter:Engine}.");
                Writer.WriteLine();

                Writer.WriteHeading(2, "Core");

                Writer.WriteLine(Manifest, "The **{Core|Filter:Core}** module provides a common framework for Unreal modules to communicate; a standard set of types, a {math library|Filter:Core.Math}, a {container|Filter:Core.Containers} library, and a lot of the hardware abstraction that allows Unreal to run on so many platforms.");
                Writer.WriteLine(Manifest, "Some common topics are listed below; full documentation is available {here|Filter:Core}.");
                Writer.WriteLine();
                List <UdnListItem> CoreItems = new List <UdnListItem>();
                CoreItems.Add(new UdnListItem("Basic types:", Manifest.FormatString("bool &middot; float/double &middot; {int8}/{int16}/{int32}/{int64} &middot; {uint8}/{uint16}/{uint32}/{uint64} &middot; {ANSICHAR} &middot; {TCHAR} &middot; {FString}"), null));
                CoreItems.Add(new UdnListItem("Math:", Manifest.FormatString("{FMath} &middot; {FVector} &middot; {FRotator} &middot; {FTransform} &middot; {FMatrix} &middot; {More...|Filter:Core.Math}"), null));
                CoreItems.Add(new UdnListItem("Containers:", Manifest.FormatString("{TArray} &middot; {TList} &middot; {TMap} &middot; {More...|Filter:Core.Containers}"), null));
                CoreItems.Add(new UdnListItem("Other:", Manifest.FormatString("{FName} &middot; {FArchive} &middot; {FOutputDevice}"), null));
                Writer.WriteList(CoreItems);

                Writer.WriteHeading(2, "CoreUObject");

                Writer.WriteLine(Manifest, "The **{CoreUObject|Filter:CoreUObject}** module defines UObject, the base class for all managed objects in Unreal. Managed objects are key to integrating with the editor, for serialization, network replication, and runtime type information. UObject derived classes are garbage collected.");
                Writer.WriteLine(Manifest, "Some common topics are listed below; full documentation is available {here|Filter:CoreUObject}.");
                Writer.WriteLine();
                List <UdnListItem> CoreUObjectItems = new List <UdnListItem>();
                CoreUObjectItems.Add(new UdnListItem("Classes:", Manifest.FormatString("{UObject} &middot; {UClass} &middot; {UProperty} &middot; {UPackage}"), null));
                CoreUObjectItems.Add(new UdnListItem("Functions:", Manifest.FormatString("{ConstructObject} &middot; {FindObject} &middot; {Cast} &middot; {CastChecked}"), null));
                Writer.WriteList(CoreUObjectItems);

                Writer.WriteHeading(2, "Engine");

                Writer.WriteLine(Manifest, "The **{Engine|Filter:Engine}** module contains functionality you’d associate with a game. The game world, actors, characters, physics and special effects are all defined here.");
                Writer.WriteLine(Manifest, "Some common topics are listed below; full documentation is available {here|Filter:Engine}.");
                Writer.WriteLine();
                List <UdnListItem> EngineItems = new List <UdnListItem>();
                EngineItems.Add(new UdnListItem("Actors:", Manifest.FormatString("{AActor} &middot; {AVolume} &middot; {AGameMode} &middot; {AHUD} &middot; {More...|Hierarchy:AActor}"), null));
                EngineItems.Add(new UdnListItem("Pawns:", Manifest.FormatString("{APawn} &middot; {ACharacter} &middot; {AWheeledVehicle}"), null));
                EngineItems.Add(new UdnListItem("Controllers:", Manifest.FormatString("{AController} &middot; {AAIController} &middot; {APlayerController}"), null));
                EngineItems.Add(new UdnListItem("Components:", Manifest.FormatString("{UActorComponent} &middot; {UBrainComponent} &middot; {UInputComponent} &middot; {USkeletalMeshComponent} &middot; {UParticleSystemComponent} &middot; {More...|Hierarchy:UActorComponent}"), null));
                EngineItems.Add(new UdnListItem("Gameplay:", Manifest.FormatString("{UPlayer} &middot; {ULocalPlayer} &middot; {UWorld} &middot; {ULevel}"), null));
                EngineItems.Add(new UdnListItem("Assets:", Manifest.FormatString("{UTexture} &middot; {UMaterial} &middot; {UStaticMesh} &middot; {USkeletalMesh} &middot; {UParticleSystem}"), null));
                Writer.WriteList(EngineItems);
            }
        }
Exemplo n.º 33
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, "Overload list");

                Writer.EnterTag("[REGION:members]");
                APIFunction.WriteList(Writer, Overloads, Overloads.First().FunctionType != APIFunctionType.Constructor);
                Writer.LeaveTag("[/REGION]");
            }
        }
Exemplo n.º 34
0
		public override void WritePage(UdnManifest Manifest, string OutputPath)
		{
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader(Name, PageCrumbs, "Overload list");

				Writer.EnterTag("[REGION:members]");
				APIFunction.WriteList(Writer, Overloads, Overloads.First().FunctionType != APIFunctionType.Constructor);
				Writer.LeaveTag("[/REGION]");
			}
		}
Exemplo n.º 35
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader("Getting started with the Unreal Engine API", PageCrumbs, "Getting started with the Unreal Engine API");

                Writer.WriteHeading(2, "Orientation");

                Writer.WriteLine("Games, programs and the Unreal Editor are all *targets* built by UnrealBuildTool. Each target is compiled from C++ *modules*, each implementing a particular area of functionality. Your game is a target, and your game code is implemented in one or more modules.");
                Writer.WriteLine();
                Writer.WriteLine("Code in each module can use other modules by referencing them in their *build rules*. Build rules for each module are given by C# scripts with the .build.cs extension. *Target rules* are given by C# scripts with the .target.cs extension.");
                Writer.WriteLine();
                Writer.WriteLine(Manifest, "Modules supplied with the Unreal Engine are divided into three categories; the {Runtime|ModuleIndex:Runtime Modules}, functionality for the {Editor|ModuleIndex:Editor Modules}, and {Developer|ModuleIndex:Developer Modules} utilities.");
                Writer.WriteLine();
                Writer.WriteLine(Manifest, "Most gameplay programming just uses runtime modules, and the three most commonly encountered are {Core|Filter:Core}, {CoreUObject|Filter:CoreUObject} and {Engine|Filter:Engine}.");
                Writer.WriteLine();

                Writer.WriteHeading(2, "Core");

                Writer.WriteLine(Manifest, "The **{Core|Filter:Core}** module provides a common framework for Unreal modules to communicate; a standard set of types, a {math library|Filter:Core.Math}, a {container|Filter:Core.Containers} library, and a lot of the hardware abstraction that allows Unreal to run on so many platforms.");
                Writer.WriteLine(Manifest, "Some common topics are listed below; full documentation is available {here|Filter:Core}.");
                Writer.WriteLine();
                List<UdnListItem> CoreItems = new List<UdnListItem>();
                CoreItems.Add(new UdnListItem("Basic types:", Manifest.FormatString("bool &middot; float/double &middot; {int8}/{int16}/{int32}/{int64} &middot; {uint8}/{uint16}/{uint32}/{uint64} &middot; {ANSICHAR} &middot; {TCHAR} &middot; {FString}"), null));
                CoreItems.Add(new UdnListItem("Math:", Manifest.FormatString("{FMath} &middot; {FVector} &middot; {FRotator} &middot; {FTransform} &middot; {FMatrix} &middot; {More...|Filter:Core.Math}"), null));
                CoreItems.Add(new UdnListItem("Containers:", Manifest.FormatString("{TArray} &middot; {TList} &middot; {TMap} &middot; {More...|Filter:Core.Containers}"), null));
                CoreItems.Add(new UdnListItem("Other:", Manifest.FormatString("{FName} &middot; {FArchive} &middot; {FOutputDevice}"), null));
                Writer.WriteList(CoreItems);

                Writer.WriteHeading(2, "CoreUObject");

                Writer.WriteLine(Manifest, "The **{CoreUObject|Filter:CoreUObject}** module defines UObject, the base class for all managed objects in Unreal. Managed objects are key to integrating with the editor, for serialization, network replication, and runtime type information. UObject derived classes are garbage collected.");
                Writer.WriteLine(Manifest, "Some common topics are listed below; full documentation is available {here|Filter:CoreUObject}.");
                Writer.WriteLine();
                List<UdnListItem> CoreUObjectItems = new List<UdnListItem>();
                CoreUObjectItems.Add(new UdnListItem("Classes:", Manifest.FormatString("{UObject} &middot; {UClass} &middot; {UProperty} &middot; {UPackage}"), null));
                CoreUObjectItems.Add(new UdnListItem("Functions:", Manifest.FormatString("{ConstructObject} &middot; {FindObject} &middot; {Cast} &middot; {CastChecked}"), null));
                Writer.WriteList(CoreUObjectItems);

                Writer.WriteHeading(2, "Engine");

                Writer.WriteLine(Manifest, "The **{Engine|Filter:Engine}** module contains functionality you’d associate with a game. The game world, actors, characters, physics and special effects are all defined here.");
                Writer.WriteLine(Manifest, "Some common topics are listed below; full documentation is available {here|Filter:Engine}.");
                Writer.WriteLine();
                List<UdnListItem> EngineItems = new List<UdnListItem>();
                EngineItems.Add(new UdnListItem("Actors:", Manifest.FormatString("{AActor} &middot; {AVolume} &middot; {AGameMode} &middot; {AHUD} &middot; {More...|Hierarchy:AActor}"), null));
                EngineItems.Add(new UdnListItem("Pawns:", Manifest.FormatString("{APawn} &middot; {ACharacter} &middot; {AWheeledVehicle}"), null));
                EngineItems.Add(new UdnListItem("Controllers:", Manifest.FormatString("{AController} &middot; {AAIController} &middot; {APlayerController}"), null));
                EngineItems.Add(new UdnListItem("Components:", Manifest.FormatString("{UActorComponent} &middot; {UBrainComponent} &middot; {UInputComponent} &middot; {USkeletalMeshComponent} &middot; {UParticleSystemComponent} &middot; {More...|Hierarchy:UActorComponent}"), null));
                EngineItems.Add(new UdnListItem("Gameplay:", Manifest.FormatString("{UPlayer} &middot; {ULocalPlayer} &middot; {UWorld} &middot; {ULevel}"), null));
                EngineItems.Add(new UdnListItem("Assets:", Manifest.FormatString("{UTexture} &middot; {UMaterial} &middot; {UStaticMesh} &middot; {USkeletalMesh} &middot; {UParticleSystem}"), null));
                Writer.WriteList(EngineItems);
            }
        }
Exemplo n.º 36
0
        public static void WriteHierarchy(UdnWriter Writer, APIHierarchyNode RootNode, string Id)
        {
            Writer.WriteLine("<table class=\"{0}\" cellspacing=\"0\" id=\"{1}\">", RootNode.bShowButton ? "hierarchy-table-collapsed" : "hierarchy-table", Id);
            for(int Idx = 0; Idx < RootNode.Children.Count; Idx++)
            {
                APIHierarchyNode Node = RootNode.Children[Idx];
                string ChildId = String.Format("{0}_{1}", Id, Idx + 1);

                // Write the start of the row
                Writer.WriteLine("<tr>");

                // Write the button or spacer
                Writer.EnterTag("<td class=\"hierarchy-button-cell\">");
                if (Node.Children.Count == 0 || !Node.bShowButton)
                {
                    Writer.WriteObject("HierarchySpacer");
                }
                else
                {
                    Writer.EnterObject("HierarchyButton");
                    Writer.WriteParamLiteral("id", ChildId);
                    Writer.LeaveObject();
                }
                Writer.LeaveTag("</td>");

                // Write the label
                Writer.EnterTag("<td class=\"hierarchy-label-cell\">");
                if (Node.LinkPath == null)
                {
                    Writer.WriteObject("HierarchyLabel", "name", Node.Label);
                }
                else
                {
                    Writer.WriteObject("HierarchyLabelLinked", "name", Node.Label, "link", "[RELATIVE:" + Node.LinkPath + "]");
                }

                // Write the contents row
                if (Node.Children.Count > 0)
                {
                    WriteHierarchy(Writer, Node, ChildId);
                }
                Writer.LeaveTag("</td>");

                // Write the end of the row
                Writer.WriteLine("</tr>");
            }
            Writer.WriteLine("</table>");
        }
Exemplo n.º 37
0
		public override void WritePage(UdnManifest Manifest, string OutputPath)
		{
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader(Name, PageCrumbs, Description);

				// Create an array of links for each letter
				string[] CategoryLinks = new string[Categories.Count];
				for (int Idx = 0; Idx < Categories.Count; Idx++)
				{
					if (Categories[Idx].Entries.Count == 0)
					{
						CategoryLinks[Idx] = Categories[Idx].Name;
					}
					else
					{
						CategoryLinks[Idx] = String.Format("[{0}](#idx_{0})", Categories[Idx].Name);
					}
				}

				// Write the link section
				Writer.WriteLine("[REGION:memberindexlinks]");
				Writer.WriteLine(String.Join(" &middot; ", CategoryLinks));
				Writer.WriteLine("[/REGION]");

				// Write each letter
				for(int Idx = 0; Idx < Categories.Count; Idx++)
				{
					if (Categories[Idx].Entries.Count > 0)
					{
						Writer.WriteLine();
						Writer.WriteLine("(#idx_{0})", Categories[Idx].Name);
						Writer.WriteHeading(2, Categories[Idx].Name);
						foreach (Entry Entry in Categories[Idx].Entries)
						{
							Writer.WriteLine("[REGION:memberindexitem]");
							Writer.WriteLine("[{0}]({1})", Entry.Name, Entry.LinkPath);
							Writer.WriteLine("[/REGION]");
						}
					}
				}
			}
		}
Exemplo n.º 38
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);

                // Write the syntax
                Writer.EnterSection("syntax", "Syntax");
                WriteDefinition(Writer);
                Writer.LeaveSection();

                // Write the description
                if (!Utility.IsNullOrWhitespace(FullDescription))
                {
                    Writer.EnterSection("description", "Remarks");
                    Writer.WriteLine(FullDescription);
                    Writer.LeaveSection();
                }

                // Write the references
                WriteReferencesSection(Writer, Entity);
            }
        }
Exemplo n.º 39
0
		public override void WritePage(UdnManifest Manifest, string Path)
		{
			using (UdnWriter Writer = new UdnWriter(Path))
			{
				Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);

				// Write the type
				Writer.EnterSection("type", "Type");
				WriteNestedSimpleCode(Writer, new List<string> { "typedef " + Type + " " + Name });
				Writer.LeaveSection();

				// Write the description
				if (!Utility.IsNullOrWhitespace(FullDescription))
				{
					Writer.EnterSection("description", "Remarks");
					Writer.WriteLine(FullDescription);
					Writer.LeaveSection();
				}

				// Write the references
				WriteReferencesSection(Writer, Entity);
			}
		}
Exemplo n.º 40
0
        public override void WritePage(UdnManifest Manifest, string Path)
        {
            using (UdnWriter Writer = new UdnWriter(Path))
            {
                Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);

                Writer.EnterTag("[OBJECT:Typedef]");

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

                // Write the type
                Writer.EnterTag("[PARAM:type]");
                Writer.EnterSection("type", "Type");
                WriteNestedSimpleCode(Writer, new List<string> { "typedef " + Type + " " + Name });
                Writer.LeaveSection();
                Writer.LeaveTag("[/PARAM]");

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

                // Leave the object tag
                Writer.LeaveTag("[/OBJECT]");
            }
        }
Exemplo n.º 41
0
		private void WriteDefinition(UdnWriter Writer)
		{
			List<string> Lines = new List<string>();

			Lines.Add(String.Format("enum {0}", ShortName.StartsWith("@")? "" : ShortName));
			Lines.Add(Utility.EscapeText("{"));
			if (Values.Count > 0)
			{
				int NamePadding = Values.Max(x => x.Name.Length) + 4;
				foreach (APIEnumValue Value in Values)
				{
					string ValueLine = UdnWriter.TabSpaces + Value.Name;
					if (Value.Initializer != null)
					{
						for (int Idx = 0; Idx < NamePadding - Value.Name.Length; Idx++) ValueLine += UdnWriter.Space;
						ValueLine += Value.Initializer;
					}
					Lines.Add(ValueLine + ",");
				}
			}
			Lines.Add(Utility.EscapeText("}"));

			WriteNestedSimpleCode(Writer, Lines);
		}
Exemplo n.º 42
0
		public void WriteSyntax(UdnWriter Writer)
		{
			List<string> Lines = new List<string>();
			Lines.Add(String.Format("{0} {1}", Entity.Node.Attributes["kind"].Value, Entity.Name));
			Lines.Add("&#40;");
			using (XmlNodeList MemberNodeList = Entity.Node.SelectNodes("sectiondef/memberdef"))
			{
				foreach (XmlNode MemberNode in MemberNodeList)
				{
					if (MemberNode.Attributes["kind"].Value == "variable")
					{
						Lines.Add(UdnWriter.TabSpaces + String.Format("{0} {1};", ConvertToMarkdown(MemberNode.SelectSingleNode("type")), MemberNode.SelectSingleNode("name").InnerText));
					}
					else if(MemberNode.Attributes["kind"].Value == "function")
					{
						Lines.Add(UdnWriter.TabSpaces);
						Lines.Add(UdnWriter.TabSpaces + "// " + ConvertToMarkdown(MemberNode.SelectSingleNode("briefdescription")).Replace('\r', ' ').Replace('\n', ' ').Trim());
						Lines.Add(UdnWriter.TabSpaces + ConvertFunctionNodeToMarkdown(MemberNode));
					}
				}
			}
			Lines.Add("&#41;");
			WriteNestedSimpleCode(Writer, Lines);
		}
Exemplo n.º 43
0
		public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);

				// Write the warnings
				if (Warnings.Count > 0)
				{
					Writer.EnterTag("[REGION:warning]");
					Writer.WriteLine("**Warnings**");
					foreach (string Warning in Warnings)
					{
						Writer.WriteLine("* " + Warning);
					}
					Writer.LeaveTag("[/REGION]");
				}

				// Write the syntax
				Writer.EnterSection("syntax", "Syntax");
				WriteDefinition(Writer);
				Writer.LeaveSection();

				// Write the description
				if (!Utility.IsNullOrWhitespace(FullDescription))
				{
					Writer.EnterSection("description", "Remarks");
					Writer.WriteLine(FullDescription);
					Writer.LeaveSection();
				}

				//Write code snippets
				WriteSnippetSection(Writer, SnippetText);
			}
        }
Exemplo n.º 44
0
 private void WriteIcons(UdnWriter Writer)
 {
     Writer.WriteIcon(Icons.Function[(int)Protection]);
     if (IsStatic)
     {
         Writer.WriteIcon(Icons.StaticFunction);
     }
     if (IsVirtual)
     {
         Writer.WriteIcon(Icons.VirtualFunction);
     }
     if (MetadataDirective != null)
     {
         Writer.WriteIcon(Icons.ReflectedFunction);
         MetadataDirective.WriteIcons(Writer);
     }
 }
Exemplo n.º 45
0
		private void WriteDefinition(UdnWriter Writer)
		{
			List<string> Lines = new List<string>();

			if (MetadataDirective != null)
			{
				Lines.AddRange(MetadataDirective.ToMarkdown());
			}

			StringBuilder Definition = new StringBuilder();
			if (IsStatic) Definition.Append("static ");
			if (IsMutable) Definition.Append("mutable ");
			Definition.Append(Type + " " + Name);
			if (Bitfield != "") Definition.Append(": " + Bitfield);
			if (ArgsString != "") Definition.Append(ArgsString);
			Definition.Append("  ");
			Lines.Add(Definition.ToString());

			WriteNestedSimpleCode(Writer, Lines);
		}
Exemplo n.º 46
0
		public override void WritePage(UdnManifest Manifest, string OutputPath)
		{
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader(Name, PageCrumbs, Name);

				// Tooltip/description - Write this as interleaved text and notes
				foreach (TooltipLine TTL in TooltipData)
				{
					switch (TTL.Type)
					{
						case TooltipLine.LineType.Normal:
							Writer.WriteLine(TTL.Text);
							break;
						case TooltipLine.LineType.Note:
							Writer.EnterRegion("note");
							Writer.WriteLine(TTL.Text);
							Writer.LeaveRegion();
							break;
						default:
							//Error? Ignore this entry for now.
							break;
					}
				}

				if (Pins != null && Pins.Count() > 0)
				{
					// Visualization of the node
					Writer.EnterRegion("graph");
					Writer.EnterObject("BlueprintNode");
					if (CompactName != null)
					{
						Writer.WriteParamLiteral("type", "compact");
						Writer.WriteParamLiteral("title", CompactName);
					}
					else
					{
						Writer.WriteParamLiteral("type", NodeType);
						Writer.WriteParamLiteral("title", Name);
					}
					Writer.EnterParam("inputs");
					WritePinObjects(Writer, Pins.Where(x => x.bInputPin));
					Writer.LeaveParam();
					Writer.EnterParam("outputs");
					WritePinObjects(Writer, Pins.Where(x => !x.bInputPin && x.GetTypeText() != "delegate"));

					if (bShowAddPin)
					{
						Writer.EnterObject("BlueprintPin");
						Writer.WriteParamLiteral("type", "addpin");
						Writer.WriteParamLiteral("id", "AddPin");
						Writer.WriteParamLiteral("title", "Add pin");
						Writer.LeaveObject();
					}

					Writer.LeaveParam();
					Writer.LeaveObject();
					Writer.LeaveRegion();

					// Inputs
					Writer.EnterSection("inputs", "Inputs");
					Writer.WriteObject("MemberIconListHeadBlank");
					WritePins(Writer, Pins.Where(x => x.bInputPin));
					Writer.WriteObject("MemberIconListTail");
					Writer.LeaveSection();

					// Outputs
					Writer.EnterSection("outputs", "Outputs");
					Writer.WriteObject("MemberIconListHeadBlank");
					// TODO: Remove this hack and reinstate the one-line version once UE-16475 is resolved.
					bool bAlreadyWroteOutputDelegate = false;
					for (int i = 0; i < Pins.Count; ++i)
					{
						APIActionPin Pin = Pins[i];
						if (!Pin.bInputPin)
						{
							if (Pin.GetTypeText() == "delegate")
							{
								if (bAlreadyWroteOutputDelegate)
								{
									continue;
								}
								bAlreadyWroteOutputDelegate = true;
							}
							Pin.WritePin(Writer);
						}
					}
					//WritePins(Writer, Pins.Where(x => !x.bInputPin));
					Writer.WriteObject("MemberIconListTail");
					Writer.LeaveSection();
				}
			}
		}
Exemplo n.º 47
0
		private static void WriteRelatedClass(UdnWriter Writer, KeyValuePair<XmlNode, APIRecord> Pair)
		{
			if (Pair.Value == null)
			{
				Writer.WriteLine("{0}", Pair.Key.InnerText);
			}
			else
			{
				Writer.WriteLine("[{0}]({1})  ", Pair.Key.InnerText, Pair.Value.LinkPath);
			}
		}
Exemplo n.º 48
0
        public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
            using (UdnWriter Writer = new UdnWriter(OutputPath))
            {
                Writer.WritePageHeader(FullName, PageCrumbs, BriefDescription);

                // Write the warnings
                if (Warnings.Count > 0)
                {
                    Writer.EnterTag("[REGION:warning]");
                    Writer.WriteLine("**Warnings**");
                    foreach (string Warning in Warnings)
                    {
                        Writer.WriteLine("* " + Warning);
                    }
                    Writer.LeaveTag("[/REGION]");
                }

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

                // Write the syntax
                Writer.EnterSection("syntax", "Syntax");
                WriteSyntax(Writer);
                Writer.LeaveSection();

                // Write the description
                if (!Utility.IsNullOrWhitespace(FullDescription))
                {
                    Writer.EnterSection("description", "Remarks");
                    Writer.WriteLine(FullDescription);
                    Writer.LeaveSection();
                }

                // Enter the body
                Writer.EnterRegion("syntax");

                // Write the return type
                if(!Utility.IsNullOrWhitespace(ReturnDescription))
                {
                    Writer.EnterSection("returns", "Returns");
                    Writer.WriteLine(ReturnDescription);
                    Writer.LeaveSection();
                }

                // Write the parameters
                if (ParameterSummaries.Count > 0)
                {
                    Writer.WriteListSection("params", "Parameters", "Parameter", "Description", ParameterSummaries.Select(x => x.GetListItem()));
                }

                // Leave the body
                Writer.LeaveRegion();

                // Write the marshalling struct
                if (EventParameters != null)
                {
                    Writer.EnterSection("marshalling", "Marshalling");
                    Writer.WriteLine("May be called as an event using [{0}]({1}) as parameter frame.", EventParameters.Name, EventParameters.LinkPath);
                    Writer.LeaveSection();
                }

                // Write the template specializations
                if(TemplateSpecializations.Count > 0)
                {
                    Writer.EnterSection("specializations", "Specializations");
                    foreach (APIFunction Specialization in TemplateSpecializations)
                    {
                        Writer.WriteLine("[{0}]({1})  ", Specialization.Name, Specialization.LinkPath);
                    }
                    Writer.LeaveSection();
                }

                //Write code snippets
                WriteSnippetSection(Writer, SnippetText);

                // Write the @see directives
                WriteSeeAlsoSection(Writer, SeeAlso);

                // Write the reference info
                WriteReferencesSection(Writer, Entity);
            }
        }
Exemplo n.º 49
0
		private void WritePinObjects(UdnWriter Writer, IEnumerable<APIActionPin> Pins)
		{
			foreach(var Pin in Pins)
			{
				Pin.WriteObject(Writer, CompactName == null);
			}
		}
Exemplo n.º 50
0
		public void WriteListItem(UdnWriter Writer)
		{
			bool OutputPage = ShouldOutputPage();

			// Enter the object
			Writer.EnterObject(OutputPage? "VariableListItem" : "VariableListItemNoLink");

			// Get all the icons
			List<Icon> Icons = new List<Icon>();
			Icons.Add(APIDocTool.Icons.Variable[(int)Protection]);
			if (IsStatic)
			{
				Icons.Add(APIDocTool.Icons.StaticVariable);
			}
			if (MetadataDirective != null)
			{
				Icons.Add(APIDocTool.Icons.ReflectedVariable);
				Icons.AddRange(MetadataDirective.Icons);
			}
			Writer.WriteParam("icons", Icons);

			// Write the type
			Writer.WriteParam("type", AbbreviatedType);
			Writer.WriteParam("name", Name);
			if(OutputPage)
			{
				Writer.WriteParam("link", "[RELATIVE:" + LinkPath + "]");
			}
			Writer.WriteParam("description", BriefDescription);

			// Leave the object
			Writer.LeaveObject();
		}
Exemplo n.º 51
0
		public static bool WriteListSection(UdnWriter Writer, string SectionId, string SectionTitle, IEnumerable<APIVariable> Variables)
		{
			APIVariable[] VariableArray = Variables.ToArray();
			if (VariableArray.Length > 0)
			{
				Writer.EnterSection(SectionId, SectionTitle);
				WriteList(Writer, Variables);
				Writer.LeaveSection();
				return true;
			}
			return false;
		}
Exemplo n.º 52
0
        private void WriteSyntax(UdnWriter Writer)
        {
            List<string> Lines = new List<string>();
            if(MetadataDirective != null)
            {
                Lines.AddRange(MetadataDirective.ToMarkdown());
            }
            if (!Utility.IsNullOrWhitespace(TemplateSignature))
            {
                Lines.Add(TemplateSignature);
            }

            string Keywords = "";
            if (IsVirtual)
            {
                Keywords += "virtual ";
            }
            if (IsStatic)
            {
                Keywords += "static ";
            }

            if (Parameters.Count > 0)
            {
                Lines.Add(Keywords + ReturnType + " " + Utility.EscapeText(Name));
                Lines.Add(Utility.EscapeText("("));
                for (int Idx = 0; Idx < Parameters.Count; Idx++)
                {
                    string Separator = (Idx + 1 == Parameters.Count) ? "" : ",";
                    Lines.Add(UdnWriter.TabSpaces + Parameters[Idx].Definition + Separator);
                }
                Lines.Add(Utility.EscapeText(")"));
            }
            else
            {
                Lines.Add(Keywords + ReturnType + " " + Utility.EscapeText(Name + "()"));
            }
            WriteNestedSimpleCode(Writer, Lines);
        }
Exemplo n.º 53
0
		private void WriteDefinition(UdnWriter Writer)
		{
			List<string> Lines = new List<string>();

			if (MetadataDirective != null)
			{
				Lines.AddRange(MetadataDirective.ToMarkdown());
			}
			if (TemplateSignature != null)
			{
				Lines.Add(TemplateSignature);
			}
			if(BaseDefinitions.Count == 0)
			{
				Lines.Add(Definition);
			}
			else if(BaseDefinitions.Count == 1)
			{
				Lines.Add(Definition + " : " + BaseDefinitions[0]);
			}
			else
			{
				Lines.Add(Definition + " :");
				for(int Idx = 0; Idx < BaseDefinitions.Count; Idx++)
				{
					Lines.Add(UdnWriter.TabSpaces + BaseDefinitions[Idx] + ((Idx < BaseDefinitions.Count - 1)? "," : ""));
				}
			}

			WriteNestedSimpleCode(Writer, Lines);
		}
Exemplo n.º 54
0
		public override void WritePage(UdnManifest Manifest, string OutputPath)
        {
			using (UdnWriter Writer = new UdnWriter(OutputPath))
			{
				Writer.WritePageHeader(Name, PageCrumbs, BriefDescription);

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

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

				// Write the class description
				if (!Utility.IsNullOrWhitespace(FullDescription))
				{
					Writer.EnterSection("description", "Remarks");
					Writer.WriteLine(FullDescription.Replace("<", "&lt;").Replace(">", "&gt;"));
					Writer.LeaveSection();
				}

				// Write the main body section
				Writer.EnterRegion("syntax");

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

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

				// Write all the variables
				APIVariable.WriteListSection(Writer, "variables", "Variables", Children.OfType<APIVariable>().Where(x => x.Protection != APIProtection.Private && !x.IsDeprecated()).OrderBy(x => x.Name));

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

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

				// Find a list of base classes
				List<APIRecord> AllBaseRecords = new List<APIRecord>();
				FindAllBaseRecords(AllBaseRecords);

				// Build a list of functions for each base record
				List<APIFunction>[] AllBaseFunctions = AllBaseRecords.Select(x => new List<APIFunction>()).ToArray();
				foreach(APIFunction Function in AllFunctions.Where(x =>x.FunctionType == APIFunctionType.Normal && !x.IsExecFunction()))
				{
					int BaseRecordIdx = AllBaseRecords.IndexOf(Function.GetBaseImplementation().FindParent<APIRecord>());
					AllBaseFunctions[Math.Max(0, BaseRecordIdx)].Add(Function);
				}

				// Write the functions
				for (int Idx = 0; Idx < AllBaseFunctions.Length; Idx++)
				{
					List<APIFunction> BaseFunctions = AllBaseFunctions[Idx];
					if (BaseFunctions.Count > 0)
					{
						string Id = String.Format("functions_{0}", Idx);
						string Label = (Idx == 0) ? "Functions" : String.Format("Overridden from {0}", AllBaseRecords[Idx].Name);
						APIFunction.WriteListSection(Writer, Id, Label, AllBaseFunctions[Idx], true);
					}
				}

				// Write the operator list
				APIFunction.WriteListSection(Writer, "operators", "Operators", AllFunctions.Where(x => x.FunctionType == APIFunctionType.UnaryOperator || x.FunctionType == APIFunctionType.BinaryOperator), true);

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

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

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

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

				// Leave the body
				Writer.LeaveRegion();

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

				// Write the @see directives
				WriteSeeAlsoSection(Writer, SeeAlso);

				// Write the references
				WriteReferencesSection(Writer, Entity);
			}
        }
Exemplo n.º 55
0
 public static void WriteList(UdnWriter Writer, IEnumerable<APIFunction> Functions, bool bWithType)
 {
     Writer.WriteObject(bWithType? "FunctionListHeadWithType" : "FunctionListHead");
     foreach (APIFunction Function in Functions)
     {
         Function.WriteListItem(Writer, bWithType);
     }
     Writer.WriteObject("FunctionListTail");
 }
Exemplo n.º 56
0
 public static bool WriteListSection(UdnWriter Writer, string SectionId, string SectionTitle, IEnumerable<APIFunction> Functions, bool bWithType)
 {
     APIFunction[] FunctionArray = Functions.ToArray();
     if (FunctionArray.Length > 0)
     {
         Writer.EnterSection(SectionId, SectionTitle);
         WriteList(Writer, Functions, bWithType);
         Writer.LeaveSection();
         return true;
     }
     return false;
 }
Exemplo n.º 57
0
		public static void WriteList(UdnWriter Writer, IEnumerable<APIVariable> Variables)
		{
			Writer.WriteObject("VariableListHead");
			foreach (APIVariable Variable in Variables)
			{
				Variable.WriteListItem(Writer);
			}
			Writer.WriteObject("VariableListTail");
		}
Exemplo n.º 58
0
		private static void WriteRelatedClasses(UdnWriter Writer, string Indent, List<KeyValuePair<XmlNode, APIRecord>> Records)
		{
			foreach (KeyValuePair<XmlNode, APIRecord> Record in Records)
			{
				if (Record.Value == null)
				{
					Writer.WriteLine("{0} {1}  ", Indent, Record.Key.InnerText);
				}
				else
				{
					Writer.WriteLine("{0} [{1}]({2})  ", Indent, Record.Key.InnerText, Record.Value.LinkPath);
				}
			}
		}
Exemplo n.º 59
0
		private void WritePins(UdnWriter Writer, IEnumerable<APIActionPin> Pins)
		{
			foreach(var Pin in Pins)
			{
				Pin.WritePin(Writer);
			}
		}
Exemplo n.º 60
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();
        }