47 #ifndef TEUCHOS_YAMLPARSER_DECL_H_ 48 #define TEUCHOS_YAMLPARSER_DECL_H_ 50 #include "yaml-cpp/yaml.h" 54 #include "Teuchos_PtrDecl.hpp" 68 #define MAKE_EXCEPTION_TYPE(Name) \ 69 class Name : public Teuchos::ExceptionBase \ 72 Name(const std::string& arg) : ExceptionBase(arg) {} \ 75 MAKE_EXCEPTION_TYPE(YamlKeyError)
76 MAKE_EXCEPTION_TYPE(YamlScalarError)
77 MAKE_EXCEPTION_TYPE(YamlSequenceError)
78 MAKE_EXCEPTION_TYPE(YamlStructureError)
79 MAKE_EXCEPTION_TYPE(YamlUndefinedNodeError)
81 #undef MAKE_EXCEPTION_TYPE 84 void updateParametersFromYamlFile(
const std::string& yamlFileName,
86 void updateParametersFromYamlString(
const std::string& yamlData,
88 bool overwrite =
true);
89 void updateParametersFromYamlCString(
const char*
const yamlData,
91 bool overwrite =
true);
94 std::string convertXmlToYaml(
const std::string& xmlFileName);
95 void convertXmlToYaml(
const std::string& xmlFileName,
const std::string& yamlFileName);
99 namespace YAMLParameterList
109 void processKeyValueNode(
const std::string& key,
const YAML::Node& node,
Teuchos::ParameterList& parent,
bool topLevel =
false);
112 void writeParameter(
const std::string& paramName,
const Teuchos::ParameterEntry& entry, std::ofstream& yaml,
int indentLevel);
113 void generalWriteString(
const std::string& str, std::ofstream& yaml);
114 void generalWriteDouble(
double d, std::ofstream& yaml);
115 bool stringNeedsQuotes(
const std::string& str);
Object held as the "value" in the Teuchos::ParameterList std::map.
C++ Standard Library compatable filtered iterator.
This object is held as the "value" in the Teuchos::ParameterList std::map.
Templated Parameter List class.
A list of parameters of arbitrary type.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos, as well as a number of utility routines.
Reference-counted pointer class and non-member templated function implementations.
Simple wrapper class for raw pointers to single objects where no persisting relationship exists...