From e20debc69515eba71fbe7def1925e6df16224c96 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Thu, 30 Jul 2020 21:40:39 +0200 Subject: issue #7881: More flexible and correct detection of direction of an argument (fix) --- src/util.cpp | 17 ++++++++++------- 1 file 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(); -- cgit v0.12