📄 cpl__conv_8h.html
字号:
<td class="paramname"> <em>bLarge</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Open a shared file handle.<p>Some operating systems have limits on the number of file handles that can be open at one time. This function attempts to maintain a registry of already open file handles, and reuse existing ones if the same file is requested by another part of the application.<p>Note that access is only shared for access types "r", "rb", "r+" and "rb+". All others will just result in direct VSIOpen() calls. Keep in mind that a file is only reused if the file name is exactly the same. Different names referring to the same file will result in different handles.<p>The VSIFOpen() or <a class="el" href="cpl__vsi_8h.html#48b5fab6cc22a9d0a543c095ee358634">VSIFOpenL()</a> function is used to actually open the file, when an existing file handle can't be shared.<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> </td><td>the name of the file to open. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pszAccess</em> </td><td>the normal fopen()/VSIFOpen() style access string. </td></tr> <tr><td valign="top"></td><td valign="top"><em>bLarge</em> </td><td>If TRUE <a class="el" href="cpl__vsi_8h.html#48b5fab6cc22a9d0a543c095ee358634">VSIFOpenL()</a> (for large files) will be used instead of VSIFOpen().</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>a file handle or NULL if opening fails. </dd></dl></div></div><p><a class="anchor" name="a4ffc8fd25881635e18d1a53e177a8e1"></a><!-- doxytag: member="cpl_conv.h::CPLPackedDMSToDec" ref="a4ffc8fd25881635e18d1a53e177a8e1" args="(double)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">double CPLPackedDMSToDec </td> <td>(</td> <td class="paramtype">double </td> <td class="paramname"> <em>dfPacked</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Convert a packed DMS value (DDDMMMSSS.SS) into decimal degrees.<p>This function converts a packed DMS angle to seconds. The standard packed DMS format is:<p>degrees * 1000000 + minutes * 1000 + seconds<p>Example: ang = 120025045.25 yields deg = 120 min = 25 sec = 45.25<p>The algorithm used for the conversion is as follows:<p>1. The absolute value of the angle is used.<p>2. The degrees are separated out: deg = ang/1000000 (fractional portion truncated)<p>3. The minutes are separated out: min = (ang - deg * 1000000) / 1000 (fractional portion truncated)<p>4. The seconds are then computed: sec = ang - deg * 1000000 - min * 1000<p>5. The total angle in seconds is computed: sec = deg * 3600.0 + min * 60.0 + sec<p>6. The sign of sec is set to that of the input angle.<p>Packed DMS values used by the USGS GCTP package and probably by other software.<p>NOTE: This code does not validate input value. If you give the wrong value, you will get the wrong result.<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>dfPacked</em> </td><td>Angle in packed DMS format.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Angle in decimal degrees. </dd></dl></div></div><p><a class="anchor" name="8a5d5d7101cd22feabd56344e62aa98b"></a><!-- doxytag: member="cpl_conv.h::CPLPrintDouble" ref="8a5d5d7101cd22feabd56344e62aa98b" args="(char *, const char *, double, char *)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int CPLPrintDouble </td> <td>(</td> <td class="paramtype">char * </td> <td class="paramname"> <em>pszBuffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszFormat</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">double </td> <td class="paramname"> <em>dfValue</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>pszLocale</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Print double value into specified string buffer. Exponential character flag 'E' (or 'e') will be replaced with 'D', as in Fortran. Resulting string will not to be NULL-terminated.<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>Pointer</em> </td><td>to the destination string buffer. Should be large enough to hold the resulting string. Note, that the string will not be NULL-terminated, so user should do this himself, if needed.</td></tr> <tr><td valign="top"></td><td valign="top"><em>Format</em> </td><td>specifier (for example, "%16.9E").</td></tr> <tr><td valign="top"></td><td valign="top"><em>dfValue</em> </td><td>Numerical value to print.</td></tr> <tr><td valign="top"></td><td valign="top"><em>pszLocale</em> </td><td>Pointer to a character string containing locale name ("C", "POSIX", "us_US", "ru_RU.KOI8-R" etc.). If NULL we will not manipulate with locale settings and current process locale will be used for printing. With the pszLocale option we can control what exact locale will be used for printing a numeric value to the string (in most cases it should be C/POSIX).</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Number of characters printed. </dd></dl></div></div><p><a class="anchor" name="33618500e56ec12e6775b3ed9014b8fb"></a><!-- doxytag: member="cpl_conv.h::CPLPrintInt32" ref="33618500e56ec12e6775b3ed9014b8fb" args="(char *, GInt32, int)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int CPLPrintInt32 </td> <td>(</td> <td class="paramtype">char * </td> <td class="paramname"> <em>pszBuffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">GInt32 </td> <td class="paramname"> <em>iValue</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>nMaxLen</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Print GInt32 value into specified string buffer. This string will not be NULL-terminated.<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>Pointer</em> </td><td>to the destination string buffer. Should be large enough to hold the resulting string. Note, that the string will not be NULL-terminated, so user should do this himself, if needed.</td></tr> <tr><td valign="top"></td><td valign="top"><em>iValue</em> </td><td>Numerical value to print.</td></tr> <tr><td valign="top"></td><td valign="top"><em>nMaxLen</em> </td><td>Maximum length of the resulting string. If string length is greater than nMaxLen, it will be truncated.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Number of characters printed. </dd></dl></div></div><p><a class="anchor" name="f268becc479787ae48bb2607d0000886"></a><!-- doxytag: member="cpl_conv.h::CPLPrintPointer" ref="f268becc479787ae48bb2607d0000886" args="(char *, void *, int)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int CPLPrintPointer </td> <td>(</td> <td class="paramtype">char * </td> <td class="paramname"> <em>pszBuffer</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>pValue</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>nMaxLen</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Print pointer value into specified string buffer. This string will not be NULL-terminated.<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>Pointer</em> </td><td>to the destination string buffer. Should be large enough to hold the resulting string. Note, that the string will not be NULL-terminated, so user should do this himself, if needed.</td></tr> <tr><td valign="top"></td><td valign="top"><em>pValue</em> </td><td>Pointer to ASCII encode.</td></tr> <tr><td valign="top"></td><td valign="top"><em>nMaxLen</em> </td><td>Maximum length of the resulting string. If string length is greater than nMaxLen, it will be truncated.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Number of characters printed. </dd></dl></div></div><p><a class="anchor" name="e284b3e504edca3eb1eaf568469d61ba"></a><!-- doxytag: member="cpl_conv.h::CPLPrintString" ref="e284b3e504edca3eb1eaf568469d61ba" args="(char *, const char *, int)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int CPLPrintString </td> <td>(</td> <td class="paramtype">char * </td> <td class="paramname"> <em>pszDest</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszSrc</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>nMaxLen</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Copy the string pointed to by pszSrc, NOT including the terminating `' character, to the array pointed to by pszDest.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -