📄 file_8h-source.html
字号:
00203 <a class="code" href="classPFile.html#z125_2">PFile</a>();00204 <a name="l00209"></a><a class="code" href="classPFile.html#z125_0">00209</a> <span class="keyword">enum</span> <a class="code" href="classPFile.html#z125_0">OpenMode</a> {00211 <a class="code" href="classPFile.html#z125_0s0">ReadOnly</a>,00213 <a class="code" href="classPFile.html#z125_0s1">WriteOnly</a>,00215 <a class="code" href="classPFile.html#z125_0s2">ReadWrite</a>00216 };00217 <a name="l00233"></a><a class="code" href="classPFile.html#z125_1">00233</a> <span class="keyword">enum</span> <a class="code" href="classPFile.html#z125_1">OpenOptions</a> {00235 <a class="code" href="classPFile.html#z125_1s3">ModeDefault</a> = -1, 00237 <a class="code" href="classPFile.html#z125_1s4">MustExist</a> = 0, 00239 <a class="code" href="classPFile.html#z125_1s5">Create</a> = 1, 00241 <a class="code" href="classPFile.html#z125_1s6">Truncate</a> = 2, 00243 <a class="code" href="classPFile.html#z125_1s7">Exclusive</a> = 4, 00245 <a class="code" href="classPFile.html#z125_1s8">Temporary</a> = 8,00247 <a class="code" href="classPFile.html#z125_1s9">DenySharedRead</a> = 16,00249 <a class="code" href="classPFile.html#z125_1s10">DenySharedWrite</a> = 3200250 };00251 00260 <a class="code" href="classPFile.html#z125_2">PFile</a>(00261 <a class="code" href="classPFile.html#z125_0">OpenMode</a> mode, 00262 <span class="keywordtype">int</span> opts = <a class="code" href="classPFile.html#z125_1s3">ModeDefault</a> 00263 );00264 00271 <a class="code" href="classPFile.html#z125_2">PFile</a>(00272 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & name, 00273 <a class="code" href="classPFile.html#z125_0">OpenMode</a> mode = <a class="code" href="classPFile.html#z125_0s2">ReadWrite</a>, 00274 <span class="keywordtype">int</span> opts = <a class="code" href="classPFile.html#z125_1s3">ModeDefault</a> 00275 );00276 00278 <a class="code" href="classPFile.html#z125_5">~PFile</a>();00280 00281 00290 <a class="code" href="classPObject.html#z199_0">Comparison</a> <a class="code" href="classPFile.html#z127_0">Compare</a>(00291 <span class="keyword">const</span> <a class="code" href="classPObject.html">PObject</a> & obj 00292 ) <span class="keyword">const</span>;00294 00295 00304 <span class="keyword">virtual</span> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPFile.html#z129_0">GetName</a>() <span class="keyword">const</span>;00305 00317 <span class="keyword">virtual</span> BOOL <a class="code" href="classPFile.html#z129_1">Read</a>(00318 <span class="keywordtype">void</span> * buf, 00319 PINDEX len 00320 );00321 00331 <span class="keyword">virtual</span> BOOL <a class="code" href="classPFile.html#z129_2">Write</a>(00332 <span class="keyword">const</span> <span class="keywordtype">void</span> * buf, 00333 PINDEX len 00334 );00335 00339 <span class="keyword">virtual</span> BOOL <a class="code" href="classPFile.html#z129_3">Close</a>();00341 00342 00352 <span class="keyword">static</span> BOOL <a class="code" href="classPFile.html#z131_0">Exists</a>(00353 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & name 00354 );00355 00363 BOOL <a class="code" href="classPFile.html#z131_0">Exists</a>() <span class="keyword">const</span>;00364 00374 <span class="keyword">static</span> BOOL <a class="code" href="classPFile.html#z131_7">Access</a>(00375 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & name, 00376 <a class="code" href="classPFile.html#z125_0">OpenMode</a> mode 00377 );00378 00389 BOOL <a class="code" href="classPFile.html#z131_7">Access</a>(00390 <a class="code" href="classPFile.html#z125_0">OpenMode</a> mode 00391 );00392 00405 <span class="keyword">static</span> BOOL <a class="code" href="classPFile.html#z131_8">Remove</a>(00406 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & name, <span class="comment">// Name of file to delete.</span>00407 BOOL force = FALSE <span class="comment">// Force deletion even if file is protected.</span>00408 );00409 00422 BOOL <a class="code" href="classPFile.html#z131_8">Remove</a>(00423 BOOL force = FALSE <span class="comment">// Force deletion even if file is protected.</span>00424 );00425 00441 <span class="keyword">static</span> BOOL <a class="code" href="classPFile.html#z131_9">Rename</a>(00442 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & oldname, 00443 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & newname, 00444 BOOL force = FALSE00446 );00447 00464 BOOL <a class="code" href="classPFile.html#z131_9">Rename</a>(00465 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & newname, 00466 BOOL force = FALSE00468 );00469 00475 <span class="keyword">static</span> BOOL <a class="code" href="classPFile.html#z131_10">Copy</a>(00476 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & oldname, 00477 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & newname, 00478 BOOL force = FALSE00480 );00481 00487 BOOL <a class="code" href="classPFile.html#z131_10">Copy</a>(00488 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & newname, 00489 BOOL force = FALSE00491 );00492 00502 <span class="keyword">static</span> BOOL <a class="code" href="classPFile.html#z131_11">Move</a>(00503 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & oldname, 00504 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & newname, 00505 BOOL force = FALSE00507 );00508 00518 BOOL <a class="code" href="classPFile.html#z131_11">Move</a>(00519 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & newname, 00520 BOOL force = FALSE00522 );00524 00533 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & <a class="code" href="classPFile.html#z133_1">GetFilePath</a>() <span class="keyword">const</span>;00534 00538 <span class="keywordtype">void</span> <a class="code" href="classPFile.html#z133_2">SetFilePath</a>(00539 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPFile.html#n0">path</a> 00540 );00541 00542 00554 <span class="keyword">virtual</span> BOOL <a class="code" href="classPFile.html#z133_3">Open</a>(00555 <a class="code" href="classPFile.html#z125_0">OpenMode</a> mode = <a class="code" href="classPFile.html#z125_0s2">ReadWrite</a>, <span class="comment">// Mode in which to open the file.</span>00556 <span class="keywordtype">int</span> opts = <a class="code" href="classPFile.html#z125_1s3">ModeDefault</a> <span class="comment">// Options for open operation.</span>00557 );00558 00569 <span class="keyword">virtual</span> BOOL <a class="code" href="classPFile.html#z133_3">Open</a>(00570 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & name, <span class="comment">// Name of file to open.</span>00571 <a class="code" href="classPFile.html#z125_0">OpenMode</a> mode = <a class="code" href="classPFile.html#z125_0s2">ReadWrite</a>, <span class="comment">// Mode in which to open the file.</span>00572 <span class="keywordtype">int</span> opts = <a class="code" href="classPFile.html#z125_1s3">ModeDefault</a> <span class="comment">// #OpenOptions enum# for open operation.</span>00573 );00574 00580 <span class="keyword">virtual</span> off_t <a class="code" href="classPFile.html#z133_5">GetLength</a>() <span class="keyword">const</span>;00581 00588 <span class="keyword">virtual</span> BOOL <a class="code" href="classPFile.html#z133_6">SetLength</a>(00589 off_t len <span class="comment">// New length of file.</span>00590 );00591 <a name="l00593"></a><a class="code" href="classPFile.html#z133_0">00593</a> <span class="keyword">enum</span> <a class="code" href="classPFile.html#z133_0">FilePositionOrigin</a> {00595 <a class="code" href="classPFile.html#z133_0s11">Start</a> = SEEK_SET, 00597 <a class="code" href="classPFile.html#z133_0s12">Current</a> = SEEK_CUR, 00599 <a class="code" href="classPFile.html#z133_0s13">End</a> = SEEK_END 00600 };00601 00612 <span class="keyword">virtual</span> BOOL <a class="code" href="classPFile.html#z133_7">SetPosition</a>(00613 off_t pos, 00614 <a class="code" href="classPFile.html#z133_0">FilePositionOrigin</a> origin = <a class="code" href="classPFile.html#z133_0s11">Start</a> 00615 );00616 00623 <span class="keyword">virtual</span> off_t <a class="code" href="classPFile.html#z133_8">GetPosition</a>() <span class="keyword">const</span>;00624 00631 BOOL <a class="code" href="classPFile.html#z133_9">IsEndOfFile</a>() <span class="keyword">const</span>;00632 00638 <span class="keyword">static</span> BOOL <a class="code" href="classPFile.html#z133_12">GetInfo</a>(00639 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & name, <span class="comment">// Name of file to get the information on.</span>00640 <a class="code" href="classPFileInfo.html">PFileInfo</a> & info00641 <span class="comment">// #PFileInfo# structure to receive the information.</span>00642 );00643 00649 BOOL <a class="code" href="classPFile.html#z133_12">GetInfo</a>(00650 <a class="code" href="classPFileInfo.html">PFileInfo</a> & info00651 <span class="comment">// #PFileInfo# structure to receive the information.</span>00652 );00653 00659 <span class="keyword">static</span> BOOL <a class="code" href="classPFile.html#z133_13">SetPermissions</a>(00660 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & name, <span class="comment">// Name of file to change the permission of.</span>00661 <span class="keywordtype">int</span> permissions <span class="comment">// New permissions mask for the file.</span>00662 );00668 BOOL <a class="code" href="classPFile.html#z133_13">SetPermissions</a>(00669 <span class="keywordtype">int</span> permissions <span class="comment">// New permissions mask for the file.</span>00670 );00672 00673 <span class="keyword">protected</span>:00674 <span class="comment">// Member variables</span><a name="l00676"></a><a class="code" href="classPFile.html#n0">00676</a> <span class="comment"> PFilePath path;</span>00677 <a name="l00679"></a><a class="code" href="classPFile.html#n1">00679</a> BOOL <a class="code" href="classPFile.html#n1">removeOnClose</a>;00680 00681 00682 <span class="comment">// Include platform dependent part of class</span>00683 <span class="preprocessor">#ifdef _WIN32</span>00684 <span class="preprocessor"></span><span class="preprocessor">#include "msos/ptlib/file.h"</span>00685 <span class="preprocessor">#else</span>00686 <span class="preprocessor"></span><span class="preprocessor">#include "unix/ptlib/file.h"</span>00687 <span class="preprocessor">#endif</span>00688 <span class="preprocessor"></span>};00689 00690 <span class="preprocessor">#endif</span>00691 <span class="preprocessor"></span>00692 <span class="comment">// End Of File ///////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:10 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 + -