예제 #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;