如何为Doxygen样式的文件头配置CLion? [英] How to configure CLion for a Doxygen-style file header?

查看:52
本文介绍了如何为Doxygen样式的文件头配置CLion?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我在CLion上创建.cpp/.h文件时,都会得到一个像这样的自动文件头:

Every time I create a .cpp/.h file on CLion, I get an automatic file header like this:

//
// Created by me on 09/11/18.
//

这很整洁,但我希望这样的东西符合Doxygen的要求:

This is neat, but I'd rather like something Doxygen-compliant like this:

/*!
 * @author me
 * @date 03/12/18.
 */

得益于出色的CLion集成,我可以轻松地对此进行编辑并添加更多Doxygen字段.

I could easily edit this and add more Doxygen-fields thanks to the nice CLion integration.

这似乎是一件微不足道的任务,但我仍然没有设法实现它.有人可以帮我吗?

This seems a trivial task, but I still did not manage to achieve it. May someone help me out?

此致

按照建议,我转到文件和代码模板",然后单击包含"选项卡(默认情况下已选择文件"),然后找到了所需的模式.我对它进行了如下修改:

As suggested, I went to "File and Code Templates", then clicked on the "Includes" Tab (Files was selected by default) and I found the pattern I was looking for. I modified it as in the following:

#if ($HEADER_COMMENTS)
/*!
 * @author $USER_NAME 
 * @date ${DATE}
#if ($ORGANIZATION_NAME && $ORGANIZATION_NAME != "")
 * Copyright (c) $YEAR ${ORGANIZATION_NAME}#if (!$ORGANIZATION_NAME.endsWith(".")).#end All rights reserved.
#end
 */
#end

推荐答案

转到文件->设置...->编辑器->文件和代码模板->包含.在那里,您会找到一个名为 C File Header 的包含文件,该文件包含在所有其他与C/C ++相关的文件类型中,可以根据需要进行调整.

Go to File->Settings...->Editor->File and Code Templates->Includes. There you will find an include called C File Header which is included by all other C/C++ related file types and can be adjusted for your needs.

这篇关于如何为Doxygen样式的文件头配置CLion?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆