I'm using Doxygen to document API written in Objective-C.
Doyxygen fail to understand NS_ENUM typedef.
I've found this solution but it did not work for me.
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = NS_ENUM(x,y)=y
Regards,
Dimitri
This is my input file:
/**
* Represent the possible states.
*/
typedef NS_ENUM(NSInteger, ABEnumType)
{
/**
* State A.
*/
StateA = 0,
/**
* State B.
*/
StateB
};
This is the output I get:
Preprocessing /src/ABEnumType.h...
error: /src/ABEnumType.h:17:17: error: C++ requires a type specifier for all declarations [clang]
error: /src/ABEnumType.h:17:28: error: unknown type name 'ABEnumType' [clang]
error: /src/ABEnumType.h:18:1: error: function definition is not allowed here [clang]
error: /src/ABEnumType.h:17:9: error: C++ requires a type specifier for all declarations [clang]
Parsing file /src/ABEnumType.h...
The following settings worked for us:
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = NS_ENUM(x,y)=enum y
With this we see all the NS_ENUM structures showing up in our doxygen generated documentation
If Doxygen fails, you can always try HeaderDocs.
EDIT: I tried headerdocs with a test class and I think it does provide good support of NS_ENUM.
//
// VLTTestClass.h
// VPNLoginTest
//
#import <Foundation/Foundation.h>
/*!
Test class type description.
*/
typedef NS_ENUM(NSInteger, VLTestClassType) {
/*!
Description for type 1.
*/
VLTestClassType1,
/*!
Description for type 2.
*/
VLTestClassType2
};
/*!
Description for test class
*/
@interface VLTTestClass : NSObject
@end
Here is the headerdoc2html:http://pastebin.com/q6RsR0tU
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With