0

I'm new to Doxygen and can't figure out if I am missing a specific step or the code is too difficult for it to parse. Pretty much every class in this project will #include <common.hpp>, where the following is defined:

#define DFS_NAMESPACE_BEGIN namespace dfs {
#define DFS_NAMESPACE_END }

So for example in class Alg/Thing.hpp

#ifndef _DFS_ALG_THING_H
#define _DFS_ALG_THING_H

#include <common.hpp>

DFS_NAMESPACE_BEGIN

class Thing {
    ...
};

DFS_NAMESPACE_END

#endif

I've got

  • ENABLE_PREPROCESSING=YES
  • MACRO_EXPANSION=YES
  • EXPAND_ONLY_PREDEF=NO
  • SEARCH_INCLUDES=YES

which based off what the Doxyfile claims should be enough. I've tried explicitly specifiying the common.hpp path, PREDEFINED, turning off SKIP_FUNCTION_MACROS, and a few others without success. The best I could get PREDEFINED to give me, though, was instead of class Thing it made it namespace Thing.

Namespaces do work as expected if I just write them out instead of using the above define, but I'd like to keep this macro (or perhaps replace it with a similar one?) for readability.

Is this fixable? Is there another way to maybe just raw text-replace the DFS_NAMESPACE_* or something? Thanks for any help!

1 Answer 1

1

Ok this shouldn't be necessary, but I was able to get it working with

ENABLE_PREPROCESSING   = YES
MACRO_EXPANSION        = YES
EXPAND_ONLY_PREDEF     = YES
PREDEFINED             = DFS_NAMESPACE_BEGIN="namespace dfs {"
PREDEFINED            += DFS_NAMESPACE_END="}"
SEARCH_INCLUDES        = YES
SKIP_FUNCTION_MACROS   = YES

I think I had a problem with the original PREDEFINED enumeration, I escaped it with \ but I think the leading whitespace may have caused issues?

Just a little frustrating because I don't want to have to enumerate all of the macros I want in the Doxyfile. Hopefully somebody benefits from this someday though.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.