Hi all,
I have for a while now been working on a tool that documents exception
propagation through C++ code. It is basically a GCC extension that
generates files with information about the call graph and also
information about exceptions originated from any particular function.
After gcc has generated this information i use a post processing tool
that calculates based on the call graph what exceptions may propagate
through a function.
It does its best to take into account virtual functions, function
pointers and other forms of runtime function calling.
Anyhow it is now starting to work and want to integrate this
information into the output of running doxygen. I.e. have doxygen read
a file that my post processing tool generates and use that to
automatically populate the exception information for all functions (As
though the user provided doxygen with a \throw command)
I could not find a way of achieving this with doxygen as it currently
stands.
As an example of what i would do, for the following code:
----------------------------
class Exception
{
};
void Function(int blah, float f)
{
int i = 0;
throw i;
}
static void Func2()
{
}
int main()
{
Function(0, 0.0f);
throw Exception;
return 0;
}
----------------------------
I would generate an output file that looks something like:
F ::int ::main()
O ::Exception
P ::int
F ::void ::Function(::int, ::float)
O ::int
F ::void ::Func2() : ./src/main.cpp
----------------------------
In this file if the line starts with
F then it defines the name of a function
O it defines an exception that that function originates
P it defines an exception that can propagate through that function
Note that the name of the function for static functions includes the
name of the file in which the static function belongs.
Now this format is just what i have been using for my testing
purposes. I can change it however to better suite importing into doxygen.
Could doxygen be easily modified to gather information from a single
file in order to add additional documentation to various functions?
Does it already support some sort of functionality like this that i
could leverage?
What would be the best "format" for me to present this information in
for doxygen?
Just thinking aloud, would it would if I created a file like below and
included that to be processed with the rest of the source files?
Will this overwrite the existing documentation for those functions etc
or just add to it?
/*! \fn main()
*
* \throws Exception
* \throws int
*/
/*! \fn Function(int, float)
*
* \throws int
*/
/*! \fn Func2()
*
*/
Thanks for any help.
Brendon.
|