DUNE PDELab (2.8)

parametertreeparser.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_PARAMETER_PARSER_HH
4#define DUNE_PARAMETER_PARSER_HH
5
10#include <istream>
11#include <string>
12#include <vector>
13
16
17namespace Dune {
18
26 class HelpRequest : public Exception {};
27
33 {
34
35 static std::string ltrim(const std::string& s);
36 static std::string rtrim(const std::string& s);
37
38 public:
39
83
94 static void readINITree(std::istream& in, ParameterTree& pt,
95 bool overwrite);
96
103 static Dune::ParameterTree readINITree(std::istream& in);
104
105
118 static void readINITree(std::istream& in, ParameterTree& pt,
119 const std::string srcname = "stream",
120 bool overwrite = true);
121
122
133 static void readINITree(std::string file, ParameterTree& pt, bool overwrite = true);
134
141 static Dune::ParameterTree readINITree(const std::string& file);
142
144
156 static void readOptions(int argc, char* argv [], ParameterTree& pt);
157
175 static void readNamedOptions(int argc, char* argv[],
176 ParameterTree& pt,
177 std::vector<std::string> keywords,
178 unsigned int required = std::numeric_limits<unsigned int>::max(),
179 bool allow_more = true,
180 bool overwrite = true,
181 std::vector<std::string> help = std::vector<std::string>());
182
183 private:
184 static std::string generateHelpString(std::string progname, std::vector<std::string> keywords, unsigned int required, std::vector<std::string> help);
185 };
186
187} // end namespace Dune
188
189#endif // DUNE_PARAMETER_PARSER_HH
Base class for Dune-Exceptions.
Definition: exceptions.hh:94
exception thrown if the user wants to see help string
Definition: parametertreeparser.hh:26
report parser error while reading ParameterTree
Definition: parametertreeparser.hh:20
Parsers to set up a ParameterTree from various input sources.
Definition: parametertreeparser.hh:33
static void readOptions(int argc, char *argv[], ParameterTree &pt)
parse command line options and build hierarchical ParameterTree structure
Definition: parametertreeparser.cc:157
static void readINITree(std::istream &in, ParameterTree &pt, bool overwrite)
parse C++ stream
Definition: parametertreeparser.cc:72
static void readNamedOptions(int argc, char *argv[], ParameterTree &pt, std::vector< std::string > keywords, unsigned int required=std::numeric_limits< unsigned int >::max(), bool allow_more=true, bool overwrite=true, std::vector< std::string > help=std::vector< std::string >())
read [named] command line options and build hierarchical ParameterTree structure
Definition: parametertreeparser.cc:173
Hierarchical structure of string parameters.
Definition: parametertree.hh:35
Default exception class for range errors.
Definition: exceptions.hh:252
A few common exception classes.
auto max(ADLTag< 0 >, const V &v1, const V &v2)
implements binary Simd::max()
Definition: defaults.hh:79
Dune namespace.
Definition: alignedallocator.hh:11
A hierarchical structure of string parameters.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)