Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_XMLParameterListTestHelpers.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Teuchos: Common Tools Package
4 //
5 // Copyright 2004 NTESS and the Teuchos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
12 
13 
16 {
17  std::ostringstream xmlOut;
18  writeParameterListToXmlOStream(myList, xmlOut);
19  return getParametersFromXmlString(xmlOut.str());
20 }
21 
22 
25  ParameterList& myList,
26  RCP<DependencySheet> depSheetIn,
27  RCP<DependencySheet> depSheetOut)
28 {
29  std::ostringstream xmlOut;
30  writeParameterListToXmlOStream(myList, xmlOut, depSheetIn);
31  return getParametersFromXmlString(xmlOut.str(), depSheetOut);
32 }
Simple helper functions that make it easy to read and write XML to and from a parameterlist.
A list of parameters of arbitrary type.
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< ParameterList > writeThenReadPL(ParameterList &myList)
Write a parameter list to xml and then read that xml back in via a string. The intent of this functio...
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void writeParameterListToXmlOStream(const ParameterList &paramList, std::ostream &xmlOut, RCP< const DependencySheet > depSheet=null)
Write parameters and sublists in XML format to an std::ostream.
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< ParameterList > getParametersFromXmlString(const std::string &xmlStr)
Reads XML parameters from a std::string and return them in a new parameter list.