【问题标题】:How can I get doxygen to document a template class defined in .tcc file?如何让 doxygen 记录 .tcc 文件中定义的模板类?
【发布时间】:2017-03-25 18:00:53
【问题描述】:

我使用Code::Blocks 创建了一个C++ 项目。我有三个项目文件:一个包含类模板声明的.hxx 文件; .tcc 文件,其中定义和记录了类模板的成员函数;和一个.cxx 文件,其中包含一个测试该类实例的程序。我使用Code::Blocks 中的doxygen 接口来记录所有文件。但是,当我使用doxygen接口为项目生成文档时,doxygen生成的文档并没有同时包含实现代码和.tcc文件中的文档。

有人知道我应该怎么做才能让doxygen.tcc 文件中生成文档吗?任何有关解决此问题的帮助将不胜感激。

【问题讨论】:

    标签: c++ codeblocks doxygen


    【解决方案1】:

    来自标准的 Doxyfile

    #---------------------------------------------------------------------------
    # Configuration options related to the input files
    #---------------------------------------------------------------------------
    # The INPUT tag is used to specify the files and/or directories that contain
    # documented source files. You may enter file names like myfile.cpp or
    # directories like /usr/src/myproject. Separate the files or directories with
    # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
    # Note: If this tag is empty the current directory is searched.
    
    INPUT = path/to/src/dir
    
    # If the value of the INPUT tag contains directories, you can use the
    # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
    # *.h) to filter out the source-files in the directories.
    #
    # Note that for custom extensions or not directly supported extensions you also
    # need to set EXTENSION_MAPPING for the extension otherwise the files are not
    # read by doxygen.
    #
    # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
    # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
    # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
    # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
    # *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
    
    FILE_PATTERNS          = *.tcc *.cxx *.hxx
    

    另见:

    Doxygen input file documentation

    Doxygen file pattern documentation

    【讨论】:

    • 非常感谢@tike。您建议的解决方案对我来说非常有效。干杯!
    猜你喜欢
    • 1970-01-01
    • 2016-05-07
    • 1970-01-01
    • 2015-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-01
    • 1970-01-01
    • 2015-01-14
    相关资源
    最近更新 更多