diff options
Diffstat (limited to 'src/util.cpp')
-rwxr-xr-x | src/util.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp index 1f49fb3..efd3d3c 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -7132,6 +7132,9 @@ void initDefaultExtensionMapping() updateLanguageMapping(".f", "fortran"); updateLanguageMapping(".for", "fortran"); updateLanguageMapping(".f90", "fortran"); + updateLanguageMapping(".f95", "fortran"); + updateLanguageMapping(".f03", "fortran"); + updateLanguageMapping(".f08", "fortran"); updateLanguageMapping(".vhd", "vhdl"); updateLanguageMapping(".vhdl", "vhdl"); updateLanguageMapping(".tcl", "tcl"); @@ -8082,6 +8085,7 @@ bool copyFile(const QCString &src,const QCString &dest) /** Returns the section of text, in between a pair of markers. * Full lines are returned, excluding the lines on which the markers appear. + * \sa routine lineBlock */ QCString extractBlock(const QCString text,const QCString marker) { @@ -8125,6 +8129,29 @@ QCString extractBlock(const QCString text,const QCString marker) return l2>l1 ? text.mid(l1,l2-l1) : QCString(); } +/** Returns the line number of the line following the line with the marker. + * \sa routine extractBlock + */ +int lineBlock(const QCString text,const QCString marker) +{ + int result = 1; + int p=0,i; + bool found=FALSE; + + // find the character positions of the first marker + int m1 = text.find(marker); + if (m1==-1) return result; + + // find start line positions for the markers + while (!found && (i=text.find('\n',p))!=-1) + { + found = (p<=m1 && m1<i); // found the line with the start marker + p=i+1; + result++; + } + return result; +} + /** Returns a string representation of \a lang. */ QCString langToString(SrcLangExt lang) { |