Skip to content
Snippets Groups Projects
Commit 0a545f01 authored by Oliver Sander's avatar Oliver Sander
Browse files

Merged the three report/reportStream methods into a single one

... with appropriate default parameters.  This leads to slightly
simpler code.  Note though that the method reportStream has
disappeared, and hence this patch may break some code.
I think that's acceptable, though, because the fix is trivial
and the reportStream method never appeared in a release.

[[Imported from SVN: r6302]]
parent b7181394
No related branches found
No related tags found
No related merge requests found
......@@ -17,17 +17,7 @@ using namespace Dune;
ParameterTree::ParameterTree()
{}
void ParameterTree::report() const
{
report("");
}
void ParameterTree::report(const std::string prefix) const
{
reportStream(std::cout, prefix);
}
void ParameterTree::reportStream(std::ostream& stream, const std::string& prefix) const
void ParameterTree::report(std::ostream& stream, const std::string& prefix) const
{
typedef std::map<std::string, std::string>::const_iterator ValueIt;
ValueIt vit = values.begin();
......@@ -42,7 +32,7 @@ void ParameterTree::reportStream(std::ostream& stream, const std::string& prefix
for(; sit!=send; ++sit)
{
stream << "[ " << prefix + sit->first << " ]" << std::endl;
(sit->second).report(prefix + sit->first + ".");
(sit->second).report(stream, prefix + sit->first + ".");
}
}
......
......@@ -83,20 +83,6 @@ namespace Dune {
const std::string& operator[] (const std::string& key) const;
/** \brief print structure to std::cout
*/
void report() const;
/** \brief print distinct substructure to std::cout
*
* Prints all entries with given prefix.
*
* \param prefix for key and substructure names
*/
void report(const std::string prefix) const;
/** \brief print distinct substructure to stream
*
* Prints all entries with given prefix.
......@@ -104,8 +90,8 @@ namespace Dune {
* \param stream Stream to print to
* \param prefix for key and substructure names
*/
void reportStream(std::ostream& stream,
const std::string& prefix = "") const;
void report(std::ostream& stream = std::cout,
const std::string& prefix = "") const;
/** \brief get substructure by name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment