47 #ifndef TEUCHOS_YAMLPARSER_DECL_H_
48 #define TEUCHOS_YAMLPARSER_DECL_H_
142 #include "Teuchos_PtrDecl.hpp"
144 #ifdef HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
145 #include "yaml-cpp/yaml.h"
146 #endif // HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
154 #ifdef HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
155 #define MAKE_EXCEPTION_TYPE(Name) \
156 class Name : public Teuchos::ExceptionBase \
159 Name(const std::string& arg) : ExceptionBase(arg) {} \
162 MAKE_EXCEPTION_TYPE(YamlKeyError)
163 MAKE_EXCEPTION_TYPE(YamlSequenceError)
164 MAKE_EXCEPTION_TYPE(YamlStructureError)
165 MAKE_EXCEPTION_TYPE(YamlUndefinedNodeError)
167 #undef MAKE_EXCEPTION_TYPE
168 #endif // HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
170 std::string convertXmlToYaml(
const std::string& xmlFileName);
171 void convertXmlToYaml(
const std::string& xmlFileName,
const std::string& yamlFileName);
172 void convertXmlToYaml(std::istream& xmlStream, std::ostream& yamlStream);
175 namespace YAMLParameterList
178 const std::string& name);
184 #ifdef HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
187 void processKeyValueNode(
const std::string& key, const ::YAML::Node& node,
Teuchos::ParameterList& parent,
bool topLevel =
false);
188 #endif // HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
191 void writeParameter(
const std::string& paramName,
const Teuchos::ParameterEntry& entry, std::ostream& yaml,
int indentLevel);
192 void generalWriteString(
const std::string& str, std::ostream& yaml);
193 void generalWriteDouble(
double d, std::ostream& yaml);
194 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.
Reference-counted pointer class and non-member templated function implementations.