代码之家  ›  专栏  ›  技术社区  ›  Issam T.

doxygen中引用运算符的问题

  •  0
  • Issam T.  · 技术社区  · 11 年前

    对于一个类 Foo 包含一个经典函数和一个运算符

    bool Foo::function(int x)
    
    bool Foo::operator()(int a, int b, int c, int d)
    

    当引用我的doxygen块中的那些时,doxygen识别函数(并向其添加链接),但不识别运算符,尽管我在doxygen中对这两个函数都使用相同的语法,即

     /*! 
     \file 
     *
     *   This one creates a link to the function   
     * 
     *   Foo::function(int x)
     *
     *   but this one doesn't create a link to the operator
     *   
     *   Foo::operator()(int a, int b, 
     *              int c, int d)
     *
     *   Although no error or warning is generated
     * 
     *  
     */
    

    在Doxygen的手册页面上( http://www.doxygen.nl/manual/autolink.html )提供的可能性包括:

    <functionName>"("<argument-list>")"
    <functionName>"()"
    "::"<functionName>
    (<className>"::")n<functionName>"("<argument-list>")"
    (<className>"::")n<functionName>"("<argument-list>")"<modifiers>
    (<className>"::")n<functionName>"()"
    (<className>"::")n<functionName>
    

    并且没有一个真正适合操作员的情况,这需要像这样的东西:

    (<className>"::")n<functionName>"()"("<argument-list>")"
    

    有人知道吗? 谢谢

    2 回复  |  直到 6 年前
        1
  •  1
  •   Issam T.    11 年前

    我发现了我的问题。事实上,我的运算符有很多参数。所以我把它写在两行字上,看来多克根不喜欢这样

     /*! 
     \file 
     *
     *   This one creates a link to the operator   
     * 
     *   Foo::operator()(int a, int b, int c, int d)
     *
     *   but this one doesn't create a link to the operator
     *   
     *   Foo::operator()(int a, int b, 
     *           int c, int d)
     *
     *   Although no error or warning is generated
     * 
     *  
     */
    
        2
  •  1
  •   albert    6 年前

    您可以参考 here 了解自动链接在doxygen的工作原理