122 int passbegin,
int passend )
128 set_S::iterator notyet = tried.end();
140 = FileUtil::uriFilename(
_datasourceinfo->list().dataSource()->url() );
143 if( urioptions.
get() ) {
146 options->copyProperties( urioptions );
150 options->getProperty(
"format", format );
151 localMsg(
"format hint: " + format );
152 bool exactformat =
false;
155 carto::Object exact = options->getProperty(
"exact_format" );
156 exactformat = exact->getScalar();
163 if( passbegin <= 1 && passend >= 1 && !format.empty() )
171 localMsg(
"1. try writer " + format );
185 catch( std::exception & e )
187 localMsg(
"1. " + format +
" failed" );
193 tried.insert( format );
195 else if( exactformat )
204 filename.substr( 0, filename.length() - 3 ) );
206 ext = ext2 +
"." + ext;
210 multi_S::const_iterator ie, ee;
214 if( passbegin <= 2 && passend >= 2 )
217 iext = extensions.equal_range( ext );
218 for( ie=iext.first, ee=iext.second; ie!=ee; ++ie )
219 if( tried.find( ie->second ) == notyet ) {
225 localMsg(
"2. try writer " + ie->second );
228 localMsg(
"2. " + ie->second +
" OK" );
239 catch( std::exception & e )
241 localMsg(
" 2. " + ie->second +
" failed" );
247 tried.insert( ie->second );
253 if( passbegin <= 3 && passend >= 3 && !ext.empty() )
256 iext = extensions.equal_range(
"" );
257 for( ie=iext.first, ee=iext.second; ie!=ee; ++ie )
258 if( tried.find( ie->second ) == notyet ) {
264 localMsg(
"3. try writer " + ie->second );
267 localMsg(
"3. " + ie->second +
" OK" );
278 catch( std::exception & e )
280 localMsg(
"3. " + ie->second +
" failed" );
286 tried.insert( ie->second );
292 if( passbegin <= 4 && passend >= 4 )
295 iext.first = extensions.begin();
296 iext.second = extensions.end();
297 for( ie=iext.first, ee=iext.second; ie!=ee; ++ie )
298 if( tried.find( ie->second ) == notyet ) {
304 localMsg(
"4. try writer " + ie->second );
307 localMsg(
"4. " + ie->second +
" OK" );
318 catch( std::exception & e )
320 localMsg(
"4. " + ie->second +
" failed" );
326 tried.insert( ie->second );
333 filename +
" : no matching format" );
virtual bool write(const T &obj, carto::Object options=carto::none(), int passbegin=1, int passend=4)
Finds the correct format and writes the object.