我尝试使用包含调用+调用者图表生成doxygen文档,但不包括输出文档中的源模块。我不希望有两个文件doxytest.c
和*.h
重复某些功能并将私有函数暴露给文档。
我的理解是doxygen需要将源模块作为输入进行处理,以生成调用+调用者图。这没关系,但我没有找到一种方法来包含这个功能,同时从doc-build中排除源模块..
问题
- 为api(
中的函数生成call + callee图*.c
)- 从文档
中排除源模块(doxytest |-----doxygen.config |-----doxytest.h |-----doxytest.c |-----html
)
我创建了以下doxytest项目,其中有三个文件存在此问题:
项目结构
PROJECT_NAME = "doxytest"
OUTPUT_DIRECTORY = ./
OPTIMIZE_OUTPUT_FOR_C = YES
TYPEDEF_HIDES_STRUCT = YES
HIDE_SCOPE_NAMES = YES
SHOW_NAMESPACES = NO
INPUT = ./
FILE_PATTERNS = *.h *.c
GENERATE_HTML = YES
GENERATE_LATEX = NO
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH = ./
INCLUDE_FILE_PATTERNS = *.h
PREDEFINED =
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
HAVE_DOT = YES
SOURCE_BROWSER = NO
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO
CALL_GRAPH = YES
CALLER_GRAPH = YES
DIRECTORY_GRAPH = NO
COLLABORATION_GRAPH = NO
DISABLE_INDEX = YES
GENERATE_TREEVIEW = YES
doxygen.config
#ifndef __doxytest__
#define __doxytest__
/*! @file
*/
void callee();
void middleman();
void caller();
#endif __doxytest__
doxytest.h
#include <doxytest.h>
#include <stdio.h>
void callee()
{
;
}
void middleman()
{
callee();
}
void caller()
{
middleman();
}
doxytest.c
doxytest.c
当前行为
此配置使用call + callee图表生成输出,但还包括输出( screenshot1 )中的*.c
文档
如果我从FILE_PATTERNS中删除FILE_PATTERNS = *.h
,请将此行更改为:
*.c
然后这将删除.PHONY:docs
docs:
doxygen doxygen.pass1.cfg;
mv html htmlpass1;
doxygen doxygen.pass2.cfg;
ls `cat doxygen.pass2.cfg | grep '^INPUT' | cut -d '=' -f2` | grep '\.h$$' | sed 's/\.h$$/_8h\*/g' | sed 's/^/rm -f .\/html\//g' 1>graph_api_docs;
ls `cat doxygen.pass2.cfg | grep '^INPUT' | cut -d '=' -f2` | grep '\.h$$' | sed 's/\.h$$/_8h\*/g' | sed 's/^/cp .\/htmlpass1\//g' | sed 's/$$/ .\/html\//g' 1>>graph_api_docs;
/bin/bash graph_api_docs;
rm -rf htmlpass1 graph_api_docs;
.PHONY:clean
clean:
rm -rf ./html;
文档输出以及调用+被调用者图表。( screenshot2 )
我该如何解决?
<小时/> 的黑客
作为一个(非常狡猾的)解决方法,我目前正在进行两次doxygen传递并将图形文档合并到仅api索引中:
btnPlay.addEventListener(MouseEvent.CLICK, pickPlay);
var loader:Loader = new Loader();
addChild(loader);
function pickPlay(event:MouseEvent):void
{
var SWFRequest:URLRequest = new URLRequest("play.swf");
loader.load(SWFRequest);
}
仍在寻找解决此问题的正确方法..