dune-common
2.2.0
|
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 00010 #include <istream> 00011 #include <string> 00012 00013 #include <dune/common/parametertree.hh> 00014 00015 namespace Dune { 00016 00021 class ParameterTreeParser 00022 { 00023 00024 static std::string ltrim(const std::string& s); 00025 static std::string rtrim(const std::string& s); 00026 00027 00028 public: 00029 00073 00088 static void readINITree(std::istream& in, ParameterTree& pt, 00089 bool overwrite); 00090 00091 00104 static void readINITree(std::istream& in, ParameterTree& pt, 00105 const std::string srcname = "stream", 00106 bool overwrite = true); 00107 00108 00119 static void readINITree(std::string file, ParameterTree& pt, bool overwrite = true); 00120 00122 00134 static void readOptions(int argc, char* argv [], ParameterTree& pt); 00135 00136 }; 00137 00138 } // end namespace Dune 00139 00140 #endif // DUNE_PARAMETER_PARSER_HH