Пример #1
0
        public APIFunction(APIPage InParent, DoxygenEntity InEntity, APIFunctionKey InKey, string InLinkPath)
            : base(InParent, InEntity.Name, InLinkPath)
        {
            Entity = InEntity;
            Node   = Entity.Node;

            Protection   = ParseProtection(Node);
            FunctionType = InKey.Type;
            AddRefLink(Entity.Node.Attributes["id"].Value, this);

            bIsTemplateSpecialization = Name.Contains('<');
            if (Node.SelectSingleNode("templateparamlist") != null && !bIsTemplateSpecialization && !TemplateFunctions.ContainsKey(FullName))
            {
                TemplateFunctions.Add(FullName, this);
            }
        }
Пример #2
0
        public void WriteReferencesSection(UdnWriter Writer, DoxygenEntity Entity)
        {
            List <UdnListItem> Items = new List <UdnListItem>();

            // Get the module
            for (APIPage Page = this; Page != null; Page = Page.Parent)
            {
                APIModule Module = Page as APIModule;
                if (Module != null)
                {
                    Items.Add(new UdnListItem("Module", String.Format("[{0}]({1})", Module.Name, Module.LinkPath), null));
                    break;
                }
            }

            // Get the header file
            if (Entity.File != null)
            {
                string NormalizedFileName = GetNormalizedFileName(Entity.File);
                if (NormalizedFileName != null)
                {
                    Items.Add(new UdnListItem("Header", Utility.EscapeText(NormalizedFileName), null));
                }
            }

            // Get the source file
            if (Entity.BodyFile != null && Entity.BodyFile != Entity.File)
            {
                string NormalizedFileName = GetNormalizedFileName(Entity.BodyFile);
                if (NormalizedFileName != null)
                {
                    Items.Add(new UdnListItem("Source", Utility.EscapeText(NormalizedFileName), null));
                }
            }

            // Write the section
            if (Items.Count > 0)
            {
                Writer.EnterSection("references", "References");
                Writer.WriteList(Items);
                Writer.LeaveSection();
            }
        }
Пример #3
0
        public APIRecord(APIPage InParent, DoxygenEntity InEntity)
            : base(InParent, GetNameFromNode(InEntity.Node))
        {
            // Set all the readonly vars
            Entity     = InEntity;
            Node       = InEntity.Node;
            RefId      = Node.Attributes["id"].InnerText;
            Protection = ParseProtection(Node);

            // Set the record type
            switch (Node.Attributes["kind"].Value)
            {
            case "class":
                RecordType = Name.StartsWith("I")? APIRecordType.Interface : APIRecordType.Class;
                break;

            case "struct":
                RecordType = APIRecordType.Struct;
                break;

            case "union":
                RecordType = APIRecordType.Union;
                break;
            }

            // Register the record for incoming links
            AddRefLink(RefId, this);

            // Add it to the template list
            if (Node.SelectSingleNode("templateparamlist") != null)
            {
                bIsTemplate = true;
                bIsTemplateSpecialization = Name.Contains('<');
                if (!bIsTemplateSpecialization && !TemplateRecords.ContainsKey(FullName))
                {
                    TemplateRecords.Add(FullName, this);
                }
            }
        }
Пример #4
0
        public APIEnum(APIPage InParent, DoxygenEntity InEntity, string InName)
            : base(InParent, GetCleanName(InName))
        {
            // Set the defaults
            Entity     = InEntity;
            Node       = InEntity.Node;
            Protection = ParseProtection(Node);

            // Read the values
            using (XmlNodeList ValueNodeList = Node.SelectNodes("enumvalue"))
            {
                foreach (XmlNode ValueNode in ValueNodeList)
                {
                    APIEnumValue Value = new APIEnumValue(ValueNode);
                    AddRefLink(Value.Id, this);
                    Values.Add(Value);
                }
            }

            // Add it as a link target
            AddRefLink(Node.Attributes["id"].InnerText, this);
        }
Пример #5
0
        private List <TreeNode> BuildSymbolTree(IBaseNode rootEntityNode, TreeNode rootTreeNode, IBaseNode selectedEntityNode)
        {
            List <TreeNode> result = new List <TreeNode>();

            foreach (IBaseNode childEntityNode in rootEntityNode.Children)
            {
                if (typeof(DoxygenNode).Equals(childEntityNode.GetType()))
                {
                    DoxygenNode   doxyNode = (DoxygenNode)childEntityNode;
                    DoxygenEntity entity   = doxyNode.Entity;
                    if (!AllowedDoxyEntities.Contains(entity.Kind))
                    {
                        continue;
                    }

                    TreeNode parentNode;
                    if (childEntityNode.ShowChildren)
                    {
                        parentNode     = new TreeNode(entity.DisplayName);
                        parentNode.Tag = childEntityNode;
                        rootTreeNode.Nodes.Add(parentNode);
                        if (selectedEntityNode != null)
                        {
                            if (selectedEntityNode.CompareTo(childEntityNode) == 0)
                            {
                                result.Add(parentNode);
                            }
                        }
                    }
                    else
                    {
                        parentNode = rootTreeNode;
                    }
                    result.AddRange(BuildSymbolTree(childEntityNode, parentNode, selectedEntityNode));
                }
            }
            return(result);
        }
Пример #6
0
 public static bool IsConstantVariable(DoxygenEntity Entity)
 {
     return(Entity.Node.Attributes["static"].Value == "yes");
 }
Пример #7
0
        public static bool CreateParametersStruct(APIPage Parent, List <APIMember> Children, DoxygenEntity Entity)
        {
            string Name        = Entity.Name;
            int    ClassMaxIdx = Name.IndexOf("_event");

            if (ClassMaxIdx == -1)
            {
                return(false);
            }

            string    ClassName   = Name.Substring(0, ClassMaxIdx);
            APIRecord ClassRecord = Children.OfType <APIRecord>().FirstOrDefault(x => x.Name.EndsWith(ClassName) && x.Name.Length == ClassName.Length + 1);

            if (ClassRecord == null)
            {
                return(false);
            }

            if (!Name.EndsWith("_Parms"))
            {
                return(false);
            }
            int    MemberMinIdx = ClassMaxIdx + 6;
            int    MemberMaxIdx = Name.Length - 6;
            string MemberName   = Name.Substring(MemberMinIdx, MemberMaxIdx - MemberMinIdx);

            APIRecord Delegate = Children.OfType <APIRecord>().FirstOrDefault(x => x.Name == "F" + MemberName);

            if (Delegate != null)
            {
                Delegate.DelegateEventParameters = new APIEventParameters(Parent, Delegate, Entity);
                Children.Add(Delegate.DelegateEventParameters);
                return(true);
            }

            APIFunction Function = ClassRecord.Children.OfType <APIFunction>().FirstOrDefault(x => x.Name == MemberName);

            if (Function != null)
            {
                Function.EventParameters = new APIEventParameters(Parent, Function, Entity);
                Children.Add(Function.EventParameters);
                return(true);
            }

            return(false);
        }
Пример #8
0
 public APIFunction(APIPage InParent, DoxygenEntity InEntity, APIFunctionKey InKey)
     : this(InParent, InEntity, InKey, Utility.MakeLinkPath(InParent.LinkPath, InKey.GetLinkName()))
 {
 }
Пример #9
0
 public APIConstantEnum(APIPage InParent, DoxygenEntity InEnumEntity, XmlNode InValueNode, string InName)
     : base(InParent, InEnumEntity, InName)
 {
     EnumNode  = InEnumEntity.Node;
     ValueNode = InValueNode;
 }
Пример #10
0
 public APIConstant(APIPage InParent, DoxygenEntity InEntity, string InName)
     : base(InParent, InName)
 {
     Entity = InEntity;
 }
Пример #11
0
 public APIConstantVariable(APIPage InParent, DoxygenEntity InEntity)
     : base(InParent, InEntity, InEntity.Name)
 {
     Node = Entity.Node;
 }