📄 cpl__conv_8h.html
字号:
<dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to the pszBuffer containing a string read from the file or NULL if the error or end of file was encountered. </dd></dl></div></div><p><a class="anchor" name="9c76b24b06830f0da04fe076177f9ff3"></a><!-- doxytag: member="cpl_conv.h::CPLFormCIFilename" ref="9c76b24b06830f0da04fe076177f9ff3" args="(const char *pszPath, const char *pszBasename, const char *pszExtension)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* CPLFormCIFilename </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszPath</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszBasename</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszExtension</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>Case insensitive file searching, returing full path.<p>This function tries to return the path to a file regardless of whether the file exactly matches the basename, and extension case, or is all upper case, or all lower case. The path is treated as case sensitive. This function is equivelent to <a class="el" href="cpl__conv_8h.html#ee0f81afed5b1b31da1b401822c7a2fb">CPLFormFilename()</a> on case insensitive file systems (like Windows).<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>pszPath</em> </td><td>directory path to the directory containing the file. This may be relative or absolute, and may have a trailing path separator or not. May be NULL.</td></tr> <tr><td valign="top"></td><td valign="top"><em>pszBasename</em> </td><td>file basename. May optionally have path and/or extension. May not be NULL.</td></tr> <tr><td valign="top"></td><td valign="top"><em>pszExtension</em> </td><td>file extension, optionally including the period. May be NULL.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>a fully formed filename in an internal static string. Do not modify or free the returned string. The string may be destroyed by the next CPL call. </dd></dl></div></div><p><a class="anchor" name="ee0f81afed5b1b31da1b401822c7a2fb"></a><!-- doxytag: member="cpl_conv.h::CPLFormFilename" ref="ee0f81afed5b1b31da1b401822c7a2fb" args="(const char *pszPath, const char *pszBasename, const char *pszExtension)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* CPLFormFilename </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszPath</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszBasename</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszExtension</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>Build a full file path from a passed path, file basename and extension.<p>The path, and extension are optional. The basename may in fact contain an extension if desired.<p><pre> CPLFormFilename("abc/xyz","def", ".dat" ) == "abc/xyz/def.dat" CPLFormFilename(NULL,"def", NULL ) == "def" CPLFormFilename(NULL,"abc/def.dat", NULL ) == "abc/def.dat" CPLFormFilename("/abc/xyz/","def.dat", NULL ) == "/abc/xyz/def.dat" </pre><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>pszPath</em> </td><td>directory path to the directory containing the file. This may be relative or absolute, and may have a trailing path separator or not. May be NULL.</td></tr> <tr><td valign="top"></td><td valign="top"><em>pszBasename</em> </td><td>file basename. May optionally have path and/or extension. May not be NULL.</td></tr> <tr><td valign="top"></td><td valign="top"><em>pszExtension</em> </td><td>file extension, optionally including the period. May be NULL.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>a fully formed filename in an internal static string. Do not modify or free the returned string. The string may be destroyed by the next CPL call. </dd></dl></div></div><p><a class="anchor" name="913ec8c102e1dd312d9447cd815a8673"></a><!-- doxytag: member="cpl_conv.h::CPLGetBasename" ref="913ec8c102e1dd312d9447cd815a8673" args="(const char *)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* CPLGetBasename </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszFullFilename</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Extract basename (non-directory, non-extension) portion of filename.<p>Returns a string containing the file basename portion of the passed name. If there is no basename (passed value ends in trailing directory separator, or filename starts with a dot) an empty string is returned.<p><pre> CPLGetBasename( "abc/def.xyz" ) == "def" CPLGetBasename( "abc/def" ) == "def" CPLGetBasename( "abc/def/" ) == "" </pre><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>pszFullFilename</em> </td><td>the full filename potentially including a path.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>just the non-directory, non-extension portion of the path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call. </dd></dl></div></div><p><a class="anchor" name="fc51f03a3789be8a47b8a753eb897856"></a><!-- doxytag: member="cpl_conv.h::CPLGetCurrentDir" ref="fc51f03a3789be8a47b8a753eb897856" args="(void)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">char* CPLGetCurrentDir </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>Get the current working directory name.<p><dl class="return" compact><dt><b>Returns:</b></dt><dd>a pointer to buffer, containing current working directory path or NULL in case of error. User is responsible to free that buffer after usage with CPLFree() function. If HAVE_GETCWD macro is not defined, the function returns NULL. </dd></dl></div></div><p><a class="anchor" name="3c6f71eaf9b8e8f98242af533752d1bb"></a><!-- doxytag: member="cpl_conv.h::CPLGetDirname" ref="3c6f71eaf9b8e8f98242af533752d1bb" args="(const char *)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* CPLGetDirname </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszFilename</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Extract directory path portion of filename.<p>Returns a string containing the directory path portion of the passed filename. If there is no path in the passed filename the dot will be returned. It is the only difference from <a class="el" href="cpl__conv_8h.html#4cd11a5f67bb4816342301fa8a5990a0">CPLGetPath()</a>.<p><pre> CPLGetDirname( "abc/def.xyz" ) == "abc" CPLGetDirname( "/abc/def/" ) == "/abc/def" CPLGetDirname( "/" ) == "/" CPLGetDirname( "/abc/def" ) == "/abc" CPLGetDirname( "abc" ) == "." </pre><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 filename potentially including a path.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call. The returned will generally not contain a trailing path separator. </dd></dl></div></div><p><a class="anchor" name="5325c900de0918020b747ed07d98da24"></a><!-- doxytag: member="cpl_conv.h::CPLGetExecPath" ref="5325c900de0918020b747ed07d98da24" args="(char *pszPathBuf, int nMaxLength)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int CPLGetExecPath </td> <td>(</td> <td class="paramtype">char * </td> <td class="paramname"> <em>pszPathBuf</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>nMaxLength</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>Fetch path of executable.<p>The path to the executable currently running is returned. This path includes the name of the executable. Currently this only works on win32 platform.<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>pszPathBuf</em> </td><td>the buffer into which the path is placed. </td></tr> <tr><td valign="top"></td><td valign="top"><em>nMaxLength</em> </td><td>the buffer size, MAX_PATH+1 is suggested.</td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>FALSE on failure or TRUE on success. </dd></dl></div></div><p><a class="anchor" name="e46fcfcea1b2e8c24738542613ba4752"></a><!-- doxytag: member="cpl_conv.h::CPLGetExtension" ref="e46fcfcea1b2e8c24738542613ba4752" args="(const char *)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* CPLGetExtension </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>pszFullFilename</em> </td> <td> ) </td> <td width="100%"></td> </tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -