📄 classogrsfdriverregistrar.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>OGR: OGRSFDriverRegistrar Class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.1 --><div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li id="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul></div><div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul></div><h1>OGRSFDriverRegistrar Class Reference</h1><!-- doxytag: class="OGRSFDriverRegistrar" --><code>#include <<a class="el" href="ogrsf__frmts_8h-source.html">ogrsf_frmts.h</a>></code><p><a href="classOGRSFDriverRegistrar-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr><tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classOGRSFDriverRegistrar.html#56a1c4fbd9bdfd484a2132963f52de1f">RegisterDriver</a> (<a class="el" href="classOGRSFDriver.html">OGRSFDriver</a> *poDriver)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classOGRSFDriverRegistrar.html#d6e753df0c4548187f9fd7e3d5af3999">GetDriverCount</a> (void)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classOGRSFDriver.html">OGRSFDriver</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classOGRSFDriverRegistrar.html#359c5bcb65b737b1c59bab9c2ff78e7e">GetDriver</a> (int iDriver)</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classOGRSFDriverRegistrar.html#e98efe100c0ecea4f6868e008838f878">AutoLoadDrivers</a> ()</td></tr><tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classOGRSFDriverRegistrar.html">OGRSFDriverRegistrar</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classOGRSFDriverRegistrar.html#fbd5602672ac5f1882055cc459375f8e">GetRegistrar</a> ()</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classOGRDataSource.html">OGRDataSource</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classOGRSFDriverRegistrar.html#5ee13e09d55d146f45bb5417fa524f54">Open</a> (const char *pszName, int bUpdate=FALSE, <a class="el" href="classOGRSFDriver.html">OGRSFDriver</a> **ppoDriver=NULL)</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Singleton manager for drivers. <p><hr><h2>Member Function Documentation</h2><a class="anchor" name="fbd5602672ac5f1882055cc459375f8e"></a><!-- doxytag: member="OGRSFDriverRegistrar::GetRegistrar" ref="fbd5602672ac5f1882055cc459375f8e" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classOGRSFDriverRegistrar.html">OGRSFDriverRegistrar</a> * OGRSFDriverRegistrar::GetRegistrar </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [static]</code></td> </tr> </table></div><div class="memdoc"><p>Return the driver manager, creating one if none exist.<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>the driver manager. </dd></dl></div></div><p><a class="anchor" name="5ee13e09d55d146f45bb5417fa524f54"></a><!-- doxytag: member="OGRSFDriverRegistrar::Open" ref="5ee13e09d55d146f45bb5417fa524f54" args="(const char *pszName, int bUpdate=FALSE, OGRSFDriver **ppoDriver=NULL)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classOGRDataSource.html">OGRDataSource</a> * OGRSFDriverRegistrar::Open </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszName</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>bUpdate</em> = <code>FALSE</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classOGRSFDriver.html">OGRSFDriver</a> ** </td> <td class="paramname"> <em>ppoDriver</em> = <code>NULL</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [static]</code></td> </tr> </table></div><div class="memdoc"><p>Open a file / data source with one of the registered drivers.<p>This method loops through all the drivers registered with the driver manager trying each until one succeeds with the given data source. This method is static. Applications don't normally need to use any other <a class="el" href="classOGRSFDriverRegistrar.html">OGRSFDriverRegistrar</a> methods directly, not do they normally need to have a pointer to an <a class="el" href="classOGRSFDriverRegistrar.html">OGRSFDriverRegistrar</a> instance.<p>If this method fails, <a class="el" href="cpl__error_8h.html#7f71ade3bb0a0e9e45802975ec59ff5e">CPLGetLastErrorMsg()</a> can be used to check if there is an error message explaining why.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#123bb02ac8c5cfe143e132f627531125">OGROpen()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>pszName</em> </td><td>the name of the file, or data source to open. </td></tr> <tr><td valign="top"></td><td valign="top"><em>bUpdate</em> </td><td>FALSE for read-only access (the default) or TRUE for read-write access. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ppoDriver</em> </td><td>if non-NULL, this argument will be updated with a pointer to the driver which was used to open the data source.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>NULL on error or if the pass name is not supported by this driver, otherwise a pointer to an <a class="el" href="classOGRDataSource.html">OGRDataSource</a>. This <a class="el" href="classOGRDataSource.html">OGRDataSource</a> should be closed by deleting the object when it is no longer needed.</dd></dl><b>Example:</b><p><pre> <a class="el" href="classOGRDataSource.html">OGRDataSource</a> *poDS;</pre><p><pre> poDS = <a class="el" href="classOGRSFDriverRegistrar.html#5ee13e09d55d146f45bb5417fa524f54">OGRSFDriverRegistrar::Open</a>( "polygon.shp" ); if( poDS == NULL ) { return; }</pre><p><pre> ... use the data source ...</pre><p><pre> delete poDS; </pre> </div></div><p><a class="anchor" name="56a1c4fbd9bdfd484a2132963f52de1f"></a><!-- doxytag: member="OGRSFDriverRegistrar::RegisterDriver" ref="56a1c4fbd9bdfd484a2132963f52de1f" args="(OGRSFDriver *poDriver)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void OGRSFDriverRegistrar::RegisterDriver </td> <td>(</td> <td class="paramtype"><a class="el" href="classOGRSFDriver.html">OGRSFDriver</a> * </td> <td class="paramname"> <em>poDriver</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Add a driver to the list of registered drivers.<p>If the passed driver is already registered (based on pointer comparison) then the driver isn't registered. New drivers are added at the end of the list of registered drivers.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#7ace3e4b97b55b999e16557a75bf7226">OGRRegisterDriver()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>poDriver</em> </td><td>the driver to add. </td></tr> </table></dl></div></div><p><a class="anchor" name="d6e753df0c4548187f9fd7e3d5af3999"></a><!-- doxytag: member="OGRSFDriverRegistrar::GetDriverCount" ref="d6e753df0c4548187f9fd7e3d5af3999" args="(void)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int OGRSFDriverRegistrar::GetDriverCount </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Fetch the number of registered drivers.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#d0f6d2bbd269b56a61d1c1841dac2575">OGRGetDriverCount()</a>.<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>the drivers count. </dd></dl></div></div><p><a class="anchor" name="359c5bcb65b737b1c59bab9c2ff78e7e"></a><!-- doxytag: member="OGRSFDriverRegistrar::GetDriver" ref="359c5bcb65b737b1c59bab9c2ff78e7e" args="(int iDriver)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classOGRSFDriver.html">OGRSFDriver</a> * OGRSFDriverRegistrar::GetDriver </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"> <em>iDriver</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Fetch the indicated driver.<p>This method is the same as the C function <a class="el" href="ogr__api_8h.html#3f8080605cad5aeef9519c38fe160b51">OGRGetDriver()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>iDriver</em> </td><td>the driver index, from 0 to <a class="el" href="classOGRSFDriverRegistrar.html#d6e753df0c4548187f9fd7e3d5af3999">GetDriverCount()</a>-1.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>the driver, or NULL if iDriver is out of range. </dd></dl></div></div><p><a class="anchor" name="e98efe100c0ecea4f6868e008838f878"></a><!-- doxytag: member="OGRSFDriverRegistrar::AutoLoadDrivers" ref="e98efe100c0ecea4f6868e008838f878" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void OGRSFDriverRegistrar::AutoLoadDrivers </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Auto-load GDAL drivers from shared libraries.<p>This function will automatically load drivers from shared libraries. It searches the "driver path" for .so (or .dll) files that start with the prefix "gdal_X.so". It then tries to load them and then tries to call a function within them called GDALRegister_X() where the 'X' is the same as the remainder of the shared library basename, or failing that to call GDALRegisterMe().<p>There are a few rules for the driver path. If the GDAL_DRIVER_PATH environment variable it set, it is taken to be a list of directories to search separated by colons on unix, or semi-colons on Windows. Otherwise the /usr/local/lib/gdalplugins directory, and (if known) the lib/gdalplugins subdirectory of the gdal home directory are searched. </div></div><p><hr>The documentation for this class was generated from the following files:<ul><li><a class="el" href="ogrsf__frmts_8h-source.html">ogrsf_frmts.h</a><li>ogrsf_frmts.dox<li>ogrsfdriverregistrar.cpp</ul><hr>Generated for GDAL by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1.</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -