34 #ifndef SOMAIO_READER_FORMATREADER_D_H
35 #define SOMAIO_READER_FORMATREADER_D_H
51 #define localMsg( message ) cartoCondMsg( 4, message, "FORMATREADER" )
74 dsi = checkDataSourceInfo( dsi, options );
76 localMsg(
"Copying allocator context...")
78 setup( obj, dsi->header(), ac, options );
79 read( obj, dsi, ac, options );
88 dsi = checkDataSourceInfo( dsi, options );
92 std::unique_ptr<T> objp( create( dsi->header(), ac, options ) );
95 read( *obj, dsi, ac, options );
112 context.dataSource() ?
113 context.dataSource()->url() :
"" );
121 localMsg(
"Checking data source information...")
125 if( new_options.
isNone() )
127 new_options->setProperty(
"format", formatID() );
DataAccess accessMode() const
static void setup(T &obj, carto::Object header, const AllocatorContext &context, carto::Object options)
Setup (modify) an existing object according to the given header (maybe resize it etc....
static T * create(carto::Object header, const AllocatorContext &context, carto::Object options)
Create a new object according to the given header.
Generic information retreiver / checker for all data sources and file formats.
DataSourceInfo check(DataSourceInfo dsi, carto::Object options=carto::none(), int passbegin=1, int passend=3)
Finds the right format checker.
Informative object used by IO system.