ENH: Updated foamHelp utility

This commit is contained in:
andy
2013-01-23 10:24:04 +00:00
parent 0499f53408
commit c063a100f0
3 changed files with 31 additions and 30 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -176,38 +176,32 @@ Foam::doxygenXmlParser::doxygenXmlParser
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::doxygenXmlParser::skipBlock(IFstream& is, const word blockName) const
void Foam::doxygenXmlParser::skipBlock
(
IFstream& is,
const word& blockName
) const
{
// recurse to move forward in 'is' until come across </blockName>
string closeName = "";
// fast-forward until we reach a '<'
char c;
while (is.get(c) && c != '<')
{}
// check to see if this is a closing block
if (is.get(c) && c == '/')
while (is.good() && (closeName != blockName))
{
while (is.get(c) && c != '>')
{
closeName += c;
}
// fast-forward until we reach a '<'
while (is.get(c) && c != '<')
{}
if (closeName == blockName)
// check to see if this is a closing block
if (is.get(c) && c == '/')
{
// finished reading block
return;
closeName = "";
while (is.get(c) && c != '>')
{
closeName += c;
}
}
else
{
skipBlock(is, blockName);
}
}
else
{
skipBlock(is, blockName);
}
}
@ -215,7 +209,7 @@ void Foam::doxygenXmlParser::skipBlock(IFstream& is, const word blockName) const
void Foam::doxygenXmlParser::skipForward
(
IFstream& is,
const word blockName
const word& blockName
) const
{
// recurse to move forward in 'is' until come across <blockName>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,8 +25,10 @@ Class
Foam::doxygenXmlParser
Description
Parser for doxygen XML
SourceFiles
doxygenXmlParser.C
\*---------------------------------------------------------------------------*/
@ -65,10 +67,10 @@ public:
// Member functions
//- Skip past a block
void skipBlock(IFstream& is, const word blockName) const;
void skipBlock(IFstream& is, const word& blockName) const;
//- Skip forward to block
void skipForward(IFstream& is, const word blockName) const;
void skipForward(IFstream& is, const word& blockName) const;
//- Return the entry
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -148,7 +148,12 @@ void Foam::helpType::displayDoc
{
FatalErrorIn
(
"void Foam::helpType::displayDoc(const word, const string)"
"void Foam::helpType::displayDoc"
"("
"const word&, "
"const string&, "
"const bool"
")"
)
<< "No help for type " << className << " found."
<< " Valid options include:" << SortableList<word>(parser.toc())