コード例 #1
0
        public bool VisitParamCommand(ParamCommandComment comment)
        {
            if (comment.Direction == ParamCommandComment.PassDirection.In)
            {
                return(false);
            }

            if (!comment.IsParamIndexValid)
            {
                return(false);
            }

            var parameter = currentMethod.Parameters[(int)comment.ParamIndex];

            parameter.Usage = GetParameterUsageFromDirection(comment.Direction);

            return(true);
        }
コード例 #2
0
ファイル: AST.cs プロジェクト: RainsSoft/CppSharp
 protected ParamCommandComment(ParamCommandComment.Internal* native, bool isInternalImpl = false)
     : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native)
 {
 }
コード例 #3
0
ファイル: AST.cs プロジェクト: RainsSoft/CppSharp
 private ParamCommandComment(ParamCommandComment.Internal native)
     : this(__CopyValue(native))
 {
     __ownsNativeInstance = true;
     NativeToManagedMap[__Instance] = this;
 }
コード例 #4
0
ファイル: AST.cs プロジェクト: RainsSoft/CppSharp
 private static ParamCommandComment.Internal* __CopyValue(ParamCommandComment.Internal native)
 {
     var ret = Marshal.AllocHGlobal(40);
     CppSharp.Parser.AST.ParamCommandComment.Internal.cctor_1(ret, new global::System.IntPtr(&native));
     return (ParamCommandComment.Internal*) ret;
 }
コード例 #5
0
ファイル: AST.cs プロジェクト: RainsSoft/CppSharp
 public static ParamCommandComment __CreateInstance(ParamCommandComment.Internal native)
 {
     return new ParamCommandComment(native);
 }
コード例 #6
0
ファイル: AST.cs プロジェクト: CSRedRat/CppSharp
 protected ParamCommandComment(ParamCommandComment.Internal* native, bool skipVTables = false)
     : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) null)
 {
     __PointerAdjustment = 0;
     if (native == null)
         return;
     __Instance = new global::System.IntPtr(native);
 }
コード例 #7
0
ファイル: AST.cs プロジェクト: CSRedRat/CppSharp
 private ParamCommandComment(ParamCommandComment.Internal native, bool skipVTables = false)
     : this(__CopyValue(native), skipVTables)
 {
     __ownsNativeInstance = true;
     NativeToManagedMap[__Instance] = this;
 }
コード例 #8
0
ファイル: AST.cs プロジェクト: CSRedRat/CppSharp
 public static ParamCommandComment __CreateInstance(ParamCommandComment.Internal native, bool skipVTables = false)
 {
     return new ParamCommandComment(native, skipVTables);
 }
コード例 #9
0
 private static void* __CopyValue(ParamCommandComment.__Internal native)
 {
     var ret = Marshal.AllocHGlobal(32);
     global::CppSharp.Parser.AST.ParamCommandComment.__Internal.cctor_2(ret, new global::System.IntPtr(&native));
     return ret.ToPointer();
 }
コード例 #10
0
        public override bool VisitDeclaration(Declaration declaration)
        {
            if (AlreadyVisited(declaration))
            {
                return(false);
            }

            //if (declaration.TranslationUnit == null || !declaration.TranslationUnit.FileName.StartsWith("Chakra"))
            //    return false;

            if (declaration.Comment != null)
            {
                var xDoc  = GetOriginalDocumentationDocument(declaration.Comment.Text);
                var xRoot = xDoc.Root;

                declaration.Comment.Kind = CommentKind.BCPLSlash;
                var fullComment = declaration.Comment.FullComment;
                fullComment.Blocks.Clear();

                var summaryPara    = new ParagraphComment();
                var summaryElement = xRoot.Element("summary");
                summaryPara.Content.Add(new TextComment {
                    Text = summaryElement == null ? "" : summaryElement.Value.ReplaceLineBreaks("").Trim()
                });
                fullComment.Blocks.Add(summaryPara);


                var remarksElement = xRoot.Element("remarks");
                if (remarksElement != null)
                {
                    foreach (var remarksLine in remarksElement.Value.Split('\n'))
                    {
                        var remarksPara = new ParagraphComment();
                        remarksPara.Content.Add(new TextComment {
                            Text = remarksLine.ReplaceLineBreaks("").Trim()
                        });
                        fullComment.Blocks.Add(remarksPara);
                    }
                }

                var paramElements = xRoot.Elements("param");
                foreach (var paramElement in paramElements)
                {
                    var paramComment = new ParamCommandComment();
                    paramComment.Arguments.Add(new BlockCommandComment.Argument {
                        Text = paramElement.Attribute("name").Value
                    });
                    paramComment.ParagraphComment = new ParagraphComment();
                    StringBuilder paramTextCommentBuilder = new StringBuilder();
                    foreach (var paramLine in paramElement.Value.Split('\n'))
                    {
                        paramTextCommentBuilder.Append(paramLine.ReplaceLineBreaks("").Trim() + " ");
                    }
                    paramComment.ParagraphComment.Content.Add(new TextComment {
                        Text = paramTextCommentBuilder.ToString()
                    });
                    fullComment.Blocks.Add(paramComment);
                }
            }

            //Fix Enum comments
            if (declaration is Enumeration enumDecl)
            {
                foreach (var item in enumDecl.Items.Where(i => i.Comment != null))
                {
                    item.Comment.BriefText = item.Comment.BriefText.Replace("<summary>", "").Replace("</summary>", "").Trim();
                }
            }

            return(true);
        }
コード例 #11
0
 public bool VisitParamCommand(ParamCommandComment comment)
 {
     return(true);
 }
コード例 #12
0
 public bool VisitParamCommand(ParamCommandComment comment) => true;