remove unused iostream includes and unnecessary usage of ostringstream - refs #1055
This commit is contained in:
parent
f3c23c28c3
commit
c0021d0760
36 changed files with 43 additions and 112 deletions
|
@ -32,7 +32,6 @@
|
|||
#include <boost/concept_check.hpp>
|
||||
// stl
|
||||
#include <set>
|
||||
#include <iostream>
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
|
|
|
@ -23,12 +23,13 @@
|
|||
#ifndef MAPNIK_CONFIG_ERROR_HPP
|
||||
#define MAPNIK_CONFIG_ERROR_HPP
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
class xml_node;
|
||||
|
||||
class config_error : public std::exception
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
// stl
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
|
|
@ -33,9 +33,6 @@
|
|||
#include <boost/variant/apply_visitor.hpp>
|
||||
#include <boost/variant/variant.hpp>
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
|
||||
namespace mapnik { namespace json {
|
||||
|
||||
namespace qi = boost::spirit::qi;
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
#include <boost/variant/apply_visitor.hpp>
|
||||
#include <boost/variant/variant.hpp>
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
|
||||
namespace mapnik { namespace json {
|
||||
|
||||
namespace qi = boost::spirit::qi;
|
||||
|
|
|
@ -33,9 +33,6 @@
|
|||
#include <boost/variant/apply_visitor.hpp>
|
||||
#include <boost/variant/variant.hpp>
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
|
||||
namespace mapnik { namespace json {
|
||||
|
||||
namespace qi = boost::spirit::qi;
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
#ifndef MAPNIK_MEMORY_HPP
|
||||
#define MAPNIK_MEMORY_HPP
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
|
||||
namespace mapnik
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
// stl
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <deque>
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
// stl
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#endif
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <deque>
|
||||
#include <ctime>
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
|
||||
// stl
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace mapnik {
|
||||
|
|
|
@ -40,9 +40,6 @@
|
|||
#include <boost/fusion/include/struct.hpp>
|
||||
#include <boost/fusion/include/boost_tuple.hpp>
|
||||
|
||||
// std
|
||||
#include <iostream>
|
||||
|
||||
/*!
|
||||
* mapnik::svg::path_output_attributes is adapted as a fusion sequence
|
||||
* in order to be used directly by the svg_path_attributes_grammar (below).
|
||||
|
|
|
@ -33,8 +33,6 @@
|
|||
#include <cstdlib>
|
||||
#include <limits>
|
||||
#include <ctime>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
// stl
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <cmath>
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
#ifndef MAPNIK_VALUE_ERROR_HPP
|
||||
#define MAPNIK_VALUE_ERROR_HPP
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
|
|
|
@ -159,9 +159,8 @@ void csv_datasource::parse_csv(T & stream,
|
|||
if (file_mb > filesize_max_)
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "CSV Plugin: csv file is greater than " << filesize_max_ << "MB "
|
||||
<< " - you should use a more efficient data format like sqlite, postgis or a shapefile "
|
||||
<< " to render this data (set 'filesize_max=0' to disable this restriction if you have lots of memory)";
|
||||
s << "CSV Plugin: csv file is greater than ";
|
||||
s << filesize_max_ << "MB - you should use a more efficient data format like sqlite, postgis or a shapefile to render this data (set 'filesize_max=0' to disable this restriction if you have lots of memory)";
|
||||
throw mapnik::datasource_exception(s.str());
|
||||
}
|
||||
}
|
||||
|
@ -258,9 +257,9 @@ void csv_datasource::parse_csv(T & stream,
|
|||
}
|
||||
catch(std::exception const& ex)
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "CSV Plugin: " << ex.what();
|
||||
throw mapnik::datasource_exception(s.str());
|
||||
std::string s("CSV Plugin: ");
|
||||
s += ex.what();
|
||||
throw mapnik::datasource_exception(s);
|
||||
}
|
||||
|
||||
typedef boost::tokenizer< escape_type > Tokenizer;
|
||||
|
@ -345,10 +344,10 @@ void csv_datasource::parse_csv(T & stream,
|
|||
if (strict_)
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "CSV Plugin: expected a column header at line "
|
||||
<< line_number << ", column " << idx
|
||||
<< " - ensure this row contains valid header fields: '"
|
||||
<< csv_line << "'\n";
|
||||
s << "CSV Plugin: expected a column header at line ";
|
||||
s << line_number << ", column " << idx;
|
||||
s << " - ensure this row contains valid header fields: '";
|
||||
s << csv_line << "'\n";
|
||||
throw mapnik::datasource_exception(s.str());
|
||||
}
|
||||
else
|
||||
|
@ -398,18 +397,16 @@ void csv_datasource::parse_csv(T & stream,
|
|||
}
|
||||
catch(const std::exception & ex)
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "CSV Plugin: error parsing headers: " << ex.what();
|
||||
throw mapnik::datasource_exception(s.str());
|
||||
std::string s("CSV Plugin: error parsing headers: ");
|
||||
s += ex.what();
|
||||
throw mapnik::datasource_exception(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!has_wkt_field && !has_json_field && (!has_lon_field || !has_lat_field) )
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "CSV Plugin: could not detect column headers with the name of wkt, geojson, x/y, or latitude/longitude - this is required for reading geometry data";
|
||||
throw mapnik::datasource_exception(s.str());
|
||||
throw mapnik::datasource_exception("CSV Plugin: could not detect column headers with the name of wkt, geojson, x/y, or latitude/longitude - this is required for reading geometry data");
|
||||
}
|
||||
|
||||
int feature_count(0);
|
||||
|
@ -948,10 +945,8 @@ mapnik::featureset_ptr csv_datasource::features(mapnik::query const& q) const
|
|||
if (! found_name)
|
||||
{
|
||||
std::ostringstream s;
|
||||
|
||||
s << "CSV Plugin: no attribute '" << *pos << "'. Valid attributes are: "
|
||||
<< boost::algorithm::join(headers_, ",") << ".";
|
||||
|
||||
throw mapnik::datasource_exception(s.str());
|
||||
}
|
||||
++pos;
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "geojson_featureset.hpp"
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
||||
// boost
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "geos_featureset.hpp"
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
#include <cstdarg>
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/global.hpp>
|
||||
#include <mapnik/debug.hpp>
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
#include <boost/make_shared.hpp>
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
|
||||
using mapnik::datasource;
|
||||
|
@ -174,11 +174,8 @@ void ogr_datasource::bind() const
|
|||
const unsigned num_layers = dataset_->GetLayerCount();
|
||||
if (*layer_by_index >= num_layers)
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "OGR Plugin: only ";
|
||||
s << num_layers;
|
||||
s << " layer(s) exist, cannot find layer by index '" << *layer_by_index << "'";
|
||||
|
||||
std::ostringstream s("OGR Plugin: only ");
|
||||
s << num_layers << " layer(s) exist, cannot find layer by index '" << *layer_by_index << "'";
|
||||
throw datasource_exception(s.str());
|
||||
}
|
||||
|
||||
|
@ -196,9 +193,7 @@ void ogr_datasource::bind() const
|
|||
}
|
||||
else
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "OGR Plugin: missing <layer> or <layer_by_index> or <layer_by_sql> "
|
||||
<< "parameter, available layers are: ";
|
||||
std::string s("OGR Plugin: missing <layer> or <layer_by_index> or <layer_by_sql> parameter, available layers are: ");
|
||||
|
||||
unsigned num_layers = dataset_->GetLayerCount();
|
||||
bool layer_found = false;
|
||||
|
@ -216,14 +211,14 @@ void ogr_datasource::bind() const
|
|||
|
||||
if (! layer_found)
|
||||
{
|
||||
s << "None (no layers were found in dataset)";
|
||||
s += "None (no layers were found in dataset)";
|
||||
}
|
||||
else
|
||||
{
|
||||
s << boost::algorithm::join(layer_names,", ");
|
||||
s += boost::algorithm::join(layer_names,", ");
|
||||
}
|
||||
|
||||
throw datasource_exception(s.str());
|
||||
throw datasource_exception(s);
|
||||
}
|
||||
|
||||
if (! layer_.is_valid())
|
||||
|
@ -465,10 +460,10 @@ void validate_attribute_names(query const& q, std::vector<attribute_descriptor>
|
|||
|
||||
if (! found_name)
|
||||
{
|
||||
std::ostringstream s;
|
||||
std::ostringstream s("OGR Plugin: no attribute '");
|
||||
s << *pos << "'. Valid attributes are: ";
|
||||
std::vector<attribute_descriptor>::const_iterator itr = names.begin();
|
||||
std::vector<attribute_descriptor>::const_iterator end = names.end();
|
||||
s << "OGR Plugin: no attribute '" << *pos << "'. Valid attributes are: ";
|
||||
for ( ;itr!=end;++itr)
|
||||
{
|
||||
s << itr->get_name() << std::endl;
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#include <mapnik/debug.hpp>
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
|
||||
// ogr
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "osm.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
|
|
@ -21,9 +21,6 @@
|
|||
*****************************************************************************/
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
#include <set>
|
||||
|
||||
|
@ -91,9 +88,9 @@ void osm_datasource::bind() const
|
|||
// if we supplied a filename, load from file
|
||||
if ((osm_data_ = dataset_deliverer::load_from_file(osm_filename, parser)) == NULL)
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "OSM Plugin: Error loading from file '" << osm_filename << "'";
|
||||
throw datasource_exception(s.str());
|
||||
std::string s("OSM Plugin: Error loading from file '");
|
||||
s += osm_filename + "'";
|
||||
throw datasource_exception(s);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -21,9 +21,6 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
|
||||
// mapnik
|
||||
#include <mapnik/geometry.hpp>
|
||||
#include <mapnik/feature_factory.hpp>
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
using std::endl;
|
||||
|
||||
osm_item* osmparser::cur_item=NULL;
|
||||
long osmparser::curID=0;
|
||||
bool osmparser::in_node=false, osmparser::in_way=false;
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <libxml/xmlreader.h>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "osm.h"
|
||||
#include <map>
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include <mapnik/timer.hpp>
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
|
||||
|
|
|
@ -23,14 +23,11 @@
|
|||
// mapnik
|
||||
#include <mapnik/datasource.hpp>
|
||||
#include <mapnik/params.hpp>
|
||||
#include <mapnik/util/conversions.hpp>
|
||||
#include "shape_utils.hpp"
|
||||
|
||||
// boost
|
||||
#include <boost/algorithm/string.hpp>
|
||||
// stl
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
void setup_attributes(mapnik::context_ptr const& ctx,
|
||||
std::set<std::string> const& names,
|
||||
|
@ -56,19 +53,17 @@ void setup_attributes(mapnik::context_ptr const& ctx,
|
|||
|
||||
if (! found_name)
|
||||
{
|
||||
std::ostringstream s;
|
||||
|
||||
s << "no attribute '" << *pos << "' in '"
|
||||
<< shape_name << "'. Valid attributes are: ";
|
||||
|
||||
std::string s("no attribute '");
|
||||
std::string pos_string;
|
||||
s += *pos + "' in '" + shape_name + "'. Valid attributes are: ";
|
||||
std::vector<std::string> list;
|
||||
for (int i = 0; i < shape.dbf().num_fields(); ++i)
|
||||
{
|
||||
list.push_back(shape.dbf().descriptor(i).name_);
|
||||
}
|
||||
s << boost::algorithm::join(list, ",") << ".";
|
||||
s += boost::algorithm::join(list, ",") + ".";
|
||||
|
||||
throw mapnik::datasource_exception("Shape Plugin: " + s.str());
|
||||
throw mapnik::datasource_exception("Shape Plugin: " + s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
|
||||
// stl
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace mapnik {
|
||||
|
@ -74,17 +72,17 @@ datasource_ptr datasource_cache::create(const parameters& params, bool bind)
|
|||
std::map<std::string,boost::shared_ptr<PluginInfo> >::iterator itr=plugins_.find(*type);
|
||||
if ( itr == plugins_.end() )
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "Could not create datasource for type: '" << *type << "'";
|
||||
std::string s("Could not create datasource for type: '");
|
||||
s += *type + "'";
|
||||
if (plugin_directories_.empty())
|
||||
{
|
||||
s << " (no datasource plugin directories have been successfully registered)";
|
||||
s + " (no datasource plugin directories have been successfully registered)";
|
||||
}
|
||||
else
|
||||
{
|
||||
s << " (searched for datasource plugins in '" << plugin_directories() << "')";
|
||||
s + " (searched for datasource plugins in '" + plugin_directories() + "')";
|
||||
}
|
||||
throw config_error(s.str());
|
||||
throw config_error(s);
|
||||
}
|
||||
|
||||
if ( ! itr->second->handle())
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
//stl
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include <mapnik/gradient.hpp>
|
||||
#include <iostream>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
|
|
@ -39,9 +39,6 @@
|
|||
// boost
|
||||
#include <boost/scoped_array.hpp>
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
image_32::image_32(int width,int height)
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
|
||||
// stl
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
|
|
@ -28,9 +28,6 @@
|
|||
// boost
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include <boost/foreach.hpp>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
|
||||
// stl
|
||||
#include <iostream>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <tiffio.h>
|
||||
|
|
Loading…
Reference in a new issue