111 carto::PluginLoader::load();
113 bool exactformat =
false;
128 exactformat = (bool) exact->getScalar();
136 if( !
options->hasProperty(
"ascii" ) )
137 options->setProperty(
"ascii", ascii );
145 _format = oformat->getString();
153 options->setProperty(
"format", *format );
161 if( ascii || format )
165 if( ascii && format )
168 uri += (
"format=" + *format );
189 std::set<std::string> tried;
191 std::set<std::string>::iterator notyet = tried.end();
203 std::cout <<
"1. try writer " << *format << std::endl;
214 "object in format " ) + *format,
_filename );
217 catch( std::exception & e )
225 tried.insert( *format );
230 std::string::size_type pos = bname.find(
'.' );
231 std::string::size_type dlen =
_filename.length() - bname.length();
234 if( pos != std::string::npos )
237 const std::map<std::string, std::list<std::string> > & extensions
241 = extensions.find( ext ),
242 eext = extensions.end();
243 std::list<std::string>::const_iterator ie, ee;
251 carto::Object defwriters = sett.getProperty(
"default_writers" );
258 catch( std::exception & )
266 std::string defformat = defformato->getString();
268 if( tried.find( defformat ) == notyet )
274 std::cout <<
"2. try writer " << defformat << std::endl;
285 std::string(
"2. Cannot write object in format " )
289 catch( std::exception & e )
297 tried.insert( defformat );
302 catch( std::exception & )
307 while( iext == eext && (pos=bname.find(
'.', pos+1 ))!=std::string::npos )
310 iext = extensions.find( ext );
315 for( ie=iext->second.begin(), ee=iext->second.end(); ie!=ee; ++ie )
317 if( tried.find( *ie ) == notyet )
323 std::cout <<
"3. try writer " << *ie << std::endl;
334 std::string(
"3. Cannot write object in format " )
338 catch( std::exception & e )
341 std::cout <<
"3. failed for " << *ie <<
": " << e.what()
358 iext = extensions.find(
"" );
361 for( ie=iext->second.begin(), ee=iext->second.end(); ie!=ee; ++ie )
362 if( tried.find( *ie ) == notyet )
368 std::cout <<
"4. try writer " << *ie << std::endl;
379 std::string(
"4. Cannot write object in format " )
383 catch( std::exception & e )
397 for( iext=extensions.begin(); iext!=eext; ++iext )
398 for( ie=iext->second.begin(), ee=iext->second.end(); ie!=ee; ++ie )
399 if( tried.find( *ie ) == notyet )
405 std::cout <<
"5. try writer " << *ie << std::endl;
416 std::string(
"5. Cannot write object in format " )
420 catch( std::exception & e )
437 if( ascii || format )
441 if( ascii && format )
444 uri += (
"format=" + *format );