Add support for doxygen:alias feature
This allows to replace non-standard Doxygen commands with some (fixed) text instead of just ignoring them, as was already possible with the feature doxygen:ignore.
This commit is contained in:
parent
4e7dad2b76
commit
751f617aac
7 changed files with 144 additions and 4 deletions
|
|
@ -583,6 +583,7 @@ $(eval HAS_DOXYGEN := $($(LANGUAGE)_HAS_DOXYGEN))
|
|||
ifdef HAS_DOXYGEN
|
||||
DOXYGEN_TEST_CASES += \
|
||||
doxygen_parsing \
|
||||
doxygen_alias \
|
||||
doxygen_ignore \
|
||||
doxygen_basic_translate \
|
||||
doxygen_basic_notranslate \
|
||||
|
|
|
|||
22
Examples/test-suite/doxygen_alias.i
Normal file
22
Examples/test-suite/doxygen_alias.i
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
%module doxygen_alias
|
||||
|
||||
#ifdef SWIGJAVA
|
||||
%feature("doxygen:alias:nullptr") "null"
|
||||
#elif defined(SWIGPYTHON)
|
||||
%feature("doxygen:alias:nullptr") "None"
|
||||
#else
|
||||
%feature("doxygen:alias:nullptr") "NULL"
|
||||
#endif
|
||||
|
||||
%inline %{
|
||||
|
||||
class Something {};
|
||||
|
||||
/**
|
||||
A function returning something.
|
||||
|
||||
@returns A new object which may be @nullptr.
|
||||
*/
|
||||
Something* make_something() { return 0; }
|
||||
|
||||
%}
|
||||
32
Examples/test-suite/java/doxygen_alias_runme.java
Normal file
32
Examples/test-suite/java/doxygen_alias_runme.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
import doxygen_alias.*;
|
||||
import com.sun.javadoc.*;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class doxygen_alias_runme {
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("doxygen_alias");
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String argv[])
|
||||
{
|
||||
CommentParser parser = new CommentParser();
|
||||
com.sun.tools.javadoc.Main.execute("doxygen_alias runtime test",
|
||||
"CommentParser",
|
||||
new String[]{"-quiet", "doxygen_alias"});
|
||||
|
||||
HashMap<String, String> wantedComments = new HashMap<String, String>();
|
||||
wantedComments.put("doxygen_alias.doxygen_alias.make_something()",
|
||||
" A function returning something.<br>\n" +
|
||||
" <br>\n" +
|
||||
" @return A new object which may be null.\n" +
|
||||
"");
|
||||
|
||||
System.exit(parser.check(wantedComments));
|
||||
}
|
||||
}
|
||||
12
Examples/test-suite/python/doxygen_alias_runme.py
Normal file
12
Examples/test-suite/python/doxygen_alias_runme.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import doxygen_alias
|
||||
import inspect
|
||||
import commentVerifier
|
||||
|
||||
commentVerifier.check(inspect.getdoc(doxygen_alias.make_something),
|
||||
"""\
|
||||
A function returning something.
|
||||
|
||||
:rtype: :py:class:`Something`
|
||||
:return: A new object which may be None.""")
|
||||
Loading…
Add table
Add a link
Reference in a new issue