diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-30 19:40:39 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-30 19:40:39 (GMT) |
commit | e20debc69515eba71fbe7def1925e6df16224c96 (patch) | |
tree | 74555486fc496789b122f254fa63748d0b176029 | |
parent | b52706b8ee01f45cc3616c52c78dcc8b2d21b464 (diff) | |
download | Doxygen-e20debc69515eba71fbe7def1925e6df16224c96.zip Doxygen-e20debc69515eba71fbe7def1925e6df16224c96.tar.gz Doxygen-e20debc69515eba71fbe7def1925e6df16224c96.tar.bz2 |
issue #7881: More flexible and correct detection of direction of an argument (fix)
-rw-r--r-- | src/util.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/util.cpp b/src/util.cpp index bebfbb1..13b3ca5 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -8141,15 +8141,18 @@ QCString extractDirection(QCString &docs) int l=0; if (re.match(docs,0,&l)==0) { - QCString dir=docs.left(l); - bool input = dir.find("in")!=-1; - bool output = dir.find("out")!=-1; - if (input || output) // in,out attributes + // make dir the part inside [...] without separators + QCString dir=substitute(substitute(docs.mid(1,l-2)," ",""),",",""); + int inIndex, outIndex; + unsigned char ioMask=0; + if (( inIndex=dir.find( "in"))!=-1) dir.remove (inIndex,2),ioMask|=(1<<0); + if ((outIndex=dir.find("out"))!=-1) dir.remove(outIndex,3),ioMask|=(1<<1); + if (dir.isEmpty() && ioMask!=0) // only in and/or out attributes found { docs = docs.mid(l); // strip attributes - if (input && output) return "[in,out]"; - else if (input) return "[in]"; - else if (output) return "[out]"; + if (ioMask==((1<<0)|(1<<1))) return "[in,out]"; + else if (ioMask==(1<<0)) return "[in]"; + else if (ioMask==(1<<1)) return "[out]"; } } return QCString(); |