From baa2880dad9c241bd5f90a713a5acd94bebecf8b Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 9 Oct 2012 13:47:24 -0700 Subject: [PATCH] nicer error formatting of ogr layer names --- plugins/input/ogr/ogr_datasource.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/input/ogr/ogr_datasource.cpp b/plugins/input/ogr/ogr_datasource.cpp index 50fb633e3..1ab493eec 100644 --- a/plugins/input/ogr/ogr_datasource.cpp +++ b/plugins/input/ogr/ogr_datasource.cpp @@ -203,6 +203,7 @@ void ogr_datasource::bind() const unsigned num_layers = dataset_->GetLayerCount(); bool layer_found = false; + std::vector layer_names; for (unsigned i = 0; i < num_layers; ++i ) { OGRLayer* ogr_layer = dataset_->GetLayer(i); @@ -210,7 +211,7 @@ void ogr_datasource::bind() const if (ogr_layer_def != 0) { layer_found = true; - s << " '" << ogr_layer_def->GetName() << "' "; + layer_names.push_back(std::string("'") + ogr_layer_def->GetName() + std::string("'")); } } @@ -218,6 +219,10 @@ void ogr_datasource::bind() const { s << "None (no layers were found in dataset)"; } + else + { + s << boost::algorithm::join(layer_names,", "); + } throw datasource_exception(s.str()); }