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

📄 cpl__vsi_8h.html

📁 gdal库的学习文档
💻 HTML
📖 第 1 页 / 共 3 页
字号:
        </tr>      </table></div><div class="memdoc"><p>Open file. <p>This function opens a file with the desired access. Large files (larger than 2GB) should be supported. Binary access is always implied and the "b" does not need to be included in the pszAccess string.<p>Note that the "FILE *" returned by this function is not really a standard C library FILE *, and cannot be used with any functions other than the "VSI*L" family of functions. They aren't "real" FILE objects.<p>This method goes through the VSIFileHandler virtualization and may work on unusual filesystems such as in memory.<p>Analog of the POSIX fopen() function.<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 file to open. </td></tr>    <tr><td valign="top"></td><td valign="top"><em>pszAccess</em>&nbsp;</td><td>access requested (ie. "r", "r+", "w".</td></tr>  </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>NULL on failure, or the file handle. </dd></dl></div></div><p><a class="anchor" name="64335c9b9395cf8b40273a9cce4b46bf"></a><!-- doxytag: member="cpl_vsi.h::VSIFReadL" ref="64335c9b9395cf8b40273a9cce4b46bf" args="(void *, size_t, size_t, FILE *)" --><div class="memitem"><div class="memproto">      <table class="memname">        <tr>          <td class="memname">size_t VSIFReadL           </td>          <td>(</td>          <td class="paramtype">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>Read bytes from file. <p>Reads nCount objects of nSize bytes from 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 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>

⌨️ 快捷键说明

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