dune-common 2.1.1
|
00001 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 00002 // vi: set et ts=8 sw=2 sts=2: 00003 #ifndef DUNE_PARAMETER_PARSER_HH 00004 #define DUNE_PARAMETER_PARSER_HH 00005 00006 #include <istream> 00007 #include <string> 00008 00009 #include <dune/common/parametertree.hh> 00010 00011 namespace Dune { 00012 00059 class ParameterTreeParser 00060 { 00061 00062 static std::string ltrim(const std::string& s); 00063 static std::string rtrim(const std::string& s); 00064 00065 00066 public: 00080 static void readINITree(std::istream& in, ParameterTree& pt, 00081 bool overwrite); 00082 00083 00095 static void readINITree(std::istream& in, ParameterTree& pt, 00096 const std::string srcname = "stream", 00097 bool overwrite = true); 00098 00099 00109 static void readINITree(std::string file, ParameterTree& pt, bool overwrite = true); 00110 00111 00119 static void readOptions(int argc, char* argv [], ParameterTree& pt); 00120 00121 }; 00122 00123 } // end namespace Dune 00124 00125 #endif // DUNE_PARAMETER_PARSER_HH