plugin code formatting based on emacs format in utils/format_source_files

This commit is contained in:
Dane Springmeyer 2011-11-13 19:37:50 -08:00
parent 3fd56f82f5
commit ce9e44b5f2
88 changed files with 1873 additions and 1873 deletions

View file

@ -68,7 +68,7 @@ const std::string occi_datasource::METADATA_TABLE = "USER_SDO_GEOM_METADATA";
DATASOURCE_PLUGIN(occi_datasource) DATASOURCE_PLUGIN(occi_datasource)
occi_datasource::occi_datasource(parameters const& params, bool bind) occi_datasource::occi_datasource(parameters const& params, bool bind)
: datasource (params), : datasource (params),
type_(datasource::Vector), type_(datasource::Vector),
fields_(*params_.get<std::string>("fields", "*")), fields_(*params_.get<std::string>("fields", "*")),
geometry_field_(*params_.get<std::string>("geometry_field", "")), geometry_field_(*params_.get<std::string>("geometry_field", "")),

View file

@ -35,9 +35,9 @@
// check for oracle support // check for oracle support
#if OCCI_MAJOR_VERSION >= 10 && OCCI_MINOR_VERSION >= 1 #if OCCI_MAJOR_VERSION >= 10 && OCCI_MINOR_VERSION >= 1
// We have at least ORACLE 10g >= 10.2.0.X // We have at least ORACLE 10g >= 10.2.0.X
#else #else
#error Only ORACLE 10g >= 10.2.0.X is supported ! #error Only ORACLE 10g >= 10.2.0.X is supported !
#endif #endif
// geometry types definitions // geometry types definitions

View file

@ -110,12 +110,12 @@ feature_ptr ogr_index_featureset<filterT>::next()
{ {
ogr_converter::convert_geometry (geom, feature, multiple_geometries_); ogr_converter::convert_geometry (geom, feature, multiple_geometries_);
} }
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
else else
{ {
std::clog << "### Warning: feature with null geometry: " << (*feat)->GetFID() << "\n"; std::clog << "### Warning: feature with null geometry: " << (*feat)->GetFID() << "\n";
} }
#endif #endif
int fld_count = layerdef_->GetFieldCount(); int fld_count = layerdef_->GetFieldCount();
for (int i = 0; i < fld_count; i++) for (int i = 0; i < fld_count; i++)
@ -151,17 +151,17 @@ feature_ptr ogr_index_featureset<filterT>::next()
case OFTStringList: case OFTStringList:
case OFTWideStringList: // deprecated ! case OFTWideStringList: // deprecated !
{ {
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif #endif
break; break;
} }
case OFTBinary: case OFTBinary:
{ {
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif #endif
//boost::put(*feature,name,feat->GetFieldAsBinary (i, size)); //boost::put(*feature,name,feat->GetFieldAsBinary (i, size));
break; break;
} }
@ -170,17 +170,17 @@ feature_ptr ogr_index_featureset<filterT>::next()
case OFTTime: case OFTTime:
case OFTDateTime: // unhandled ! case OFTDateTime: // unhandled !
{ {
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl;
#endif #endif
break; break;
} }
default: // unknown default: // unknown
{ {
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
std::clog << "OGR Plugin: unknown type_oid=" << type_oid << std::endl; std::clog << "OGR Plugin: unknown type_oid=" << type_oid << std::endl;
#endif #endif
break; break;
} }
} }

View file

@ -50,7 +50,7 @@ using mapnik::attribute_descriptor;
DATASOURCE_PLUGIN(osm_datasource) DATASOURCE_PLUGIN(osm_datasource)
osm_datasource::osm_datasource(const parameters& params, bool bind) osm_datasource::osm_datasource(const parameters& params, bool bind)
: datasource (params), : datasource (params),
type_(datasource::Vector), type_(datasource::Vector),
desc_(*params_.get<std::string>("type"), *params_.get<std::string>("encoding", "utf-8")) desc_(*params_.get<std::string>("type"), *params_.get<std::string>("encoding", "utf-8"))
{ {

View file

@ -9,12 +9,12 @@ using std::cerr;
using std::endl; using std::endl;
osm_item* osmparser::cur_item=NULL; osm_item* osmparser::cur_item=NULL;
long osmparser::curID=0; long osmparser::curID=0;
bool osmparser::in_node=false, osmparser::in_way=false; bool osmparser::in_node=false, osmparser::in_way=false;
osm_dataset* osmparser::components=NULL; osm_dataset* osmparser::components=NULL;
std::string osmparser::error=""; std::string osmparser::error="";
std::map<long,osm_node*> osmparser::tmp_node_store=std::map<long,osm_node*>(); std::map<long,osm_node*> osmparser::tmp_node_store=std::map<long,osm_node*>();
void osmparser::processNode(xmlTextReaderPtr reader) void osmparser::processNode(xmlTextReaderPtr reader)
{ {

View file

@ -27,18 +27,18 @@
#include <boost/make_shared.hpp> #include <boost/make_shared.hpp>
extern "C" { extern "C" {
#include "libpq-fe.h" #include "libpq-fe.h"
} }
#include "resultset.hpp" #include "resultset.hpp"
class Connection class Connection
{ {
private: private:
PGconn *conn_; PGconn *conn_;
int cursorId; int cursorId;
bool closed_; bool closed_;
public: public:
Connection(std::string const& connection_str) Connection(std::string const& connection_str)
:cursorId(0), :cursorId(0),
closed_(false) closed_(false)

View file

@ -303,7 +303,7 @@ void postgis_datasource::bind() const
desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::String)); desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::String));
break; break;
default: // should not get here default: // should not get here
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
s.str(""); s.str("");
s << "SELECT oid, typname FROM pg_type WHERE oid = " << type_oid; s << "SELECT oid, typname FROM pg_type WHERE oid = " << type_oid;
@ -325,7 +325,7 @@ void postgis_datasource::bind() const
std::clog << "Postgis Plugin: unknown oid type =" << type_oid << std::endl; std::clog << "Postgis Plugin: unknown oid type =" << type_oid << std::endl;
} }
rs_oid->close(); rs_oid->close();
#endif #endif
break; break;
} }
} }

View file

@ -80,7 +80,7 @@ class postgis_datasource : public datasource
int intersect_min_scale_; int intersect_min_scale_;
int intersect_max_scale_; int intersect_max_scale_;
//bool show_queries_; //bool show_queries_;
public: public:
static std::string name(); static std::string name();
int type() const; int type() const;
featureset_ptr features(const query& q) const; featureset_ptr features(const query& q) const;
@ -90,7 +90,7 @@ class postgis_datasource : public datasource
postgis_datasource(const parameters &params, bool bind=true); postgis_datasource(const parameters &params, bool bind=true);
~postgis_datasource(); ~postgis_datasource();
void bind() const; void bind() const;
private: private:
std::string sql_bbox(box2d<double> const& env) const; std::string sql_bbox(box2d<double> const& env) const;
std::string populate_tokens(const std::string& sql, double const& scale_denom, box2d<double> const& env) const; std::string populate_tokens(const std::string& sql, double const& scale_denom, box2d<double> const& env) const;
std::string populate_tokens(const std::string& sql) const; std::string populate_tokens(const std::string& sql) const;

View file

@ -24,7 +24,7 @@
#define RESULTSET_HPP #define RESULTSET_HPP
extern "C" { extern "C" {
#include "libpq-fe.h" #include "libpq-fe.h"
} }
class IResultSet class IResultSet

View file

@ -46,7 +46,7 @@ using mapnik::image_reader;
DATASOURCE_PLUGIN(raster_datasource) DATASOURCE_PLUGIN(raster_datasource)
raster_datasource::raster_datasource(const parameters& params, bool bind) raster_datasource::raster_datasource(const parameters& params, bool bind)
: datasource(params), : datasource(params),
desc_(*params.get<std::string>("type"), "utf-8"), desc_(*params.get<std::string>("type"), "utf-8"),
extent_initialized_(false) extent_initialized_(false)
{ {

View file

@ -24,8 +24,8 @@
#define RASTERLITE_INCLUDE_HPP #define RASTERLITE_INCLUDE_HPP
extern "C" { extern "C" {
#include <sqlite3.h> #include <sqlite3.h>
#include <rasterlite.h> #include <rasterlite.h>
} }
#endif // RASTERLITE_INCLUDE_HPP #endif // RASTERLITE_INCLUDE_HPP

View file

@ -52,7 +52,7 @@ class shape_featureset : public Featureset
mutable int count_; mutable int count_;
const int row_limit_; const int row_limit_;
public: public:
shape_featureset(const filterT& filter, shape_featureset(const filterT& filter,
const std::string& shape_file, const std::string& shape_file,
const std::set<std::string>& attribute_names, const std::set<std::string>& attribute_names,
@ -62,7 +62,7 @@ class shape_featureset : public Featureset
virtual ~shape_featureset(); virtual ~shape_featureset();
feature_ptr next(); feature_ptr next();
private: private:
shape_featureset(const shape_featureset&); shape_featureset(const shape_featureset&);
const shape_featureset& operator=(const shape_featureset&); const shape_featureset& operator=(const shape_featureset&);

View file

@ -38,7 +38,7 @@
// sqlite // sqlite
extern "C" { extern "C" {
#include <sqlite3.h> #include <sqlite3.h>
} }
#include "sqlite_resultset.hpp" #include "sqlite_resultset.hpp"
@ -56,13 +56,13 @@ public:
{ {
#if SQLITE_VERSION_NUMBER >= 3005000 #if SQLITE_VERSION_NUMBER >= 3005000
int mode = SQLITE_OPEN_READWRITE; int mode = SQLITE_OPEN_READWRITE;
#if SQLITE_VERSION_NUMBER >= 3006018 #if SQLITE_VERSION_NUMBER >= 3006018
// shared cache flag not available until >= 3.6.18 // shared cache flag not available until >= 3.6.18
mode |= SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_SHAREDCACHE; mode |= SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_SHAREDCACHE;
#endif #endif
const int rc = sqlite3_open_v2 (file_.c_str(), &db_, mode, 0); const int rc = sqlite3_open_v2 (file_.c_str(), &db_, mode, 0);
#else #else
#warning "Mapnik's sqlite plugin is compiling against a version of sqlite older than 3.5.x which may make rendering slow..." #warning "Mapnik's sqlite plugin is compiling against a version of sqlite older than 3.5.x which may make rendering slow..."
const int rc = sqlite3_open (file_.c_str(), &db_); const int rc = sqlite3_open (file_.c_str(), &db_);
#endif #endif
if (rc != SQLITE_OK) if (rc != SQLITE_OK)
@ -83,7 +83,7 @@ public:
#if SQLITE_VERSION_NUMBER >= 3005000 #if SQLITE_VERSION_NUMBER >= 3005000
const int rc = sqlite3_open_v2 (file_.c_str(), &db_, flags, 0); const int rc = sqlite3_open_v2 (file_.c_str(), &db_, flags, 0);
#else #else
#warning "Mapnik's sqlite plugin is compiling against a version of sqlite older than 3.5.x which may make rendering slow..." #warning "Mapnik's sqlite plugin is compiling against a version of sqlite older than 3.5.x which may make rendering slow..."
const int rc = sqlite3_open (file_.c_str(), &db_); const int rc = sqlite3_open (file_.c_str(), &db_);
#endif #endif
if (rc != SQLITE_OK) if (rc != SQLITE_OK)

View file

@ -49,7 +49,7 @@ using mapnik::parameters;
DATASOURCE_PLUGIN(sqlite_datasource) DATASOURCE_PLUGIN(sqlite_datasource)
sqlite_datasource::sqlite_datasource(parameters const& params, bool bind) sqlite_datasource::sqlite_datasource(parameters const& params, bool bind)
: datasource(params), : datasource(params),
extent_(), extent_(),
extent_initialized_(false), extent_initialized_(false),
type_(datasource::Vector), type_(datasource::Vector),
@ -312,8 +312,8 @@ sqlite_datasource::~sqlite_datasource()
#if (BOOST_FILESYSTEM_VERSION <= 2) #if (BOOST_FILESYSTEM_VERSION <= 2)
namespace boost { namespace boost {
namespace filesystem { namespace filesystem {
path read_symlink(const path& p) path read_symlink(const path& p)
{ {
path symlink_path; path symlink_path;
#ifdef BOOST_POSIX_API #ifdef BOOST_POSIX_API
@ -336,7 +336,7 @@ namespace filesystem {
} }
#endif #endif
return symlink_path; return symlink_path;
} }
} }
} }
#endif #endif
@ -379,11 +379,11 @@ void sqlite_datasource::parse_attachdb(std::string const& attachdb) const
absolute_path = boost::filesystem::read_symlink(absolute_path); absolute_path = boost::filesystem::read_symlink(absolute_path);
} }
#if (BOOST_FILESYSTEM_VERSION == 3) #if (BOOST_FILESYSTEM_VERSION == 3)
filename = boost::filesystem::absolute(absolute_path.parent_path() / filename).string(); filename = boost::filesystem::absolute(absolute_path.parent_path() / filename).string();
#else #else
filename = boost::filesystem::complete(absolute_path.branch_path() / filename).normalize().string(); filename = boost::filesystem::complete(absolute_path.branch_path() / filename).normalize().string();
#endif #endif
} }
} }

View file

@ -126,10 +126,10 @@ feature_ptr sqlite_featureset::next()
break; break;
default: default:
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
std::clog << "Sqlite Plugin: field " << fld_name_str std::clog << "Sqlite Plugin: field " << fld_name_str
<< " unhandled type_oid=" << type_oid << std::endl; << " unhandled type_oid=" << type_oid << std::endl;
#endif #endif
break; break;
} }
} }

View file

@ -38,7 +38,7 @@
// sqlite // sqlite
extern "C" { extern "C" {
#include <sqlite3.h> #include <sqlite3.h>
} }
class prepared_index_statement : boost::noncopyable class prepared_index_statement : boost::noncopyable

View file

@ -31,7 +31,7 @@
// sqlite // sqlite
extern "C" { extern "C" {
#include <sqlite3.h> #include <sqlite3.h>
} }

View file

@ -41,7 +41,7 @@
// sqlite // sqlite
extern "C" { extern "C" {
#include <sqlite3.h> #include <sqlite3.h>
} }
#include "sqlite_resultset.hpp" #include "sqlite_resultset.hpp"
@ -531,7 +531,7 @@ public:
desc.add_descriptor(mapnik::attribute_descriptor(fld_name, mapnik::String)); desc.add_descriptor(mapnik::attribute_descriptor(fld_name, mapnik::String));
} }
} }
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
else else
{ {
// "Column Affinity" says default to "Numeric" but for now we pass.. // "Column Affinity" says default to "Numeric" but for now we pass..
@ -544,7 +544,7 @@ public:
<< "' unhandled due to unknown type: " << "' unhandled due to unknown type: "
<< fld_type << std::endl; << fld_type << std::endl;
} }
#endif #endif
} }
} }

View file

@ -12,7 +12,7 @@ using mapnik::parameters;
DATASOURCE_PLUGIN(hello_datasource) DATASOURCE_PLUGIN(hello_datasource)
hello_datasource::hello_datasource(parameters const& params, bool bind) hello_datasource::hello_datasource(parameters const& params, bool bind)
: datasource(params), : datasource(params),
type_(datasource::Vector), type_(datasource::Vector),
desc_(*params_.get<std::string>("type"), *params_.get<std::string>("encoding","utf-8")), desc_(*params_.get<std::string>("type"), *params_.get<std::string>("encoding","utf-8")),
extent_() extent_()

View file

@ -6,7 +6,7 @@
class hello_datasource : public mapnik::datasource class hello_datasource : public mapnik::datasource
{ {
public: public:
// constructor // constructor
// arguments must not change // arguments must not change
hello_datasource(mapnik::parameters const& params, bool bind=true); hello_datasource(mapnik::parameters const& params, bool bind=true);
@ -38,7 +38,7 @@ class hello_datasource : public mapnik::datasource
// mandatory: will bind the datasource given params // mandatory: will bind the datasource given params
void bind() const; void bind() const;
private: private:
// recommended naming convention of datasource members: // recommended naming convention of datasource members:
// name_, type_, extent_, and desc_ // name_, type_, extent_, and desc_
static const std::string name_; static const std::string name_;

View file

@ -10,7 +10,7 @@
// extend the mapnik::Featureset defined in include/mapnik/datasource.hpp // extend the mapnik::Featureset defined in include/mapnik/datasource.hpp
class hello_featureset : public mapnik::Featureset class hello_featureset : public mapnik::Featureset
{ {
public: public:
// this constructor can have any arguments you need // this constructor can have any arguments you need
hello_featureset(mapnik::box2d<double> const& box, std::string const& encoding); hello_featureset(mapnik::box2d<double> const& box, std::string const& encoding);
@ -20,7 +20,7 @@ class hello_featureset : public mapnik::Featureset
// mandatory: you must expose a next() method, called when rendering // mandatory: you must expose a next() method, called when rendering
mapnik::feature_ptr next(); mapnik::feature_ptr next();
private: private:
// members are up to you, but these are recommended // members are up to you, but these are recommended
mapnik::box2d<double> const& box_; mapnik::box2d<double> const& box_;
mutable int feature_id_; mutable int feature_id_;