44 List<fileName> docDirs(docDict.lookup(
"doxyDocDirs"));
58 Info<<
"No Doxygen sources found under search paths: "
69 const string& searchStr,
70 const bool exactMatch,
74 fileName doxyPath(doxygenPath());
81 Info<<
"Found doxygen help in " << doxyPath.c_str() <<
nl <<
endl;
83 doxygenXmlParser parser
97 Info<<
"Valid types:" <<
nl << parser.sortedToc();
103 const word& className,
104 const string& searchStr,
105 const bool exactMatch,
109 fileName doxyPath(doxygenPath());
111 if (doxyPath.empty())
116 Info<<
"Found doxygen help in " << doxyPath.c_str() <<
nl <<
endl;
118 string docBrowser =
getEnv(
"FOAM_DOC_BROWSER");
119 if (docBrowser.empty())
121 const dictionary& docDict =
123 docDict.
readEntry(
"docBrowser", docBrowser);
126 doxygenXmlParser parser
140 if (parser.found(className))
144 doxyPath/parser.subDict(className).get<fileName>(
"filename")
148 docBrowser.replaceAll(
"%f", docFile);
150 fileName classDirectory
152 parser.subDict(className).get<fileName>(
"path")
156 parser.subDict(className).get<word>(
"name")
159 Info<<
"Showing documentation for type " << className <<
nl <<
endl;
161 Info<<
"Source file: " << classDirectory.c_str() << classFile <<
nl
169 <<
"No help for type " << className <<
" found."
170 <<
" Valid options:" << parser.sortedToc()
184 "Display documentation in browser"
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A class for handling file names.
fileName doxygenPath() const
Return file path to the Doxygen sources (if available)
void displayDocOptions(const string &searchStr, const bool exactMatch, const word &ext) const
Display the list of documentation options.
void displayDoc(const word &className, const string &searchStr, const bool exactMatch, const word &ext) const
Display the help documentation in a browser.
virtual void init()
Initialise - typically setting static variables,.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dictionary & controlDict()
string expand(const std::string &s, const HashTable< string > &mapping, const char sigil='$')
string getEnv(const std::string &envName)
Get environment value for given envName.
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
constexpr char nl
The newline '\n' character (0x0a)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.
#define forAll(list, i)
Loop across all elements in list.