mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: foamHelp helpType clean-up
This commit is contained in:
@ -71,20 +71,22 @@ void Foam::helpType::displayDocOptions
|
|||||||
{
|
{
|
||||||
fileName doxyPath(doxygenPath());
|
fileName doxyPath(doxygenPath());
|
||||||
|
|
||||||
if (!doxyPath.empty())
|
if (doxyPath.empty())
|
||||||
{
|
{
|
||||||
Info<< "Found doxygen help in " << doxyPath.c_str() << nl << endl;
|
return;
|
||||||
|
|
||||||
doxygenXmlParser parser
|
|
||||||
(
|
|
||||||
doxyPath/"../DTAGS",
|
|
||||||
"tagfile",
|
|
||||||
searchStr,
|
|
||||||
exactMatch
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Valid types include:" << nl << SortableList<word>(parser.toc());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Info<< "Found doxygen help in " << doxyPath.c_str() << nl << endl;
|
||||||
|
|
||||||
|
doxygenXmlParser parser
|
||||||
|
(
|
||||||
|
doxyPath/"../DTAGS",
|
||||||
|
"tagfile",
|
||||||
|
searchStr,
|
||||||
|
exactMatch
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "Valid types include:" << nl << SortableList<word>(parser.toc());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -97,62 +99,60 @@ void Foam::helpType::displayDoc
|
|||||||
{
|
{
|
||||||
fileName doxyPath(doxygenPath());
|
fileName doxyPath(doxygenPath());
|
||||||
|
|
||||||
if (!doxyPath.empty())
|
if (doxyPath.empty())
|
||||||
{
|
{
|
||||||
Info<< "Found doxygen help in " << doxyPath.c_str() << nl << endl;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
string docBrowser = getEnv("FOAM_DOC_BROWSER");
|
Info<< "Found doxygen help in " << doxyPath.c_str() << nl << endl;
|
||||||
if (docBrowser.empty())
|
|
||||||
{
|
|
||||||
const dictionary& docDict =
|
|
||||||
debug::controlDict().subDict("Documentation");
|
|
||||||
docDict.lookup("docBrowser") >> docBrowser;
|
|
||||||
}
|
|
||||||
|
|
||||||
doxygenXmlParser parser
|
string docBrowser = getEnv("FOAM_DOC_BROWSER");
|
||||||
|
if (docBrowser.empty())
|
||||||
|
{
|
||||||
|
const dictionary& docDict =
|
||||||
|
debug::controlDict().subDict("Documentation");
|
||||||
|
docDict.lookup("docBrowser") >> docBrowser;
|
||||||
|
}
|
||||||
|
|
||||||
|
doxygenXmlParser parser
|
||||||
|
(
|
||||||
|
doxyPath/"../DTAGS",
|
||||||
|
"tagfile",
|
||||||
|
searchStr,
|
||||||
|
exactMatch
|
||||||
|
);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parser.found(className))
|
||||||
|
{
|
||||||
|
fileName docFile(doxyPath/parser.subDict(className).lookup("filename"));
|
||||||
|
|
||||||
|
// can use FOAM_DOC_BROWSER='application file://%f' if required
|
||||||
|
docBrowser.replaceAll("%f", docFile);
|
||||||
|
|
||||||
|
fileName classFolder(parser.subDict(className).lookup("path"));
|
||||||
|
word classFile(parser.subDict(className).lookup("name"));
|
||||||
|
|
||||||
|
Info<< "Showing documentation for type " << className << nl << endl;
|
||||||
|
|
||||||
|
Info<< "Source file: " << classFolder.c_str() << classFile << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
system(docBrowser);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
doxyPath/"../DTAGS",
|
"void Foam::helpType::displayDoc(const word, const string)"
|
||||||
"tagfile",
|
)
|
||||||
searchStr,
|
<< "No help for type " << className << " found."
|
||||||
exactMatch
|
<< " Valid options include:" << SortableList<word>(parser.toc())
|
||||||
);
|
<< exit(FatalError);
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< parser;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parser.found(className))
|
|
||||||
{
|
|
||||||
fileName docFile
|
|
||||||
(
|
|
||||||
doxyPath/parser.subDict(className).lookup("filename")
|
|
||||||
);
|
|
||||||
|
|
||||||
// can use FOAM_DOC_BROWSER='application file://%f' if required
|
|
||||||
docBrowser.replaceAll("%f", docFile);
|
|
||||||
|
|
||||||
fileName classFolder(parser.subDict(className).lookup("path"));
|
|
||||||
word classFile(parser.subDict(className).lookup("name"));
|
|
||||||
|
|
||||||
Info<< "Showing documentation for type " << className << nl << endl;
|
|
||||||
|
|
||||||
Info<< "Source file: " << classFolder.c_str() << classFile << nl
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
system(docBrowser);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"void Foam::helpType::displayDoc(const word, const string)"
|
|
||||||
)
|
|
||||||
<< "No help for type " << className << " found."
|
|
||||||
<< " Valid options include:"
|
|
||||||
<< SortableList<word>(parser.toc())
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user