这个函数很短小:

/**
* \brief This method unload undesirable drivers.
*
* All drivers specified in the space delimited list in the GDAL_SKIP
* environmentvariable) will be deregistered and destroyed. This method
* should normally be called after registration of standard drivers to allow
* the user a way of unloading undesired drivers. The GDALAllRegister()
* function already invokes AutoSkipDrivers() at the end, so if that functions
* is called, it should not be necessary to call this method from application
* code.
*/ void GDALDriverManager::AutoSkipDrivers() {
if( CPLGetConfigOption( "GDAL_SKIP", NULL ) == NULL )
return; char **papszList = CSLTokenizeString( CPLGetConfigOption("GDAL_SKIP","") ); for( int i = 0; i < CSLCount(papszList); i++ )
{
GDALDriver *poDriver = GetDriverByName( papszList[i] ); if( poDriver == NULL )
CPLError( CE_Warning, CPLE_AppDefined,
"Unable to find driver %s to unload from GDAL_SKIP environment variable.",
papszList[i] );
else
{
CPLDebug( "GDAL", "AutoSkipDriver(%s)", papszList[i] );
DeregisterDriver( poDriver );
delete poDriver;
}
} CSLDestroy( papszList );
}

如果在环境变量GDAL_SKIP中指定某些driver,可以在运行时将该driver从GDALDriverManger中注销掉。这提供了一个基于配置的解决方案,比起前面通过编译时添加宏多了一个选择。考虑的还是比较周到的。

Inside GDALAllRegister之四: 跳过driver的更多相关文章

  1. Inside GDALAllRegister之一: 五大部分

    基本信息 在GDAL的Tutorial中开篇即提到GDALAllRegister函数,它会注册所有已知的驱动,包括动态库自动加载的驱动.最关键是这句话: If for some application ...

  2. Inside GDALAllRegister之二: 自动加载驱动

    代码    GetGDALDriverManager()->AutoLoadDrivers(); 包含了两部分: 首先获得GDALDriverManager的singleton对象的指针,这点之 ...

  3. Inside GDALAllRegister之三: 注册指定驱动

    现在来仔细分析如何注册一个驱动的代码,看下面代码: #ifdef FRMT_vrt GDALRegister_VRT(); #endif 编译时指定或者取消FRMT_vrt,可以控制这条语句是否编译到 ...

  4. oracle的oci和thin区别(数据源)

    我是今天看到tomcat数据源的配置时,想起来这个问题,刚开始还不晓得thin是什么东西! database.url=jdbc:oracle:thin:angel/oracle@192.168.55. ...

  5. Appium + Python 测试 QQ 音乐 APP的一段简单脚本

    1. 大致流程 + 程序(Python):打开 QQ 音乐,点击一系列接收按键,进入搜索音乐界面,输入『Paradise』,播放第一首音乐. 2. Python 脚本如下 from appium im ...

  6. python命名空间、作用域、闭包与传值传引用

    (以下内容,均基于python3) 最近在看python函数部分,讲到了python的作用域问题,然后又讲了Python的闭包问题. 在做作业的时候,我遇到了几个问题,下面先来看作业. 一. 作业1: ...

  7. 驱动程序分层分离概念_总线驱动设备模型_P

    分层概念: 驱动程序向上注册的原理: 比如:输入子程序一个input.c作为一层,下层为Dev.c和Dir.c,分别编写Dev.c和Dir.c向上Input.c注册:如图所示 分离概念: 分离概念主要 ...

  8. Selenium2.0+TestNG+Ant+Jenkins自动化测试浅尝

    当前常用自动化测试工具 Web自动化测试工具:QTP .selenium等 性能自动化测试工具:loadrunner.jmeter等 接口自动化测试工具:SoapUI.postman等 手机自动化测试 ...

  9. selenium请求豆瓣网

    #请求豆瓣网 from selenium import webdriverimport timedriver = webdriver.Chrome() driver.get("http:// ...

随机推荐

  1. ZeptoLab Code Rush 2015 B. Om Nom and Dark Park DFS

    B. Om Nom and Dark Park Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/5 ...

  2. 理解 JavaScript 中的 Function.prototype.bind

    函数绑定(Function binding)很有可能是你在开始使用JavaScript时最少关注的一点,但是当你意识到你需要一个解决方案来解决如何在另一个函数中保持this上下文的时候,你真正需要的其 ...

  3. ASP.NET MVC的请求处理流程

    (1)用户打开浏览器,在地址栏输入某个网址URL并回车,浏览器便开始向该URL指向的服务器发送HTTP请求(一般是GET方式).(2)服务器端的网站服务系统(IIS)接收到该请求,先检查自己是否认识该 ...

  4. 移动平台的WebApp之Meta标签

    对于桌面平台web布局中大家对meta标签再熟悉不过了,它永远位于 head 元素内部,对做SEO的朋友一定对meta有种特殊的感情吧,今天我们就来说说移动平台的meta标签,在移动平台meta标签究 ...

  5. Complete list of APDU responses

    https://www.eftlab.com.au/index.php/site-map/knowledge-base/118-apdu-response-list List of APDU resp ...

  6. Tasker to proximity screen off

    If you are using proximity screen off pro or smart screen off, you may know how convenient it is to ...

  7. Tasker to detect and vibrate once the ougoing call is being answered

    I happen to find that for GSM standard phone, call duration would be created into sql database only ...

  8. 【Go入门教程4】变量(var),常量(const),内置基础类型(Boolean、数值 byte,int,rune、字符串、错误类型),分组,iota枚举,array(数值),slice(切片),map(字典),make/new操作,零值

    这小节我们将要介绍如何定义变量.常量.Go 内置类型以及 Go 程序设计中的一些技巧. 定义变量 Go 语言里面定义变量有多种方式. 使用 var 关键字是 Go 最基本的定义变量方式,与 C 语言不 ...

  9. Node.js modules you should know about: request

    Hey everyone! This is the fourth post in my new node.js modules you should know about article series ...

  10. .NET:鲜为人知的 “Load Context”

    背景 任何一门语言都要了解其类型加载过程,如:Java 的 Class Loader,NodeJS 的搜索方式等,本文概述一下我对 CLR 如何加载程序集,重点说一下 Load Context. 其编 ...