10 #ifndef TEUCHOS_YAMLPARSER_DECL_H_
11 #define TEUCHOS_YAMLPARSER_DECL_H_
105 #include "Teuchos_PtrDecl.hpp"
107 #ifdef HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
108 #include "yaml-cpp/yaml.h"
109 #endif // HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
117 #ifdef HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
118 #define MAKE_EXCEPTION_TYPE(Name) \
119 class Name : public Teuchos::ExceptionBase \
122 Name(const std::string& arg) : ExceptionBase(arg) {} \
125 MAKE_EXCEPTION_TYPE(YamlKeyError)
126 MAKE_EXCEPTION_TYPE(YamlSequenceError)
127 MAKE_EXCEPTION_TYPE(YamlStructureError)
128 MAKE_EXCEPTION_TYPE(YamlUndefinedNodeError)
130 #undef MAKE_EXCEPTION_TYPE
131 #endif // HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
133 std::string convertXmlToYaml(
const std::string& xmlFileName);
134 void convertXmlToYaml(
const std::string& xmlFileName,
const std::string& yamlFileName);
135 void convertXmlToYaml(std::istream& xmlStream, std::ostream& yamlStream);
138 namespace YAMLParameterList
141 const std::string& name);
147 #ifdef HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
150 void processKeyValueNode(
const std::string& key, const ::YAML::Node& node,
Teuchos::ParameterList& parent,
bool topLevel =
false);
151 #endif // HAVE_TEUCHOSPARAMETERLIST_YAMLCPP
154 void writeParameter(
const std::string& paramName,
const Teuchos::ParameterEntry& entry, std::ostream& yaml,
int indentLevel);
155 void generalWriteString(
const std::string& str, std::ostream& yaml);
156 void generalWriteDouble(
double d, std::ostream& yaml);
157 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.