⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpl__vsi_8h.html

📁 gdal库的学习文档
💻 HTML
📖 第 1 页 / 共 4 页
字号:
Analog of the POSIX fread() call.<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>pBuffer</em>&nbsp;</td><td>the buffer into which the data should be read (at least nCount * nSize bytes in size. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>nSize</em>&nbsp;</td><td>size of objects to read in bytes. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>nCount</em>&nbsp;</td><td>number of objects to read. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#48b5fab6cc22a9d0a543c095ee358634">VSIFOpenL()</a>.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>number of objects successfully read. </dd></dl></div></div><p><a class="anchor" name="e4fbf582f429d575cd06d559afb0ce5a"></a><!-- doxytag: member="cpl_vsi.h::VSIFSeekL" ref="e4fbf582f429d575cd06d559afb0ce5a" args="(FILE *, vsi_l_offset, int)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">int VSIFSeekL           </td>          <td>(</td>          <td class="paramtype">FILE *&nbsp;</td>          <td class="paramname"> <em>fp</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">vsi_l_offset&nbsp;</td>          <td class="paramname"> <em>nOffset</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>nWhence</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Seek to requested offset. <p>Seek to the desired offset (nOffset) in the indicated file.<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.<p>Analog of the POSIX fseek() call.<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>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#48b5fab6cc22a9d0a543c095ee358634">VSIFOpenL()</a>. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>nOffset</em>&nbsp;</td><td>offset in bytes. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>nWhence</em>&nbsp;</td><td>one of SEEK_SET, SEEK_CUR or SEEK_END.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success or -1 one failure. </dd></dl></div></div><p><a class="anchor" name="8e02ad6d2abd844a57a206e3ebba50b4"></a><!-- doxytag: member="cpl_vsi.h::VSIFTellL" ref="8e02ad6d2abd844a57a206e3ebba50b4" args="(FILE *)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">vsi_l_offset VSIFTellL           </td>          <td>(</td>          <td class="paramtype">FILE *&nbsp;</td>          <td class="paramname"> <em>fp</em>          </td>          <td>&nbsp;)&nbsp;</td>          <td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Tell current file offset. <p>Returns the current file read/write offset in bytes from the beginning of the file.<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.<p>Analog of the POSIX ftell() call.<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>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#48b5fab6cc22a9d0a543c095ee358634">VSIFOpenL()</a>.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>file offset in bytes. </dd></dl></div></div><p><a class="anchor" name="485b2abb8535e77a9ee2bef266a4442d"></a><!-- doxytag: member="cpl_vsi.h::VSIFWriteL" ref="485b2abb8535e77a9ee2bef266a4442d" args="(const void *, size_t, size_t, FILE *)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">size_t VSIFWriteL           </td>          <td>(</td>          <td class="paramtype">const void *&nbsp;</td>          <td class="paramname"> <em>pBuffer</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">size_t&nbsp;</td>          <td class="paramname"> <em>nSize</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">size_t&nbsp;</td>          <td class="paramname"> <em>nCount</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">FILE *&nbsp;</td>          <td class="paramname"> <em>fp</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Write bytes to file. <p>Writess nCount objects of nSize bytes to the indicated file at the current offset into the indicated buffer.<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.<p>Analog of the POSIX fwrite() call.<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>pBuffer</em>&nbsp;</td><td>the buffer from which the data should be written (at least nCount * nSize bytes in size. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>nSize</em>&nbsp;</td><td>size of objects to read in bytes. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>nCount</em>&nbsp;</td><td>number of objects to read. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>fp</em>&nbsp;</td><td>file handle opened with <a class="el" href="cpl__vsi_8h.html#48b5fab6cc22a9d0a543c095ee358634">VSIFOpenL()</a>.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>number of objects successfully written. </dd></dl></div></div><p><a class="anchor" name="eaf26bcc4a5314371f426bb2a5e6ce7a"></a><!-- doxytag: member="cpl_vsi.h::VSIGetMemFileBuffer" ref="eaf26bcc4a5314371f426bb2a5e6ce7a" args="(const char *pszFilename, vsi_l_offset *pnDataLength, int bUnlinkAndSeize)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">GByte* VSIGetMemFileBuffer           </td>          <td>(</td>          <td class="paramtype">const char *&nbsp;</td>          <td class="paramname"> <em>pszFilename</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">vsi_l_offset *&nbsp;</td>          <td class="paramname"> <em>pnDataLength</em>, </td>        </tr>        <tr>          <td class="paramkey"></td>          <td></td>          <td class="paramtype">int&nbsp;</td>          <td class="paramname"> <em>bUnlinkAndSeize</em></td><td>&nbsp;</td>        </tr>        <tr>          <td></td>          <td>)</td>          <td></td><td></td><td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Fetch buffer underlying memory file. <p>This function returns a pointer to the memory buffer underlying a virtual "in memory" file. If bUnlinkAndSeize is TRUE the filesystem object will be deleted, and ownership of the buffer will pass to the caller otherwise the underlying file will remain in existance.<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>pszFilename</em>&nbsp;</td><td>the name of the file to grab the buffer of. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>buffer</em>&nbsp;</td><td>(file) length returned in this variable. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>bUnlinkAndSeize</em>&nbsp;</td><td>TRUE to remove the file, or FALSE to leave unaltered.</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to memory buffer or NULL on failure. </dd></dl></div></div><p><a class="anchor" name="66e2e6f093fd42f8a941b962d4c8a19e"></a><!-- doxytag: member="cpl_vsi.h::VSIInstallMemFileHandler" ref="66e2e6f093fd42f8a941b962d4c8a19e" args="(void)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">void VSIInstallMemFileHandler           </td>          <td>(</td>          <td class="paramtype">void&nbsp;</td>          <td class="paramname">          </td>          <td>&nbsp;)&nbsp;</td>          <td width="100%"></td>        </tr>      </table></div><div class="memdoc"><p>Install "memory" file system handler. <p>A special file handler is installed that allows block of memory to be treated as files. All portions of the file system underneath the base path "/vsimem/" will be handled by this driver.<p>Normal VSI*L functions can be used freely to create and destroy memory arrays treating them as if they were real file system objects. Some additional methods exist to efficient create memory file system objects without duplicating original copies of the data or to "steal" the block of memory associated with a memory file.<p>At this time the memory handler does not properly handle directory semantics for the memory portion of the filesystem. The VSIReadDir() function is not supported though this will be corrected in the future.<p>Calling this function repeatedly should do no harm, though it is not necessary. It is already called the first time a virtualizable file access function (ie. <a class="el" href="cpl__vsi_8h.html#48b5fab6cc22a9d0a543c095ee358634">VSIFOpenL()</a>, VSIMkDir(), etc) is called.<p>This code example demonstrates using GDAL to translate from one memory buffer to another.<p><div class="fragment"><pre class="fragment"> GByte *ConvertBufferFormat( GByte *pabyInData, vsi_l_offset nInDataLength, 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -