When I checked the help document of cl.exe installed on my computer through vs, I found a/DOC option in it. I can generate a document by commenting. So I tested it for a moment:
Cl.exe/Doc "OBJ/myclass. xdc"/FO "OBJ/myclass. OBJ" src/myclass. cpp
The comments starting with // in the source code are extracted as documents. The specific identifiers are the same as those in C #, for example:
/// <Summary>
/// As a document comment
/// </Summary>
Class myclass
{
};
The generated xdcfile contains an XML file of 8 bytes. You can use xdcmake.exe to compile the xdc file into an XML file:
Xdcmake.exe/out: "myclass. xml" myclass. xdc
The compiled XML file is also UTF-8 encoded, And the content is almost the same as the xdc file (it seems that the order is changed, it seems meaningless to do this compilation ).
I believe that ndoc and other tools can convert XML into CHM files.
Compared with doxygen, cl.exe has the following features:
1. The tag format is the same as that of C #.ProgramBut the number of tags is far behind that of doxygen;
2. The document generation tool converts the C ++ type to the C # type !!! It seems that this function is only available from the C # compiler, and is not customized for C ++.
Doxygen is still supported for free advertising once.