且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

源代码美化c ++(vc ++)?

更新时间:2023-11-24 16:51:46

请使用 Doxygen 构建文档。它可以通过正确的设置从源中推断出很多。对于每个已记录的对象,它会变得更好。但是,Doxygen不会帮助您规范代码的格式和布局。



对于该任务,您需要一个代码美化工具。经典工具是 indent 。然而,一个更通用的工具是 Uncrustify ,这是明确命名的通用缩进GUI 。后一种工具支持各种语言,并提供了一个很好的GUI界面,可以帮助您将设置调整为首选样式。



以上所有内容都是免费的,开放的来源,顺便说一下。



一旦你使用Doxygen,你也想安装 Graphviz 工具,以便它可以绘制您调用图和其他图。


I have a set of 250 header files and cpp files of my project. I wanted to format the old code and generate API documentation. Is there any tool that can help me do this?

I am thinking of using DOxygen, but I believe that needs the information in a some format.

Do use Doxygen for building documentation. It can infer a lot from the source as-is with the right settings. It gets better with suitable comments for each documented object. However, Doxygen won't help you regularize your code's format and layout.

For that task, you want a code beautifier. The classic tool was indent. However, a much more versatile tool is Uncrustify, which is one of several beautifiers included in the clearly named Universal Indent GUI. The latter tool supports a wide array of languages, and provides a nice GUI interface to help you tune the settings to your preferred style.

All of the above are free and open source, incidentally.

Once you get into using Doxygen, you will want to also install the Graphviz tools so that it can draw you call graphs and other diagrams.