From 48cf4e6715a3ae64ca17d36dde7bb367a435fc4c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 16 Aug 2012 15:46:49 +0100 Subject: [PATCH] STYLE: foamHelp helpType clean-up --- .../foamHelp/helpTypes/helpType/helpType.C | 128 +++++++++--------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C index ed356b93cb..9391e753e6 100644 --- a/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C +++ b/applications/utilities/miscellaneous/foamHelp/helpTypes/helpType/helpType.C @@ -71,20 +71,22 @@ void Foam::helpType::displayDocOptions { fileName doxyPath(doxygenPath()); - if (!doxyPath.empty()) + if (doxyPath.empty()) { - Info<< "Found doxygen help in " << doxyPath.c_str() << nl << endl; - - doxygenXmlParser parser - ( - doxyPath/"../DTAGS", - "tagfile", - searchStr, - exactMatch - ); - - Info<< "Valid types include:" << nl << SortableList(parser.toc()); + return; } + + Info<< "Found doxygen help in " << doxyPath.c_str() << nl << endl; + + doxygenXmlParser parser + ( + doxyPath/"../DTAGS", + "tagfile", + searchStr, + exactMatch + ); + + Info<< "Valid types include:" << nl << SortableList(parser.toc()); } @@ -97,62 +99,60 @@ void Foam::helpType::displayDoc { 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"); - if (docBrowser.empty()) - { - const dictionary& docDict = - debug::controlDict().subDict("Documentation"); - docDict.lookup("docBrowser") >> docBrowser; - } + Info<< "Found doxygen help in " << doxyPath.c_str() << nl << endl; - 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", - "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 - ( - "void Foam::helpType::displayDoc(const word, const string)" - ) - << "No help for type " << className << " found." - << " Valid options include:" - << SortableList(parser.toc()) - << exit(FatalError); - } + "void Foam::helpType::displayDoc(const word, const string)" + ) + << "No help for type " << className << " found." + << " Valid options include:" << SortableList(parser.toc()) + << exit(FatalError); } }