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 declaration of classes
51 
52 class fvMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class helpType Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class helpType
59 {
60 
61 protected:
62 
63  //- Return file path to the Doxygen sources (if available)
64  fileName doxygenPath() const;
65 
66  //- Display the list of documentation options
68  (
69  const string& searchStr,
70  const bool exactMatch,
71  const word& ext
72  ) const;
73 
74  //- Display the help documentation in a browser
75  void displayDoc
76  (
77  const word& className,
78  const string& searchStr,
79  const bool exactMatch,
80  const word& ext
81  ) const;
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("helpType");
88 
89  // Declare runtime constructor selection table
91  (
92  autoPtr,
93  helpType,
94  dictionary,
95  (),
96  ()
97  );
98 
99 
100  //- Constructor
101  helpType();
102 
103  //- Selector
104  static autoPtr<helpType> New(const word& helpTypeName);
105 
106  //- Destructor
107  virtual ~helpType();
108 
109 
110  // Member Functions
111 
112  //- Initialise - typically setting static variables,
113  // e.g. command line arguments
114  virtual void init();
115 
116  //- Execute the help
117  virtual void execute(const argList& args, const fvMesh& mesh) = 0;
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
Foam::helpType::~helpType
virtual ~helpType()
Destructor.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::helpType::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, helpType, dictionary,(),())
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::helpType
helpType()
Constructor.
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:121
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:83
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:57
autoPtr.H