Invalid Doxygen String Value

Doxygen (1.8.10) complains that the value of my string is not documented. Here is a minimal example demonstrating the problem

#include <string>

struct MyStruct ///< Docs for struct
{
    std::string a; ///< Docs for a
    std::string b; ///< Docs for b
};

class MyClass ///< Docs for class
{
    static struct MyStruct instance; ///< Docs for instance
};

struct MyStruct MyClass::instance = {"firstVal", "secondVal"};

This leads to a warning

/tmp/example.cpp:10: warning: Member firstVal (variable) of class MyClass is not documented.

If I reduce the structure to one element and remove the "secondVal" from the initializer, then the warning will disappear, but obviously this is not a solution ...

+4
source share
2 answers

Just remove the excess struct. How in:

#include <string>

struct MyStruct ///< Docs for struct
{
    std::string a; ///< Docs for a
    std::string b; ///< Docs for b
};

class MyClass ///< Docs for class
{
    static struct MyStruct instance; ///< Docs for instance
};

MyStruct MyClass::instance = {"firstVal", "secondVal"};

C ++ does not require use struct MyStructand instead allows only normal use MyStruct. Making this tiny change causes the warning to go away with doxygen 1.8.13.

+3
source

EXTRACT_ALL doxyfile YES, .

EXTRACT_ALL:

# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
# documentation are documented, even if no documentation was available. Private
# class members and static file members will be hidden unless the
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
# Note: This will also disable the warnings about undocumented members that are
# normally produced when WARNINGS is set to YES.
# The default value is: NO.

:

///< . , :

/**
 * Docs for struct
 */
struct MyStruct 
{
    std::string a; ///< Docs for a
    std::string b; ///< Docs for b
};

/** 
 * Docs for class
 */
class MyClass 
{
    static struct MyStruct instance; ///< Docs for instance
};

, ///<, :

struct MyStruct 
{
    std::string a; ///< Docs for a
    std::string b; ///< Docs for b
}; ///< Docs for struct

class MyClass 
{
    static struct MyStruct instance; ///< Docs for instance
}; ///< Docs for class
-1

Source: https://habr.com/ru/post/1666748/


All Articles