How to configure CLion for a Doxygen-style file header?

微笑、不失礼 提交于 2021-02-10 07:37:08

问题


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.
//

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

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

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?

Regards,

Edit: 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

回答1:


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.



来源:https://stackoverflow.com/questions/53596489/how-to-configure-clion-for-a-doxygen-style-file-header

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!