Skip to content

Commit

Permalink
c++ style
Browse files Browse the repository at this point in the history
  • Loading branch information
Dane Springmeyer committed Sep 3, 2012
1 parent 56ae40d commit a12b8f1
Show file tree
Hide file tree
Showing 38 changed files with 88 additions and 88 deletions.
2 changes: 1 addition & 1 deletion bindings/python/mapnik_palette.cpp
Expand Up @@ -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")
Expand Down
14 changes: 7 additions & 7 deletions bindings/python/mapnik_python.cpp
Expand Up @@ -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")
{
Expand All @@ -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")
Expand All @@ -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
)
{
Expand Down
2 changes: 1 addition & 1 deletion include/mapnik/box2d.hpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/mapnik/datasource_cache.hpp
Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions include/mapnik/debug.hpp
Expand Up @@ -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())
Expand All @@ -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
Expand All @@ -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_);
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion include/mapnik/factory.hpp
Expand Up @@ -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())
Expand Down
8 changes: 4 additions & 4 deletions include/mapnik/image_reader.hpp
Expand Up @@ -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() {}
Expand All @@ -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);

}

Expand Down
2 changes: 1 addition & 1 deletion include/mapnik/image_util.hpp
Expand Up @@ -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() {}
Expand Down
2 changes: 1 addition & 1 deletion include/mapnik/map.hpp
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions include/mapnik/plugin.hpp
Expand Up @@ -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;
};
}
Expand Down
2 changes: 1 addition & 1 deletion include/mapnik/rule.hpp
Expand Up @@ -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),
Expand Down
8 changes: 4 additions & 4 deletions include/mapnik/sql_utils.hpp
Expand Up @@ -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;
Expand All @@ -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"," ");
Expand Down
6 changes: 3 additions & 3 deletions plugins/input/geos/geos_featureset.cpp
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions plugins/input/geos/geos_featureset.hpp
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion plugins/input/kismet/kismet_datasource.cpp
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion plugins/input/kismet/kismet_datasource.hpp
Expand Up @@ -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_;
Expand Down
4 changes: 2 additions & 2 deletions plugins/input/kismet/kismet_types.hpp
Expand Up @@ -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_;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/input/occi/occi_types.hpp
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions plugins/input/ogr/ogr_layer_ptr.hpp
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -146,7 +146,7 @@ class ogr_layer_ptr
#endif
}

const std::string& layer_name() const
std::string const& layer_name() const
{
return layer_name_;
}
Expand Down
8 changes: 4 additions & 4 deletions plugins/input/osm/osm.cpp
Expand Up @@ -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")
{
Expand All @@ -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")
{
Expand Down
8 changes: 4 additions & 4 deletions plugins/input/osm/osm.h
Expand Up @@ -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); }
Expand Down
4 changes: 2 additions & 2 deletions plugins/input/postgis/connection.hpp
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions plugins/input/postgis/postgis_datasource.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions plugins/input/postgis/postgis_datasource.hpp
Expand Up @@ -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;
Expand Down

0 comments on commit a12b8f1

Please sign in to comment.