+ use BOOST_FOREACH

This commit is contained in:
artemp 2012-07-03 13:38:07 +01:00
parent 4b9346ab5f
commit 290bf735da

View file

@ -19,7 +19,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*****************************************************************************/
// mapnik
#include <mapnik/formatting/list.hpp>
// boost
#include <boost/foreach.hpp>
namespace mapnik {
using boost::property_tree::ptree;
@ -27,45 +31,37 @@ using boost::property_tree::ptree;
namespace formatting {
/************************************************************/
void list_node::to_xml(boost::property_tree::ptree &xml) const
void list_node::to_xml(boost::property_tree::ptree & xml) const
{
std::vector<node_ptr>::const_iterator itr = children_.begin();
std::vector<node_ptr>::const_iterator end = children_.end();
for (;itr != end; itr++)
BOOST_FOREACH(node_ptr const& node, children_)
{
(*itr)->to_xml(xml);
node->to_xml(xml);
}
}
void list_node::apply(char_properties const& p, Feature const& feature, processed_text &output) const
{
std::vector<node_ptr>::const_iterator itr = children_.begin();
std::vector<node_ptr>::const_iterator end = children_.end();
for (;itr != end; itr++)
{
BOOST_FOREACH(node_ptr const& node, children_)
{
(*itr)->apply(p, feature, output);
}
node->apply(p, feature, output);
}
}
void list_node::add_expressions(expression_set &output) const
{
std::vector<node_ptr>::const_iterator itr = children_.begin();
std::vector<node_ptr>::const_iterator end = children_.end();
for (;itr != end; itr++)
BOOST_FOREACH(node_ptr const& node, children_)
{
(*itr)->add_expressions(output);
node->add_expressions(output);
}
}
void list_node::push_back(node_ptr n)
{
children_.push_back(n);
}
void list_node::clear()
{
children_.clear();