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

📄 classpdirectory.html

📁 pwlib开发文档
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>PDirectory class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>PDirectory Class Reference</h1><code>#include &lt;<a class="el" href="pdirect_8h-source.html">pdirect.h</a>&gt;</code><p><p>Inheritance diagram for PDirectory:<p><center><img src="classPDirectory.png" usemap="#PDirectory_map" border="0" alt=""></center><map name="PDirectory_map"><area href="classPString.html" alt="PString" shape="rect" coords="0,56,81,80"><area href="classPCharArray.html" alt="PCharArray" shape="rect" coords="0,0,81,24"></map><a href="classPDirectory-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Access functions</h2></td></tr><tr><td nowrap align=right valign=top>PDirectory&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z207_0">GetParent</a> () const</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPFilePathString.html">PFilePathString</a>&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z207_1">GetVolume</a> () const</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z207_2">IsRoot</a> () const</td></tr><tr><td nowrap align=right valign=top>PDirectory&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z207_3">GetRoot</a> () const</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPStringArray.html">PStringArray</a>&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z207_4">GetPath</a> () const</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z207_5">GetVolumeSpace</a> (PInt64 &amp;total, PInt64 &amp;free, DWORD &amp;clusterSize) const</td></tr><tr><td nowrap align=right valign=top>PINLINE BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z207_6">IsSeparator</a> (char ch)</td></tr><tr><td colspan=2><br><h2>File system functions</h2></td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z209_0">Exists</a> () const</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z209_1">Change</a> () const</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z209_2">Create</a> (int perm=PFileInfo::DefaultDirPerms) const</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z209_3">Remove</a> ()</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z209_4">Exists</a> (const <a class="el" href="classPString.html">PString</a> &amp;path)</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z209_5">Change</a> (const <a class="el" href="classPString.html">PString</a> &amp;path)</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z209_6">Create</a> (const <a class="el" href="classPString.html">PString</a> &amp;p, int perm=PFileInfo::DefaultDirPerms)</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z209_7">Remove</a> (const <a class="el" href="classPString.html">PString</a> &amp;path)</td></tr><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td colspan="2"><div class="groupHeader">Construction</div></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z205_0">PDirectory</a> ()</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Create a directory object of the current working directory.</em> <a href="#z205_0"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z205_1">PDirectory</a> (const char *cpathname)</td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z205_2">PDirectory</a> (const <a class="el" href="classPString.html">PString</a> &amp;pathname)</td></tr><tr><td nowrap align=right valign=top>PDirectory &amp;&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z205_3">operator=</a> (const <a class="el" href="classPString.html">PString</a> &amp;pathname)</td></tr><tr><td nowrap align=right valign=top>PDirectory &amp;&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z205_4">operator=</a> (const char *cpathname)</td></tr><tr><td colspan="2"><div class="groupHeader">Directory listing functions</div></td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z211_0">Open</a> (int <a class="el" href="classPDirectory.html#n0">scanMask</a>=PFileInfo::AllFiles)</td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z211_1">Restart</a> (int <a class="el" href="classPDirectory.html#n0">scanMask</a>=PFileInfo::AllFiles)</td></tr><tr><td nowrap align=right valign=top>BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z211_2">Next</a> ()</td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z211_3">Close</a> ()</td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Close the directory during or after a file list scan.</em> <a href="#z211_3"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>virtual <a class="el" href="classPFilePathString.html">PFilePathString</a>&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z211_4">GetEntryName</a> () const</td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z211_5">IsSubDir</a> () const</td></tr><tr><td nowrap align=right valign=top>virtual BOOL&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#z211_6">GetInfo</a> (<a class="el" href="classPFileInfo.html">PFileInfo</a> &amp;info) const</td></tr><tr><td colspan=2><br><h2>Protected Methods</h2></td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#b0">Construct</a> ()</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#b1">Destruct</a> ()</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#n0">scanMask</a></td></tr><tr><td>&nbsp;</td><td><font size=-1><em>Mask of file types that the directory scan will return.</em> <a href="#n0"></a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>DIR *&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#n1">directory</a></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classPFileInfo.html">PFileInfo</a> *&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#n2">entryInfo</a></td></tr><tr><td nowrap align=right valign=top>dirent *&nbsp;</td><td valign=bottom><a class="el" href="classPDirectory.html#n3">entryBuffer</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Class to represent a directory in the operating system file system. A directory is a special file that contains a list of file paths.<p>The directory paths are highly platform dependent and a minimum number of assumptions should be made.<p>The PDirectory object is a string consisting of a possible volume name, and a series directory names in the path from the volumes root to the directory that the object represents. Each directory is separated by the platform dependent separator character which is defined by the PDIR_SEPARATOR macro. The path always has a trailing separator.<p>Some platforms allow more than one character to act as a directory separator so when doing any processing the <a class="el" href="classPDirectory.html#z207_6">IsSeparator()</a># function should be used to determine if a character is a possible separator.<p>The directory may be opened to gain access to the list of files that it contains. Note that the directory does {\bf not} contain the "." and ".." entries that some platforms support.<p>The ancestor class is dependent on the platform. For file systems that are case sensitive, eg Unix, the ancestor is <a class="el" href="classPString.html#z231_1">PString</a>#. For other platforms, the ancestor class is PCaselessString#. <p><hr><h2>Constructor &amp; Destructor Documentation</h2><a name="z205_0" doxytag="PDirectory::PDirectory"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PINLINE PDirectory::PDirectory </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Create a directory object of the current working directory.<p>    </td>  </tr></table><a name="z205_1" doxytag="PDirectory::PDirectory"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PINLINE PDirectory::PDirectory </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const char *&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>cpathname</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Create a directory object of the specified directory. The pathname# parameter may be a relative directory which is made absolute by the creation of the <a class="el" href="classPDirectory.html#z205_0">PDirectory</a># object. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>cpathname</em>&nbsp;</td><td>Directory path name for new object. </td></tr></table></dl>    </td>  </tr></table><a name="z205_2" doxytag="PDirectory::PDirectory"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PINLINE PDirectory::PDirectory </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>pathname</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Create a directory object of the specified directory. The pathname# parameter may be a relative directory which is made absolute by the creation of the <a class="el" href="classPDirectory.html#z205_0">PDirectory</a># object. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>pathname</em>&nbsp;</td><td>Directory path name for new object. </td></tr></table></dl>    </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="z209_5" doxytag="PDirectory::Change"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> BOOL PDirectory::Change </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>path</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [static]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Change the current working directory to that specified..<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if current working directory was changed. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>path</em>&nbsp;</td><td>Directory file path. </td></tr></table></dl>    </td>  </tr></table><a name="z209_1" doxytag="PDirectory::Change"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PINLINE BOOL PDirectory::Change </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Change the current working directory to the objects location.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if current working directory was changed. </dl>    </td>  </tr></table><a name="z211_3" doxytag="PDirectory::Close"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> virtual void PDirectory::Close </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Close the directory during or after a file list scan.<p>    </td>  </tr></table><a name="b0" doxytag="PDirectory::Construct"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PDirectory::Construct </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><a name="z209_6" doxytag="PDirectory::Create"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> BOOL PDirectory::Create </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> &amp;&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>p</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>int&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>perm</em> = PFileInfo::DefaultDirPerms</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [static]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Create a new directory as specified with the specified permissions.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if directory created. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>perm</em>&nbsp;</td><td>Directory file path. Permission on new directory. </td></tr></table></dl>    </td>  </tr></table><a name="z209_2" doxytag="PDirectory::Create"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> PINLINE BOOL PDirectory::Create </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">int&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>perm</em> = PFileInfo::DefaultDirPerms          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const</td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Create a new directory with the specified permissions.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if directory created. </dl>    </td>  </tr></table><a name="b1" doxytag="PDirectory::Destruct"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> void PDirectory::Destruct </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [inline, protected]</code></td>        </tr>      </table>    </td>  </tr>

⌨️ 快捷键说明

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