From f6212289c6f3793e2b5131f33e2a4f73eee40ceb Mon Sep 17 00:00:00 2001 From: Martin Anderseck Date: Thu, 21 May 2026 16:13:08 +0200 Subject: [PATCH] coding guidelines: Add information on documentation This adds information on what the C++ method documentation should look like, so that Doxygen can get the most out of it. --- CODING.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CODING.md b/CODING.md index 7f95c1d56..6da4d7058 100644 --- a/CODING.md +++ b/CODING.md @@ -93,6 +93,27 @@ Date: Tue Nov 22 16:19:38 2016 -0800 an exception if the index doesn't exist -- which is usually the desired behaviour. +* Documenting methods is highly encouraged. To make the documentation well + digestible for Doxygen, use the Qt style and add an exclamation mark (`!`) + after the opening C-style comment block. Use `\brief` to mark a brief + introductory line, then add an empty line (starting with `*`), then + continue with the detailed description. Add `\param` for each parameter + and `\return` for describing the return value. For single-line method + documentation, `//!` is okay. Example + +```cpp +/*! \brief Summary line. + * + * more details + * \param variable Explanation of variable (if applicable) + * \return Explanation of return value (if applicable) + */ +bool example_method(uint32_t variable) {}; + +//! Short description of a simple method. +void example_method2() {}; +``` + ## Boost-specific Guidelines