コード例 #1
0
        public override void Link()
        {
            // Parse the metadata
            MetadataDirective = MetadataCache.FindMetadataForMember(Node, "UPROPERTY");

            ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

            GetModifiers();

            XmlNode DefNode = Node.SelectSingleNode("definition");

            if (DefNode != null)
            {
                Definition = ConvertToMarkdown(DefNode);
            }

            XmlNode type = Node.SelectSingleNode("type");

            Type = ConvertToMarkdown(type);

            XmlNodeList SimpleNodes = Node.SelectNodes("detaileddescription/para/simplesect");

            foreach (XmlNode node in SimpleNodes)
            {
                switch (node.Attributes.GetNamedItem("kind").InnerText)
                {
                case "warning":
                    Warnings.Add(ConvertToMarkdown(node.SelectSingleNode("para")).TrimStart(':'));
                    break;
                }
            }
        }
コード例 #2
0
        public override void Link()
        {
            // Get all the relative classes
            BaseRecords = ParseRelatives(Node, "basecompoundref");

            // Add this record to all of its base classes
            foreach (KeyValuePair <XmlNode, APIRecord> BaseRecord in BaseRecords)
            {
                if (BaseRecord.Value != null)
                {
                    BaseRecord.Value.DerivedRecords.Add(this);
                }
            }

            // Get the descriptions
            ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

            // Get the @see directives
            ParseSeeAlso(Node, SeeAlso);

            // Find the metadata for this definition
            MetadataDirective = MetadataCache.FindMetadataForMember(Node);

            // Build the definition
            TemplateSignature = ParseTemplateSignature(Node);
            Definition        = Node.Attributes["kind"].InnerText + " " + Name;

            // Append all the base classes
            foreach (KeyValuePair <XmlNode, APIRecord> BaseRecord in BaseRecords)
            {
                string BaseDefinition = BaseRecord.Key.Attributes["prot"].Value;
                if (BaseRecord.Key.Attributes["virt"].Value == "virtual")
                {
                    BaseDefinition += " virtual";
                }
                if (BaseRecord.Value == null)
                {
                    BaseDefinition += " " + BaseRecord.Key.InnerText;
                }
                else
                {
                    BaseDefinition += " [" + BaseRecord.Key.InnerText + "](" + BaseRecord.Value.LinkPath + ")";
                }
                BaseDefinitions.Add(BaseDefinition);
            }

            // If it's a specialization, add it to the parent class
            if (bIsTemplateSpecialization)
            {
                int StripIdx = FullName.LastIndexOf('<');
                if (StripIdx != -1)
                {
                    APIRecord OriginalTemplateRecord;
                    if (TemplateRecords.TryGetValue(FullName.Substring(0, StripIdx), out OriginalTemplateRecord))
                    {
                        OriginalTemplateRecord.TemplateSpecializations.Add(this);
                    }
                }
            }
        }
コード例 #3
0
        public override void Link()
        {
            // Parse the metadata
            MetadataDirective = MetadataCache.FindMetadataForMember(Node, "UPROPERTY");

            ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

            GetModifiers();

            XmlNode DefNode = Node.SelectSingleNode("definition");
            if (DefNode != null)
            {
                Definition = ConvertToMarkdown(DefNode);
            }

            XmlNode type = Node.SelectSingleNode("type");
            Type = ConvertToMarkdown(type);

            XmlNodeList SimpleNodes = Node.SelectNodes("detaileddescription/para/simplesect");
            foreach (XmlNode node in SimpleNodes)
            {
                switch (node.Attributes.GetNamedItem("kind").InnerText)
                {
                    case "warning":
                        Warnings.Add(ConvertToMarkdown(node.SelectSingleNode("para")).TrimStart(':'));
                        break;
                }
            }
        }
コード例 #4
0
        public override void Link()
        {
            // Parse the metadata
            MetadataDirective = MetadataCache.FindMetadataForMember(Node, "UPROPERTY");

            ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

            XmlNode BitfieldNode = Node.SelectSingleNode("bitfield");

            if (BitfieldNode != null)
            {
                Bitfield = BitfieldNode.InnerText;
            }
            IsMutable = Node.Attributes.GetNamedItem("mutable").InnerText == "yes";
            IsStatic  = Node.Attributes.GetNamedItem("static").InnerText == "yes";

            XmlNode DefNode = Node.SelectSingleNode("definition");

            if (DefNode != null)
            {
                Definition = ConvertToMarkdown(DefNode);
            }

            XmlNode type = Node.SelectSingleNode("type");

            Type = APIMember.RemoveElaborations(ConvertToMarkdown(type));

            XmlNode ArgsStringNode = Node.SelectSingleNode("argsstring");

            if (ArgsStringNode != null)
            {
                ArgsString = ConvertToMarkdown(ArgsStringNode);
            }

            IsolatedType = Type;
            if (!String.IsNullOrEmpty(ArgsString))
            {
                IsolatedType += ArgsString;
            }
            if (!String.IsNullOrEmpty(Bitfield))
            {
                IsolatedType += ": " + Bitfield;
            }
            AbbreviatedType = Markdown.Truncate(IsolatedType, 15, "...");

            XmlNodeList SimpleNodes = Node.SelectNodes("detaileddescription/para/simplesect");

            foreach (XmlNode node in SimpleNodes)
            {
                switch (node.Attributes.GetNamedItem("kind").InnerText)
                {
                case "warning":
                    Warnings.Add(ConvertToMarkdown(node.SelectSingleNode("para")).TrimStart(':'));
                    break;
                }
            }

            SnippetText = APISnippets.LoadSnippetTextForSymbol(FullName);
        }
コード例 #5
0
ファイル: Metadata.cs プロジェクト: kidaa/UnrealEngineVR
        public static MetadataDirective FindMetadataForMember(XmlNode Node, string Type)
        {
            MetadataDirective Directive = FindMetadataForMember(Node);

            if (Directive != null && Directive.Type == Type)
            {
                return(Directive);
            }
            return(null);
        }
コード例 #6
0
ファイル: APIVariable.cs プロジェクト: xiangyuan/Unreal4
		public override void Link()
		{
			// Parse the metadata
			MetadataDirective = MetadataCache.FindMetadataForMember(Node, "UPROPERTY");

			ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

            XmlNode BitfieldNode = Node.SelectSingleNode("bitfield");
            if (BitfieldNode != null)
            {
                Bitfield = BitfieldNode.InnerText;
            }
			IsMutable = Node.Attributes.GetNamedItem("mutable").InnerText == "yes";
			IsStatic = Node.Attributes.GetNamedItem("static").InnerText == "yes";

			XmlNode DefNode = Node.SelectSingleNode("definition");
			if (DefNode != null)
			{
				Definition = ConvertToMarkdown(DefNode);
			}

			XmlNode type = Node.SelectSingleNode("type");
			Type = APIMember.RemoveElaborations(ConvertToMarkdown(type));

			XmlNode ArgsStringNode = Node.SelectSingleNode("argsstring");
			if(ArgsStringNode != null)
			{
				ArgsString = ConvertToMarkdown(ArgsStringNode);
			}

			IsolatedType = Type;
			if(!String.IsNullOrEmpty(ArgsString))
			{
				IsolatedType += ArgsString;
			}
			if(!String.IsNullOrEmpty(Bitfield))
			{
				IsolatedType += ": " + Bitfield;
			}
			AbbreviatedType = Markdown.Truncate(IsolatedType, 15, "...");

			XmlNodeList SimpleNodes = Node.SelectNodes("detaileddescription/para/simplesect");
			foreach (XmlNode node in SimpleNodes)
			{
				switch (node.Attributes.GetNamedItem("kind").InnerText)
				{
					case "warning":
						Warnings.Add(ConvertToMarkdown(node.SelectSingleNode("para")).TrimStart(':'));
						break;
				}
			}

			SnippetText = APISnippets.LoadSnippetTextForSymbol(FullName);			
		}
コード例 #7
0
ファイル: APIEnum.cs プロジェクト: Tigrouzen/UnrealEngine-4
        public override void Link()
        {
            // Read the metadata
            MetadataDirective = MetadataCache.FindMetadataForMember(Node);

            // Get the description
            ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

            // Link all the values
            foreach (APIEnumValue Value in Values)
            {
                Value.Link();
            }
        }
コード例 #8
0
ファイル: Metadata.cs プロジェクト: kidaa/UnrealEngineVR
        public MetadataFile(SourceFile InSourceFile)
        {
            // Set the file
            SourceFile = InSourceFile;

            // Parse the directives
            SourceToken[] Tokens = SourceFile.Tokens;
            for (int Line = 0; Line + 1 < SourceFile.LineToToken.Length; Line++)
            {
                int Index = SourceFile.LineToToken[Line];
                if (Index != SourceFile.LineToToken[Line + 1])
                {
                    MetadataDirective Directive = TryParseDirective(SourceFile, Tokens, Index);
                    if (Directive != null)
                    {
                        Directives.Add(Directive);
                    }
                }
            }
        }
コード例 #9
0
		public override void Link()
        {
			// Read the metadata
			MetadataDirective = MetadataCache.FindMetadataForMember(Node);

			// Get the description
			ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

			// If there isn't one and we're in a namespace, use that instead
			if(String.IsNullOrEmpty(BriefDescription) && String.IsNullOrEmpty(FullDescription) && Entity.NamespaceNode != null)
			{
				ParseBriefAndFullDescription(Entity.NamespaceNode, out BriefDescription, out FullDescription);
			}

			// Link all the values
			foreach (APIEnumValue Value in Values)
			{
				Value.Link();
			}
        }
コード例 #10
0
        public override void Link()
        {
            // Read the metadata
            MetadataDirective = MetadataCache.FindMetadataForMember(Node);

            // Get the description
            ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

            // If there isn't one and we're in a namespace, use that instead
            if (String.IsNullOrEmpty(BriefDescription) && String.IsNullOrEmpty(FullDescription) && Entity.NamespaceNode != null)
            {
                ParseBriefAndFullDescription(Entity.NamespaceNode, out BriefDescription, out FullDescription);
            }

            // Link all the values
            foreach (APIEnumValue Value in Values)
            {
                Value.Link();
            }
        }
コード例 #11
0
ファイル: APIFunction.cs プロジェクト: colwalder/unrealengine
        public override void Link()
        {
            // Get the description
            ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

            // Try to link autogenerated exec functions to their original implementation
            if (Utility.IsNullOrWhitespace(BriefDescription) && Utility.IsNullOrWhitespace(FullDescription) && Name.Length >= 5 && Name.StartsWith("exec") && Char.IsUpper(Name[4]))
            {
                APIRecord ParentRecord = Parent as APIRecord;
                if(ParentRecord != null)
                {
                    APIMember TargetMember = ParentRecord.Children.OfType<APIFunction>().FirstOrDefault(x => x.Name == Name.Substring(4));
                    if (TargetMember == null)
                    {
                        TargetMember = ParentRecord.Children.OfType<APIFunctionGroup>().FirstOrDefault(x => x.Name == Name.Substring(4));
                    }
                    if (TargetMember != null)
                    {
                        BriefDescription = String.Format("Wrapper for [{0}]({1}).", TargetMember.Name, TargetMember.LinkPath);
                    }
                }
            }

            // Get the @see directives
            ParseSeeAlso(Node, SeeAlso);

            string RealKeyName = (Entity.Parent != null) ? (Entity.Parent.Name + "::" + Entity.Name) : Entity.Name;
            SnippetText = APISnippets.LoadSnippetTextForSymbol(RealKeyName);

            // Get the modifiers
            IsVirtual = Node.Attributes.GetNamedItem("virt").InnerText == "virtual";
            IsStatic = Node.Attributes.GetNamedItem("static").InnerText == "yes";

            // Get the metadata
            MetadataDirective = MetadataCache.FindMetadataForMember(Node, "UFUNCTION");

            // Get the template parameters
            TemplateSignature = ParseTemplateSignature(Node);

            // If it's a specialization, add it to the parent class
            if (bIsTemplateSpecialization)
            {
                int StripIdx = FullName.LastIndexOf('<');
                if (StripIdx != -1)
                {
                    APIFunction OriginalTemplateFunction;
                    if (TemplateFunctions.TryGetValue(FullName.Substring(0, StripIdx), out OriginalTemplateFunction))
                    {
                        OriginalTemplateFunction.TemplateSpecializations.Add(this);
                    }
                }
            }

            // Get the parameter declaration nodes
            XmlNodeList ParameterNodes = Node.SelectNodes("param");
            foreach (XmlNode ParameterNode in ParameterNodes)
            {
                Parameters.Add(new APIFunctionParam(this, ParameterNode));
            }

            // If the only parameter is "void", don't bother including it
            if (Parameters.Count == 1 && Parameters[0].Node.SelectSingleNode("type").InnerText == "void")
            {
                Parameters.Clear();
            }

            // Get the parameter description nodes
            XmlNodeList ParameterItemNodes = Node.SelectNodes("detaileddescription/para/parameterlist/parameteritem");
            foreach (XmlNode ParameterItemNode in ParameterItemNodes)
            {
                ParameterSummaries.Add(new APIFunctionParamSummary(this, ParameterItemNode));
            }

            // Get the return type
            XmlNode ReturnTypeNode = Node.SelectSingleNode("type");
            ReturnType = RemoveElaborations(ConvertToMarkdown(ReturnTypeNode));

            // Parse the reimplements list
            using (XmlNodeList ReimplementsList = Node.SelectNodes("reimplements"))
            {
                foreach (XmlNode ReimplementsNode in ReimplementsList)
                {
                    APIFunction Function = ResolveRefLink(ReimplementsNode.Attributes["refid"].Value) as APIFunction;
                    if(Function != null) Reimplements.Add(Function);
                }
            }

            // Parse the reimplemented-by list
            using (XmlNodeList ReimplementedByList = Node.SelectNodes("reimplementedby"))
            {
                foreach (XmlNode ReimplementedByNode in ReimplementedByList)
                {
                    APIFunction Function = ResolveRefLink(ReimplementedByNode.Attributes["refid"].Value) as APIFunction;
                    if (Function != null) ReimplementedBy.Add(Function);
                }
            }

            // Parse any other notes
            XmlNodeList SimpleNodes = Node.SelectNodes("detaileddescription/para/simplesect");
            foreach (XmlNode node in SimpleNodes)
            {
                switch (node.Attributes.GetNamedItem("kind").InnerText)
                {
                    case "return":
                        ReturnDescription = ConvertToMarkdown(node.SelectSingleNode("para"));
                        break;
                    case "warning":
                        Warnings.Add(ConvertToMarkdown(node.SelectSingleNode("para")).TrimStart(':'));
                        break;
                }
            }

            // Parse the source lines
            /*
            XmlNode LocationNode = Node.SelectSingleNode("location");
            if(LocationNode != null)
            {
                XmlAttribute BodyFileAttribute = LocationNode.Attributes["bodyfile"];
                if(BodyFileAttribute != null)
                {
                    string BodyFile = BodyFileAttribute.Value;
                    if(!BodyFile.ToLowerInvariant().Split('\\', '/').Any(x => Program.ExcludeSourceDirectoriesHash.Contains(x)))
                    {
                        SourceFile File = SourceFileCache.Read(BodyFile);
                        if (File != null)
                        {
                            int BodyStart = Math.Min(Math.Max(Int32.Parse(LocationNode.Attributes["bodystart"].Value) - 1, 0), File.LineOffsets.Length - 1);
                            int BodyStartOffset = File.LineOffsets[BodyStart];

                            int BodyEnd = Math.Min(Int32.Parse(LocationNode.Attributes["bodyend"].Value), File.LineOffsets.Length - 1);
                            int BodyEndOffset = File.LineOffsets[BodyEnd];

                            SourceLines = File.Text.Substring(BodyStartOffset, BodyEndOffset - BodyStartOffset).Split('\n');
                        }
                    }
                }
            }
             */
        }
コード例 #12
0
		public override void Link()
		{
			// Get all the relative classes
			BaseRecords = ParseRelatives(Node, "basecompoundref");

			// Add this record to all of its base classes
			foreach (KeyValuePair<XmlNode, APIRecord> BaseRecord in BaseRecords)
			{
				if (BaseRecord.Value != null)
				{
					BaseRecord.Value.DerivedRecords.Add(this);
				}
			}

			// Get the descriptions
			ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

			// Get the @see directives
			ParseSeeAlso(Node, SeeAlso);

			// Find the metadata for this definition
			MetadataDirective = MetadataCache.FindMetadataForMember(Node);

			// Build the definition
			TemplateSignature = ParseTemplateSignature(Node);
			Definition = Node.Attributes["kind"].InnerText + " " + Name;

			// Append all the base classes
			foreach(KeyValuePair<XmlNode, APIRecord> BaseRecord in BaseRecords)
			{
				string BaseDefinition = BaseRecord.Key.Attributes["prot"].Value;
				if(BaseRecord.Key.Attributes["virt"].Value == "virtual")
				{
					BaseDefinition += " virtual";
				}
				if(BaseRecord.Value == null)
				{
					BaseDefinition += " " + BaseRecord.Key.InnerText;
				}
				else
				{
					BaseDefinition += " [" + BaseRecord.Key.InnerText + "](" + BaseRecord.Value.LinkPath + ")";
				}
				BaseDefinitions.Add(BaseDefinition);
			}

			// If it's a specialization, add it to the parent class
			if(bIsTemplateSpecialization)
			{
				int StripIdx = FullName.LastIndexOf('<');
				if(StripIdx != -1)
				{
					APIRecord OriginalTemplateRecord;
					if(TemplateRecords.TryGetValue(FullName.Substring(0, StripIdx), out OriginalTemplateRecord))
					{
						OriginalTemplateRecord.TemplateSpecializations.Add(this);
					}
				}
			}
		}
コード例 #13
0
        public override void Link()
        {
            // Get the description
            ParseBriefAndFullDescription(Node, out BriefDescription, out FullDescription);

            // Try to link autogenerated exec functions to their original implementation
            if (Utility.IsNullOrWhitespace(BriefDescription) && Utility.IsNullOrWhitespace(FullDescription) && Name.Length >= 5 && Name.StartsWith("exec") && Char.IsUpper(Name[4]))
            {
                APIRecord ParentRecord = Parent as APIRecord;
                if (ParentRecord != null)
                {
                    APIMember TargetMember = ParentRecord.Children.OfType <APIFunction>().FirstOrDefault(x => x.Name == Name.Substring(4));
                    if (TargetMember == null)
                    {
                        TargetMember = ParentRecord.Children.OfType <APIFunctionGroup>().FirstOrDefault(x => x.Name == Name.Substring(4));
                    }
                    if (TargetMember != null)
                    {
                        BriefDescription = String.Format("Wrapper for [{0}]({1}).", TargetMember.Name, TargetMember.LinkPath);
                    }
                }
            }

            // Get the @see directives
            ParseSeeAlso(Node, SeeAlso);

            string RealKeyName = (Entity.Parent != null) ? (Entity.Parent.Name + "::" + Entity.Name) : Entity.Name;

            SnippetText = APISnippets.LoadSnippetTextForSymbol(RealKeyName);

            // Get the modifiers
            IsVirtual = Node.Attributes.GetNamedItem("virt").InnerText == "virtual";
            IsStatic  = Node.Attributes.GetNamedItem("static").InnerText == "yes";

            // Get the metadata
            MetadataDirective = MetadataCache.FindMetadataForMember(Node, "UFUNCTION");

            // Get the template parameters
            TemplateSignature = ParseTemplateSignature(Node);

            // If it's a specialization, add it to the parent class
            if (bIsTemplateSpecialization)
            {
                int StripIdx = FullName.LastIndexOf('<');
                if (StripIdx != -1)
                {
                    APIFunction OriginalTemplateFunction;
                    if (TemplateFunctions.TryGetValue(FullName.Substring(0, StripIdx), out OriginalTemplateFunction))
                    {
                        OriginalTemplateFunction.TemplateSpecializations.Add(this);
                    }
                }
            }

            // Get the parameter declaration nodes
            XmlNodeList ParameterNodes = Node.SelectNodes("param");

            foreach (XmlNode ParameterNode in ParameterNodes)
            {
                Parameters.Add(new APIFunctionParam(this, ParameterNode));
            }

            // If the only parameter is "void", don't bother including it
            if (Parameters.Count == 1 && Parameters[0].Node.SelectSingleNode("type").InnerText == "void")
            {
                Parameters.Clear();
            }

            // Get the parameter description nodes
            XmlNodeList ParameterItemNodes = Node.SelectNodes("detaileddescription/para/parameterlist/parameteritem");

            foreach (XmlNode ParameterItemNode in ParameterItemNodes)
            {
                ParameterSummaries.Add(new APIFunctionParamSummary(this, ParameterItemNode));
            }

            // Get the return type
            XmlNode ReturnTypeNode = Node.SelectSingleNode("type");

            ReturnType = RemoveElaborations(ConvertToMarkdown(ReturnTypeNode));

            // Parse the reimplements list
            using (XmlNodeList ReimplementsList = Node.SelectNodes("reimplements"))
            {
                foreach (XmlNode ReimplementsNode in ReimplementsList)
                {
                    APIFunction Function = ResolveRefLink(ReimplementsNode.Attributes["refid"].Value) as APIFunction;
                    if (Function != null)
                    {
                        Reimplements.Add(Function);
                    }
                }
            }

            // Parse the reimplemented-by list
            using (XmlNodeList ReimplementedByList = Node.SelectNodes("reimplementedby"))
            {
                foreach (XmlNode ReimplementedByNode in ReimplementedByList)
                {
                    APIFunction Function = ResolveRefLink(ReimplementedByNode.Attributes["refid"].Value) as APIFunction;
                    if (Function != null)
                    {
                        ReimplementedBy.Add(Function);
                    }
                }
            }

            // Parse any other notes
            XmlNodeList SimpleNodes = Node.SelectNodes("detaileddescription/para/simplesect");

            foreach (XmlNode node in SimpleNodes)
            {
                switch (node.Attributes.GetNamedItem("kind").InnerText)
                {
                case "return":
                    ReturnDescription = ConvertToMarkdown(node.SelectSingleNode("para"));
                    break;

                case "warning":
                    Warnings.Add(ConvertToMarkdown(node.SelectSingleNode("para")).TrimStart(':'));
                    break;
                }
            }

            // Parse the source lines

            /*
             * XmlNode LocationNode = Node.SelectSingleNode("location");
             * if(LocationNode != null)
             * {
             *      XmlAttribute BodyFileAttribute = LocationNode.Attributes["bodyfile"];
             *      if(BodyFileAttribute != null)
             *      {
             *              string BodyFile = BodyFileAttribute.Value;
             *              if(!BodyFile.ToLowerInvariant().Split('\\', '/').Any(x => Program.ExcludeSourceDirectoriesHash.Contains(x)))
             *              {
             *                      SourceFile File = SourceFileCache.Read(BodyFile);
             *                      if (File != null)
             *                      {
             *                              int BodyStart = Math.Min(Math.Max(Int32.Parse(LocationNode.Attributes["bodystart"].Value) - 1, 0), File.LineOffsets.Length - 1);
             *                              int BodyStartOffset = File.LineOffsets[BodyStart];
             *
             *                              int BodyEnd = Math.Min(Int32.Parse(LocationNode.Attributes["bodyend"].Value), File.LineOffsets.Length - 1);
             *                              int BodyEndOffset = File.LineOffsets[BodyEnd];
             *
             *                              SourceLines = File.Text.Substring(BodyStartOffset, BodyEndOffset - BodyStartOffset).Split('\n');
             *                      }
             *              }
             *      }
             * }
             */
        }