fixup ogr plugin error string output

This commit is contained in:
Dane Springmeyer 2012-03-04 22:28:02 -08:00
parent ad86e9aebc
commit ab4c9da7ad

View file

@ -214,24 +214,24 @@ void ogr_datasource::bind() const
if (! layer_.is_valid()) if (! layer_.is_valid())
{ {
std::string s("OGR Plugin: "); std::ostringstream s("OGR Plugin: ");
if (layer_by_name) if (layer_by_name)
{ {
s += "cannot find layer by name '" + *layer_by_name; s << "cannot find layer by name '" << *layer_by_name;
} }
else if (layer_by_index) else if (layer_by_index)
{ {
s += "cannot find layer by index number '" + *layer_by_index; s << "cannot find layer by index number '" << *layer_by_index;
} }
else if (layer_by_sql) else if (layer_by_sql)
{ {
s += "cannot find layer by sql query '" + *layer_by_sql; s << "cannot find layer by sql query '" << *layer_by_sql;
} }
s += "' in dataset '" + dataset_name_ + "'"; s << "' in dataset '" << dataset_name_ << "'";
throw datasource_exception(s); throw datasource_exception(s.str());
} }
// work with real OGR layer // work with real OGR layer