Skip to content

Commit

Permalink
adapt to ptree change in boost 1.56 - closes #2365
Browse files Browse the repository at this point in the history
Conflicts:
	src/save_map.cpp
  • Loading branch information
Dane Springmeyer committed Aug 19, 2014
1 parent 144d9a4 commit 65bd9e6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/save_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
// boost
#include <boost/algorithm/string.hpp>
#include <boost/optional.hpp>
#include <boost/version.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>

Expand Down Expand Up @@ -688,15 +689,23 @@ void save_map(Map const& map, std::string const& filename, bool explicit_default
{
ptree pt;
serialize_map(pt,map,explicit_defaults);
write_xml(filename,pt,std::locale(),boost::property_tree::xml_writer_make_settings(' ', 2));
#if BOOST_VERSION >= 105600
write_xml(filename,pt,std::locale(),boost::property_tree::xml_writer_make_settings<ptree::key_type>(' ',2));
#else
write_xml(filename,pt,std::locale(),boost::property_tree::xml_writer_make_settings(' ',2));
#endif
}

std::string save_map_to_string(Map const& map, bool explicit_defaults)
{
ptree pt;
serialize_map(pt,map,explicit_defaults);
std::ostringstream ss;
write_xml(ss,pt,boost::property_tree::xml_writer_make_settings(' ', 2));
#if BOOST_VERSION >= 105600
write_xml(ss,pt,boost::property_tree::xml_writer_make_settings<ptree::key_type>(' ',2));
#else
write_xml(ss,pt,boost::property_tree::xml_writer_make_settings(' ',2));
#endif
return ss.str();
}

Expand Down

0 comments on commit 65bd9e6

Please sign in to comment.