问题
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