65 return _drivers.insert( DriversMap::value_type( driverId, builder ) ).second;
73 return _drivers.erase( driverId ) != 0;
82 int i = source.find(
">" );
86 string driver_id = source.substr( 0, i );
88 DriversMap::const_iterator i =
_drivers.find( driver_id );
100 if ( source.size() > 6 ) {
103 transform( source.begin(), source.end(), std::back_inserter(lower_source), ::tolower );
105 if ( lower_source.compare( 0, 7,
"http://" ) == 0 ||
106 lower_source.compare( 0, 8,
"https://" ) == 0 ||
107 lower_source.compare( 0, 6,
"ftp://" ) == 0 ) {
130 int i = source.find(
">" );
134 string driver_id = source.substr( 0, i );
136 DriversMap::const_iterator i =
_drivers.find( driver_id );
140 Raster* r = (i->second)();
148 if ( source.size() > 6 ) {
151 transform( source.begin(), source.end(), std::back_inserter(lower_source), ::tolower );
153 if ( lower_source.compare( 0, 7,
"http://" ) == 0 ||
154 lower_source.compare( 0, 8,
"https://" ) == 0 ||
155 lower_source.compare( 0, 6,
"ftp://" ) == 0 ) {
176 int i = source.find(
">" );
180 string driver_id = source.substr( 0, i );
182 DriversMap::const_iterator i =
_drivers.find( driver_id );
186 Raster* r = (i->second)();
194 if ( source.size() > 6 ) {
197 transform( source.begin(), source.end(), std::back_inserter(lower_source), ::tolower );
199 if ( lower_source.compare( 0, 7,
"http://" ) == 0 ||
200 lower_source.compare( 0, 8,
"https://" ) == 0 ||
201 lower_source.compare( 0, 6,
"ftp://" ) == 0 ) {
static Raster * CreateRasterCallback()
Return a new instance of TerralibRaster.
A common interface to rasters.
static Raster * CreateRasterCallback()
bool unregisterDriver(const string &driverId)
Unregister a Raster.
static RasterFactory & instance()
DriversMap _drivers
Map of Rasters and identifiers.
bool registerDriver(const string &driverId, CreateRasterCallback builder)
Raster * create(const string &source, int categ=0)
virtual void createRaster(const std::string &source, int categ=0)=0