10 #ifndef TEUCHOS_YAMLPARSER_DECL_H_
11 #define TEUCHOS_YAMLPARSER_DECL_H_
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
134 void convertXmlToYaml(
const std::string& xmlFileName,
const std::string& yamlFileName);
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
Teuchos::RCP< Teuchos::ParameterList > parseYamlStream(std::istream &yaml)
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.
void generalWriteString(const std::string &str, std::ostream &yaml)
void generalWriteDouble(double d, std::ostream &yaml)
void writeYamlFile(const std::string &yamlFile, const Teuchos::ParameterList &pl)
Templated Parameter List class.
Teuchos::RCP< Teuchos::ParameterList > parseYamlText(const std::string &text, const std::string &name)
void writeParameter(const std::string ¶mName, const Teuchos::ParameterEntry &entry, std::ostream &yaml, int indentLevel)
void writeParameterList(const Teuchos::ParameterList &pl, std::ostream &yaml, int indentLevel)
A list of parameters of arbitrary type.
Teuchos::RCP< Teuchos::ParameterList > parseYamlFile(const std::string &yamlFile)
bool stringNeedsQuotes(const std::string &s)
std::string convertXmlToYaml(const std::string &xmlFileName)
void writeYamlStream(std::ostream &yaml, const Teuchos::ParameterList &pl)
Reference-counted pointer class and non-member templated function implementations.
Teuchos::ParameterList::ConstIterator PLIter