Doxygen 不会为独立函数生成文档

Doxygen does not generate documentation for stand alone functions

我使用的 doxygen 设置非常适合 类、结构和命名空间,但不会为独立函数生成任何文档。

例如,这些方法不会生成任何内容:

#ifndef STRING_UTILS_H
#define STRING_UTILS_H 1
/// @file

/// @brief Trim whitespace from the start of the string
/// @param s - The string to left trim
/// @return the trimmed string
std::string ltrim(const std::string& s);

/// @brief Trim whitespace from the end of the string
/// @param s - The string to right trim
/// @return the trimmed string
std::string rtrim(const std::string& s);

/// @brief Trim whitespace from both sides of the string
/// @param s - The string to trim
/// @return the trimmed string
std::string trim(const std::string& s);

#endif

SHOW_FILES 除了在源文件

中具有 /// @file 之外,还必须在 Doxygen 文件中设置为 YES