diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-30 11:48:32 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-30 11:48:32 (GMT) |
commit | e634088616c07a7e5d7e6dc91c8bb3f973637d58 (patch) | |
tree | 9391776db3bc44d5acf35b3339a8ce3037b8acac /src/util.cpp | |
parent | c50b92c39435b558c5cb53be47dba41503f26fad (diff) | |
download | Doxygen-e634088616c07a7e5d7e6dc91c8bb3f973637d58.zip Doxygen-e634088616c07a7e5d7e6dc91c8bb3f973637d58.tar.gz Doxygen-e634088616c07a7e5d7e6dc91c8bb3f973637d58.tar.bz2 |
Simplified extractDirection()
Also fixed bug preventing direction to be stripped from the parameter documentation.
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/util.cpp b/src/util.cpp index c810db5..bebfbb1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -8137,29 +8137,13 @@ bool classVisibleInIndex(const ClassDef *cd) QCString extractDirection(QCString &docs) { - QRegExp re("\\[[^\\]]+\\]"); // [...] + QRegExp re("\\[[ inout,]+\\]"); // [...] int l=0; if (re.match(docs,0,&l)==0) { - QRegExp re_in("\\[ *in *\\]"); // [in] - QRegExp re_out("\\[ *out *\\]"); // [out] - QRegExp re_inout("\\[ *in *[,]? *out *\\]"); // [in,out] - QRegExp re_outin("\\[ *out *[,]? *in *\\]"); // [out,in] - int l_in = 0; - int l_out = 0; - int l_inout = 0; - int l_outin = 0; - int inPos = re_in.match(docs,0,&l_in); - int outPos = re_out.match(docs,0,&l_out); - int inoutPos = re_inout.match(docs,0,&l_inout); - int outinPos = re_outin.match(docs,0,&l_outin); - // we only take the first occurrence into account - bool input = (inPos!=-1 && l==l_in) || - (inoutPos!=-1 && l==l_inout) || - (outinPos!=-1 && l==l_outin); - bool output = (outPos!=-1 && l==l_out) || - (inoutPos!=-1 && l==l_inout) || - (outinPos!=-1 && l==l_outin); + QCString dir=docs.left(l); + bool input = dir.find("in")!=-1; + bool output = dir.find("out")!=-1; if (input || output) // in,out attributes { docs = docs.mid(l); // strip attributes |