helpType.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2014 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::helpType
28 
29 Description
30  Base class for foam help classes
31 
32 SourceFiles
33  helpType.C
34  helpTypeNew.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef helpType_H
39 #define helpType_H
40 
41 #include "runTimeSelectionTables.H"
42 #include "autoPtr.H"
43 #include "argList.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward Declarations
51 class fvMesh;
52 
53 /*---------------------------------------------------------------------------*\
54  Class helpType Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class helpType
58 {
59 protected:
60 
61  //- Return file path to the Doxygen sources (if available)
62  fileName doxygenPath() const;
63 
64  //- Display the list of documentation options
66  (
67  const string& searchStr,
68  const bool exactMatch,
69  const word& ext
70  ) const;
71 
72  //- Display the help documentation in a browser
73  void displayDoc
74  (
75  const word& className,
76  const string& searchStr,
77  const bool exactMatch,
78  const word& ext
79  ) const;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("helpType");
86 
87  // Declare runtime constructor selection table
89  (
90  autoPtr,
91  helpType,
92  dictionary,
93  (),
94  ()
95  );
96 
97 
98  //- Default construct
99  helpType() = default;
100 
101  //- Selector
102  static autoPtr<helpType> New(const word& helpTypeName);
103 
104  //- Destructor
105  virtual ~helpType() = default;
106 
107 
108  // Member Functions
109 
110  //- Initialise - typically setting static variables,
111  // e.g. command line arguments
112  virtual void init();
113 
114  //- Execute the help
115  virtual void execute(const argList& args, const fvMesh& mesh) = 0;
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::helpType::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, helpType, dictionary,(),())
Foam::helpType::~helpType
virtual ~helpType()=default
Destructor.
Foam::helpType::init
virtual void init()
Initialise - typically setting static variables,.
Foam::helpType::doxygenPath
fileName doxygenPath() const
Return file path to the Doxygen sources (if available)
Foam::argList
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:123
Foam::helpType::New
static autoPtr< helpType > New(const word &helpTypeName)
Selector.
argList.H
Foam::helpType::TypeName
TypeName("helpType")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::helpType::displayDocOptions
void displayDocOptions(const string &searchStr, const bool exactMatch, const word &ext) const
Display the list of documentation options.
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::helpType::displayDoc
void displayDoc(const word &className, const string &searchStr, const bool exactMatch, const word &ext) const
Display the help documentation in a browser.
args
Foam::argList args(argc, argv)
Foam::helpType::execute
virtual void execute(const argList &args, const fvMesh &mesh)=0
Execute the help.
Foam::helpType
Base class for foam help classes.
Definition: helpType.H:56
Foam::helpType::helpType
helpType()=default
Default construct.
autoPtr.H