Re: [Doxygen-users] C++ Anonymous Structure Identification (XML Output)
Brought to you by:
dimitri
From: Richard D. <Ri...@Da...> - 2016-07-16 01:49:13
|
On 7/15/16 7:27 PM, CareyG wrote: > I have created a simple union as follows: > > #ifndef _ANONUNION_H > #define _ANONUNION_H > > #ifdef __cplusplus > ///@brief Anonymous Union example. > namespace AnonUnion > { > #endif > > ///@brief Create a typename for our union. > typedef union { > ///@brief A short followed by two characters. > struct { > short s; ///<A short. > char ch1; ///<A single character. > char ch2; ///<Another character. > }; > > ///@brief Structure as an unsigned long. > unsigned long ul; > } Example; > #ifdef __cplusplus > } > #endif > > #endif > > When I process this file, called AnonUnion.h I get the usual output files. > In particular, the index file looks like: <snipped> > What I would like to know is how to identify that s, ch1 and ch2 are part of > the anonymous structure and that ul1 and the anonymous structure are part of > the union. > > I need to know this information to reconstruct the parsed input as part of a > documentation package I am creating using an automated tool. > > I noticed that several other people have had similar questions over the > years but none of them had a satisfactory answer that enables me to solve > this problem. > > Thank you. > > Carey I don't see any mention of the anonymous struct in the xml, which might not be that surprising as doxygen doesn't have anything to say about this struct since it is totally anonymous. You probably don't want to give it a member name, as that would require a lot of changes in the code, but perhaps if you gave it a struct tag, you might get doxygen to note its existence, and that shouldn't change how you use it. -- Richard Damon |