📄 classptextfile.html
字号:
<!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>PTextFile 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> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>PTextFile Class Reference</h1><code>#include <<a class="el" href="textfile_8h-source.html">textfile.h</a>></code><p><p>Inheritance diagram for PTextFile:<p><center><img src="classPTextFile.png" usemap="#PTextFile_map" border="0" alt=""></center><map name="PTextFile_map"><area href="classPFile.html" alt="PFile" shape="rect" coords="0,112,67,136"><area href="classPChannel.html" alt="PChannel" shape="rect" coords="0,56,67,80"><area href="classPObject.html" alt="PObject" shape="rect" coords="0,0,67,24"></map><a href="classPTextFile-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></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> </td><td valign=bottom><a class="el" href="classPTextFile.html#z433_0">PTextFile</a> ()</td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classPTextFile.html#z433_1">PTextFile</a> (<a class="el" href="classPFile.html#z125_0">OpenMode</a> mode, int opts=ModeDefault)</td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classPTextFile.html#z433_2">PTextFile</a> (const <a class="el" href="classPFilePath.html">PFilePath</a> &name, <a class="el" href="classPFile.html#z125_0">OpenMode</a> mode=ReadWrite, int opts=ModeDefault)</td></tr><tr><td colspan="2"><div class="groupHeader">Line I/O functions</div></td></tr><tr><td nowrap align=right valign=top>BOOL </td><td valign=bottom><a class="el" href="classPTextFile.html#z435_0">ReadLine</a> (<a class="el" href="classPString.html">PString</a> &str)</td></tr><tr><td nowrap align=right valign=top>BOOL </td><td valign=bottom><a class="el" href="classPTextFile.html#z435_1">WriteLine</a> (const <a class="el" href="classPString.html">PString</a> &str)</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>A class representing a a structured file that is portable accross CPU architectures. Essentially this will normalise the end of line character which differs fromplatform to platform. <p><hr><h2>Constructor & Destructor Documentation</h2><a name="z433_0" doxytag="PTextFile::PTextFile"></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 PTextFile::PTextFile </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Create a text file object but do not open it. It does not initially have a valid file name. However, an attempt to open the file using the PFile::Open()# function will generate a unique temporary file. </td> </tr></table><a name="z433_1" doxytag="PTextFile::PTextFile"></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 PTextFile::PTextFile </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classPFile.html#z125_0">OpenMode</a> </td> <td class="mdname" nowrap> <em>mode</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>opts</em> = ModeDefault</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Create a unique temporary file name, and open the file in the specified mode and using the specified options. Note that opening a new, unique, temporary file name in ReadOnly mode will always fail. This would only be usefull in a mode and options that will create the file.<p>The PChannel::IsOpen()# function may be used after object construction to determine if the file was successfully opened. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>opts</em> </td><td>Mode in which to open the file. <a class="el" href="classPFile.html#z125_1">OpenOptions</a> enum# for open operation. </td></tr></table></dl> </td> </tr></table><a name="z433_2" doxytag="PTextFile::PTextFile"></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 PTextFile::PTextFile </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPFilePath.html">PFilePath</a> & </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classPFile.html#z125_0">OpenMode</a> </td> <td class="mdname" nowrap> <em>mode</em> = ReadWrite, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>opts</em> = ModeDefault</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Create a text file object with the specified name and open it in the specified mode and with the specified options.<p>The PChannel::IsOpen()# function may be used after object construction to determine if the file was successfully opened. <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>mode</em> </td><td>Name of file to open. </td></tr><tr><td valign=top><em>opts</em> </td><td>Mode in which to open the file. <a class="el" href="classPFile.html#z125_1">OpenOptions</a> enum# for open operation. </td></tr></table></dl> </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="z435_0" doxytag="PTextFile::ReadLine"></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 PTextFile::ReadLine </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classPString.html">PString</a> & </td> <td class="mdname1" valign="top" nowrap> <em>str</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Read a line from the text file. What constitutes an end of line in the file is platform dependent.<p>Use the PChannel::GetLastError()# function to determine if there was some error other than end of file.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if successful, FALSE if at end of file or a read error. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>str</em> </td><td>String into which line of text is read. </td></tr></table></dl> </td> </tr></table><a name="z435_1" doxytag="PTextFile::WriteLine"></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 PTextFile::WriteLine </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classPString.html">PString</a> & </td> <td class="mdname1" valign="top" nowrap> <em>str</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Read a line from the text file. What constitutes an end of line in the file is platform dependent.<p>Use the PChannel::GetLastError()# function to determine the failure mode.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if successful, FALSE if an error occurred. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>str</em> </td><td>String to write with end of line terminator. </td></tr></table></dl> </td> </tr></table><hr>The documentation for this class was generated from the following files:<ul><li><a class="el" href="textfile_8h-source.html">textfile.h</a><li><a class="el" href="osutil_8inl.html">osutil.inl</a></ul><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:20 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -