Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 protected ParamCommandComment(ParamCommandComment.Internal* native, bool isInternalImpl = false)
     : base((CppSharp.Parser.AST.BlockCommandComment.Internal*) native)
 {
 }
Ejemplo n.º 3
0
 private ParamCommandComment(ParamCommandComment.Internal native)
     : this(__CopyValue(native))
 {
     __ownsNativeInstance = true;
     NativeToManagedMap[__Instance] = this;
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 public static ParamCommandComment __CreateInstance(ParamCommandComment.Internal native)
 {
     return new ParamCommandComment(native);
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
 private ParamCommandComment(ParamCommandComment.Internal native, bool skipVTables = false)
     : this(__CopyValue(native), skipVTables)
 {
     __ownsNativeInstance = true;
     NativeToManagedMap[__Instance] = this;
 }
Ejemplo n.º 8
0
 public static ParamCommandComment __CreateInstance(ParamCommandComment.Internal native, bool skipVTables = false)
 {
     return new ParamCommandComment(native, skipVTables);
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 11
0
 public bool VisitParamCommand(ParamCommandComment comment)
 {
     return(true);
 }
Ejemplo n.º 12
0
 public bool VisitParamCommand(ParamCommandComment comment) => true;