Permalink
Browse files

c++ style

  • Loading branch information...
1 parent 56ae40d commit a12b8f1d2feae5eea0c985dd1165321c5c3e55be Dane Springmeyer committed Sep 3, 2012
Showing with 88 additions and 88 deletions.
  1. +1 −1 bindings/python/mapnik_palette.cpp
  2. +7 −7 bindings/python/mapnik_python.cpp
  3. +1 −1 include/mapnik/box2d.hpp
  4. +1 −1 include/mapnik/datasource_cache.hpp
  5. +4 −4 include/mapnik/debug.hpp
  6. +1 −1 include/mapnik/factory.hpp
  7. +4 −4 include/mapnik/image_reader.hpp
  8. +1 −1 include/mapnik/image_util.hpp
  9. +1 −1 include/mapnik/map.hpp
  10. +2 −2 include/mapnik/plugin.hpp
  11. +1 −1 include/mapnik/rule.hpp
  12. +4 −4 include/mapnik/sql_utils.hpp
  13. +3 −3 plugins/input/geos/geos_featureset.cpp
  14. +3 −3 plugins/input/geos/geos_featureset.hpp
  15. +1 −1 plugins/input/kismet/kismet_datasource.cpp
  16. +1 −1 plugins/input/kismet/kismet_datasource.hpp
  17. +2 −2 plugins/input/kismet/kismet_types.hpp
  18. +1 −1 plugins/input/occi/occi_types.hpp
  19. +3 −3 plugins/input/ogr/ogr_layer_ptr.hpp
  20. +4 −4 plugins/input/osm/osm.cpp
  21. +4 −4 plugins/input/osm/osm.h
  22. +2 −2 plugins/input/postgis/connection.hpp
  23. +2 −2 plugins/input/postgis/postgis_datasource.cpp
  24. +3 −3 plugins/input/postgis/postgis_datasource.hpp
  25. +2 −2 plugins/input/raster/raster_info.hpp
  26. +1 −1 plugins/input/shape/dbfile.hpp
  27. +1 −1 plugins/input/shape/shape_io.cpp
  28. +1 −1 plugins/input/shape/shape_io.hpp
  29. +6 −6 plugins/input/sqlite/sqlite_connection.hpp
  30. +1 −1 plugins/input/sqlite/sqlite_datasource.cpp
  31. +1 −1 plugins/input/sqlite/sqlite_datasource.hpp
  32. +1 −1 src/box2d.cpp
  33. +1 −1 src/debug.cpp
  34. +4 −4 src/image_reader.cpp
  35. +3 −3 src/jpeg_reader.cpp
  36. +2 −2 src/plugin.cpp
  37. +3 −3 src/png_reader.cpp
  38. +4 −4 src/tiff_reader.cpp
@@ -27,7 +27,7 @@
//mapnik
#include <mapnik/palette.hpp>
-static boost::shared_ptr<mapnik::rgba_palette> make_palette( const std::string& palette, const std::string& format )
+static boost::shared_ptr<mapnik::rgba_palette> make_palette( std::string const& palette, std::string const& format )
{
mapnik::rgba_palette::palette_type type = mapnik::rgba_palette::PALETTE_RGBA;
if (format == "rgb")
@@ -205,17 +205,17 @@ void render6(const mapnik::Map& map, PycairoContext* context)
void render_tile_to_file(const mapnik::Map& map,
unsigned offset_x, unsigned offset_y,
unsigned width, unsigned height,
- const std::string& file,
- const std::string& format)
+ std::string const& file,
+ std::string const& format)
{
mapnik::image_32 image(width,height);
render(map,image,1.0,offset_x, offset_y);
mapnik::save_to_file(image.data(),file,format);
}
void render_to_file1(const mapnik::Map& map,
- const std::string& filename,
- const std::string& format)
+ std::string const& filename,
+ std::string const& format)
{
if (format == "pdf" || format == "svg" || format =="ps" || format == "ARGB32" || format == "RGB24")
{
@@ -233,7 +233,7 @@ void render_to_file1(const mapnik::Map& map,
}
}
-void render_to_file2(const mapnik::Map& map,const std::string& filename)
+void render_to_file2(const mapnik::Map& map,std::string const& filename)
{
std::string format = mapnik::guess_type(filename);
if (format == "pdf" || format == "svg" || format =="ps")
@@ -253,8 +253,8 @@ void render_to_file2(const mapnik::Map& map,const std::string& filename)
}
void render_to_file3(const mapnik::Map& map,
- const std::string& filename,
- const std::string& format,
+ std::string const& filename,
+ std::string const& format,
double scale_factor = 1.0
)
{
View
@@ -87,7 +87,7 @@ template <typename T> class MAPNIK_DECL box2d
void re_center(const coord<T,2>& c);
void init(T x0,T y0,T x1,T y1);
void clip(const box2d_type &other);
- bool from_string(const std::string& s);
+ bool from_string(std::string const& s);
bool valid() const;
// define some operators
@@ -49,7 +49,7 @@ class MAPNIK_DECL datasource_cache :
datasource_cache& operator=(const datasource_cache&);
static std::map<std::string,boost::shared_ptr<PluginInfo> > plugins_;
static bool registered_;
- static bool insert(const std::string& name,const lt_dlhandle module);
+ static bool insert(std::string const& name,const lt_dlhandle module);
static std::vector<std::string> plugin_directories_;
public:
static std::vector<std::string> plugin_names();
View
@@ -79,7 +79,7 @@ namespace mapnik {
}
// per object security levels
- static severity_type get_object_severity(const std::string& object_name)
+ static severity_type get_object_severity(std::string const& object_name)
{
severity_map::iterator it = object_severity_level_.find(object_name);
if (object_name.empty() || it == object_severity_level_.end())
@@ -92,7 +92,7 @@ namespace mapnik {
}
}
- static void set_object_severity(const std::string& object_name,
+ static void set_object_severity(std::string const& object_name,
const severity_type& security_level)
{
#ifdef MAPNIK_THREADSAFE
@@ -119,7 +119,7 @@ namespace mapnik {
return format_;
}
- static void set_format(const std::string& format)
+ static void set_format(std::string const& format)
{
#ifdef MAPNIK_THREADSAFE
boost::mutex::scoped_lock lock(format_mutex_);
@@ -131,7 +131,7 @@ namespace mapnik {
static std::string str();
// output
- static void use_file(const std::string& filepath);
+ static void use_file(std::string const& filepath);
static void use_console();
private:
@@ -76,7 +76,7 @@ class factory : public singleton<factory <product_type,
return map_.erase(key)==1;
}
- product_type* create_object(const key_type& key,const std::string& file)
+ product_type* create_object(const key_type& key,std::string const& file)
{
typename product_map::const_iterator pos=map_.find(key);
if (pos!=map_.end())
@@ -38,7 +38,7 @@ class image_reader_exception : public std::exception
private:
std::string message_;
public:
- image_reader_exception(const std::string& message)
+ image_reader_exception(std::string const& message)
: message_(message) {}
~image_reader_exception() throw() {}
@@ -57,9 +57,9 @@ struct MAPNIK_DECL image_reader
virtual ~image_reader() {}
};
-bool register_image_reader(const std::string& type,image_reader* (*)(const std::string&));
-MAPNIK_DECL image_reader* get_image_reader(const std::string& file,const std::string& type);
-MAPNIK_DECL image_reader* get_image_reader(const std::string& file);
+bool register_image_reader(std::string const& type,image_reader* (*)(std::string const&));
+MAPNIK_DECL image_reader* get_image_reader(std::string const& file,std::string const& type);
+MAPNIK_DECL image_reader* get_image_reader(std::string const& file);
}
@@ -46,7 +46,7 @@ class ImageWriterException : public std::exception
private:
std::string message_;
public:
- ImageWriterException(const std::string& message)
+ ImageWriterException(std::string const& message)
: message_(message) {}
~ImageWriterException() throw() {}
View
@@ -159,7 +159,7 @@ class MAPNIK_DECL Map
/*! \brief Remove a style from the map.
* @param name The name of the style.
*/
- void remove_style(const std::string& name);
+ void remove_style(std::string const& name);
/*! \brief Find a style.
* @param name The name of the style.
@@ -40,9 +40,9 @@ class PluginInfo : boost::noncopyable
std::string name_;
lt_dlhandle module_;
public:
- PluginInfo (const std::string& name,const lt_dlhandle module);
+ PluginInfo (std::string const& name,const lt_dlhandle module);
~PluginInfo();
- const std::string& name() const;
+ std::string const& name() const;
lt_dlhandle handle() const;
};
}
View
@@ -193,7 +193,7 @@ class rule
else_filter_(false),
also_filter_(false) {}
- rule(const std::string& name,
+ rule(std::string const& name,
double min_scale_denominator=0,
double max_scale_denominator=std::numeric_limits<double>::infinity())
: name_(name),
@@ -29,21 +29,21 @@
namespace mapnik { namespace sql_utils {
- inline std::string unquote_double(const std::string& sql)
+ inline std::string unquote_double(std::string const& sql)
{
std::string table_name = sql;
boost::algorithm::trim_if(table_name,boost::algorithm::is_any_of("\""));
return table_name;
}
- inline std::string unquote(const std::string& sql)
+ inline std::string unquote(std::string const& sql)
{
std::string table_name = sql;
boost::algorithm::trim_if(table_name,boost::algorithm::is_any_of("\"\'"));
return table_name;
}
- inline void quote_attr(std::ostringstream& s, const std::string& field)
+ inline void quote_attr(std::ostringstream& s, std::string const& field)
{
if (boost::algorithm::icontains(field,".")) {
std::vector<std::string> parts;
@@ -56,7 +56,7 @@ namespace mapnik { namespace sql_utils {
}
}
- inline std::string table_from_sql(const std::string& sql)
+ inline std::string table_from_sql(std::string const& sql)
{
std::string table_name = sql;
boost::algorithm::replace_all(table_name,"\n"," ");
@@ -49,9 +49,9 @@ using mapnik::feature_factory;
geos_featureset::geos_featureset(GEOSGeometry* geometry,
GEOSGeometry* extent,
int identifier,
- const std::string& field,
- const std::string& field_name,
- const std::string& encoding)
+ std::string const& field,
+ std::string const& field_name,
+ std::string const& encoding)
: geometry_(geometry),
tr_(new transcoder(encoding)),
extent_(extent),
@@ -42,9 +42,9 @@ class geos_featureset : public mapnik::Featureset
geos_featureset(GEOSGeometry* geometry,
GEOSGeometry* extent,
int identifier,
- const std::string& field,
- const std::string& field_name,
- const std::string& encoding);
+ std::string const& field,
+ std::string const& field_name,
+ std::string const& encoding);
virtual ~geos_featureset();
mapnik::feature_ptr next();
@@ -175,7 +175,7 @@ featureset_ptr kismet_datasource::features_at_point(coord2d const& pt) const
return featureset_ptr();
}
-void kismet_datasource::run(const std::string& ip_host, const unsigned int port)
+void kismet_datasource::run(std::string const& ip_host, const unsigned int port)
{
MAPNIK_LOG_DEBUG(kismet) << "kismet_datasource: Enter run";
@@ -59,7 +59,7 @@ class kismet_datasource : public mapnik::datasource
void bind() const;
private:
- void run (const std::string& host, const unsigned int port);
+ void run (std::string const& host, const unsigned int port);
mapnik::box2d<double> extent_;
bool extent_initialized_;
@@ -76,12 +76,12 @@ class kismet_network_data
{
}
- const std::string& ssid() const
+ std::string const& ssid() const
{
return ssid_;
}
- const std::string& bssid() const
+ std::string const& bssid() const
{
return bssid_;
}
@@ -156,7 +156,7 @@ class occi_connection_ptr
owns_connection_ = owns_connection;
}
- oracle::occi::ResultSet* execute_query(const std::string& s, const unsigned prefetch = 0)
+ oracle::occi::ResultSet* execute_query(std::string const& s, const unsigned prefetch = 0)
{
close_query(false);
@@ -65,7 +65,7 @@ class ogr_layer_ptr
}
void layer_by_name(OGRDataSource* const datasource,
- const std::string& layer_name)
+ std::string const& layer_name)
{
free_layer();
@@ -113,7 +113,7 @@ class ogr_layer_ptr
}
void layer_by_sql(OGRDataSource* const datasource,
- const std::string& layer_sql)
+ std::string const& layer_sql)
{
free_layer();
@@ -146,7 +146,7 @@ class ogr_layer_ptr
#endif
}
- const std::string& layer_name() const
+ std::string const& layer_name() const
{
return layer_name_;
}
@@ -34,7 +34,7 @@
polygon_types osm_way::ptypes;
-bool osm_dataset::load(const char* filename,const std::string& parser)
+bool osm_dataset::load(const char* filename,std::string const& parser)
{
if (parser == "libxml2")
{
@@ -43,9 +43,9 @@ bool osm_dataset::load(const char* filename,const std::string& parser)
return false;
}
-bool osm_dataset::load_from_url(const std::string& url,
- const std::string& bbox,
- const std::string& parser)
+bool osm_dataset::load_from_url(std::string const& url,
+ std::string const& bbox,
+ std::string const& parser)
{
if (parser == "libxml2")
{
View
@@ -102,10 +102,10 @@ class osm_dataset
~osm_dataset();
- bool load(const char* name, const std::string& parser = "libxml2");
- bool load_from_url(const std::string&,
- const std::string&,
- const std::string& parser = "libxml2");
+ bool load(const char* name, std::string const& parser = "libxml2");
+ bool load_from_url(std::string const&,
+ std::string const&,
+ std::string const& parser = "libxml2");
void clear();
void add_node(osm_node* n) { nodes.push_back(n); }
void add_way(osm_way* w) { ways.push_back(w); }
@@ -87,7 +87,7 @@ class Connection
}
}
- bool execute(const std::string& sql) const
+ bool execute(std::string const& sql) const
{
#ifdef MAPNIK_STATS
mapnik::progress_timer __stats__(std::clog, std::string("postgis_connection::execute ") + sql);
@@ -99,7 +99,7 @@ class Connection
return ok;
}
- boost::shared_ptr<ResultSet> executeQuery(const std::string& sql, int type = 0) const
+ boost::shared_ptr<ResultSet> executeQuery(std::string const& sql, int type = 0) const
{
#ifdef MAPNIK_STATS
mapnik::progress_timer __stats__(std::clog, std::string("postgis_connection::execute_query ") + sql);
@@ -485,7 +485,7 @@ std::string postgis_datasource::sql_bbox(box2d<double> const& env) const
return b.str();
}
-std::string postgis_datasource::populate_tokens(const std::string& sql) const
+std::string postgis_datasource::populate_tokens(std::string const& sql) const
{
std::string populated_sql = sql;
@@ -520,7 +520,7 @@ std::string postgis_datasource::populate_tokens(const std::string& sql) const
return populated_sql;
}
-std::string postgis_datasource::populate_tokens(const std::string& sql, double scale_denom, box2d<double> const& env, double pixel_width, double pixel_height) const
+std::string postgis_datasource::populate_tokens(std::string const& sql, double scale_denom, box2d<double> const& env, double pixel_width, double pixel_height) const
{
std::string populated_sql = sql;
std::string box = sql_bbox(env);
@@ -71,9 +71,9 @@ class postgis_datasource : public datasource
private:
std::string sql_bbox(box2d<double> const& env) const;
- std::string populate_tokens(const std::string& sql, double scale_denom, box2d<double> const& env, double pixel_width, double pixel_height) const;
- std::string populate_tokens(const std::string& sql) const;
- static std::string unquote(const std::string& sql);
+ std::string populate_tokens(std::string const& sql, double scale_denom, box2d<double> const& env, double pixel_width, double pixel_height) const;
+ std::string populate_tokens(std::string const& sql) const;
+ static std::string unquote(std::string const& sql);
boost::shared_ptr<IResultSet> get_resultset(boost::shared_ptr<Connection> const &conn, std::string const& sql) const;
static const std::string GEOMETRY_COLUMNS;
Oops, something went wrong.

0 comments on commit a12b8f1

Please sign in to comment.