📄 filepath_8h-source.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>filepath.h Source File</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>filepath.h</h1><a href="filepath_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * filepath.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * File system path string abstraction class.</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (c) 1993-1998 Equivalence Pty. Ltd.</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is Equivalence Pty. Ltd.</span>00023 <span class="comment"> *</span>00024 <span class="comment"> * Portions are Copyright (C) 1993 Free Software Foundation, Inc.</span>00025 <span class="comment"> * All Rights Reserved.</span>00026 <span class="comment"> *</span>00027 <span class="comment"> * Contributor(s): ______________________________________.</span>00028 <span class="comment"> *</span>00029 <span class="comment"> * $Log: filepath.h,v $</span>00030 <span class="comment"> * Revision 1.21 2003/09/17 05:41:58 csoutheren</span>00031 <span class="comment"> * Removed recursive includes</span>00032 <span class="comment"> *</span>00033 <span class="comment"> * Revision 1.20 2003/09/17 01:18:02 csoutheren</span>00034 <span class="comment"> * Removed recursive include file system and removed all references</span>00035 <span class="comment"> * to deprecated coooperative threading support</span>00036 <span class="comment"> *</span>00037 <span class="comment"> * Revision 1.19 2002/11/19 10:32:26 robertj</span>00038 <span class="comment"> * Changed PFilePath so can be empty string, indicating illegal path.</span>00039 <span class="comment"> *</span>00040 <span class="comment"> * Revision 1.18 2002/09/16 01:08:59 robertj</span>00041 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00042 <span class="comment"> * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00043 <span class="comment"> *</span>00044 <span class="comment"> * Revision 1.17 2001/05/22 12:49:32 robertj</span>00045 <span class="comment"> * Did some seriously wierd rewrite of platform headers to eliminate the</span>00046 <span class="comment"> * stupid GNU compiler warning about braces not matching.</span>00047 <span class="comment"> *</span>00048 <span class="comment"> * Revision 1.16 2001/02/13 04:39:08 robertj</span>00049 <span class="comment"> * Fixed problem with operator= in container classes. Some containers will</span>00050 <span class="comment"> * break unless the copy is virtual (eg PStringStream's buffer pointers) so</span>00051 <span class="comment"> * needed to add a new AssignContents() function to all containers.</span>00052 <span class="comment"> *</span>00053 <span class="comment"> * Revision 1.15 1999/03/09 02:59:49 robertj</span>00054 <span class="comment"> * Changed comments to doc++ compatible documentation.</span>00055 <span class="comment"> *</span>00056 <span class="comment"> * Revision 1.14 1999/02/16 08:07:11 robertj</span>00057 <span class="comment"> * MSVC 6.0 compatibility changes.</span>00058 <span class="comment"> *</span>00059 <span class="comment"> * Revision 1.13 1998/11/30 08:57:16 robertj</span>00060 <span class="comment"> * Fixed problem where if += is used on PFilePath, it no longer may be normalised.</span>00061 <span class="comment"> *</span>00062 <span class="comment"> * Revision 1.12 1998/09/23 06:20:37 robertj</span>00063 <span class="comment"> * Added open source copyright license.</span>00064 <span class="comment"> *</span>00065 <span class="comment"> * Revision 1.11 1998/02/16 00:14:57 robertj</span>00066 <span class="comment"> * Added functions to validate characters in a filename.</span>00067 <span class="comment"> *</span>00068 <span class="comment"> * Revision 1.10 1995/07/31 12:03:37 robertj</span>00069 <span class="comment"> * Added copy constructor and assignment operator for right types.</span>00070 <span class="comment"> *</span>00071 <span class="comment"> * Revision 1.9 1995/04/22 00:43:43 robertj</span>00072 <span class="comment"> * Added Move() function and changed semantics of Rename().</span>00073 <span class="comment"> * Changed all file name strings to PFilePath objects.</span>00074 <span class="comment"> *</span>00075 <span class="comment"> * Revision 1.8 1995/03/14 12:41:25 robertj</span>00076 <span class="comment"> * Updated documentation to use HTML codes.</span>00077 <span class="comment"> *</span>00078 <span class="comment"> * Revision 1.7 1994/12/21 11:52:57 robertj</span>00079 <span class="comment"> * Documentation and variable normalisation.</span>00080 <span class="comment"> *</span>00081 <span class="comment"> * Revision 1.6 1994/10/24 00:06:58 robertj</span>00082 <span class="comment"> * Changed PFilePath and PDirectory so descends from either PString or</span>00083 <span class="comment"> * PCaselessString depending on the platform.</span>00084 <span class="comment"> *</span>00085 <span class="comment"> * Revision 1.5 1994/08/23 11:32:52 robertj</span>00086 <span class="comment"> * Oops</span>00087 <span class="comment"> *</span>00088 <span class="comment"> * Revision 1.4 1994/08/22 00:46:48 robertj</span>00089 <span class="comment"> * Added pragma fro GNU C++ compiler.</span>00090 <span class="comment"> *</span>00091 <span class="comment"> * Revision 1.3 1994/08/21 23:43:02 robertj</span>00092 <span class="comment"> * Changed parameter before variable argument list to NOT be a reference.</span>00093 <span class="comment"> *</span>00094 <span class="comment"> * Revision 1.2 1994/06/25 11:55:15 robertj</span>00095 <span class="comment"> * Unix version synchronisation.</span>00096 <span class="comment"> *</span>00097 <span class="comment"> * Revision 1.1 1994/04/20 12:17:44 robertj</span>00098 <span class="comment"> * Initial revision</span>00099 <span class="comment"> *</span>00100 <span class="comment"> */</span>00101 00102 <span class="preprocessor">#ifndef _PFILEPATH</span>00103 <span class="preprocessor"></span><span class="preprocessor">#define _PFILEPATH</span>00104 <span class="preprocessor"></span>00105 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00106 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00107 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00108 <span class="preprocessor"></span>00109 00110 <span class="preprocessor">#ifdef DOC_PLUS_PLUS</span>00111 <span class="preprocessor"></span><a name="l00116"></a><a class="code" href="classPFilePathString.html">00116</a> <span class="keyword">class </span><a class="code" href="classPString.html">PFilePathString</a> : <span class="keyword">public</span> <a class="code" href="classPString.html">PString</a> { };00117 <span class="preprocessor">#endif</span>00118 <span class="preprocessor"></span>00119 00121 <span class="comment">// File Specification</span>00122 <a name="l00133"></a><a class="code" href="classPFilePath.html">00133</a> <span class="keyword">class </span><a class="code" href="classPFilePath.html">PFilePath</a> : <span class="keyword">public</span> <a class="code" href="classPString.html">PFilePathString</a>00134 {00135 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPFilePath.html">PFilePath</a>, <a class="code" href="classPString.html">PFilePathString</a>);00136 00137 <span class="keyword">public</span>:00142 <a class="code" href="classPFilePath.html#z135_0">PFilePath</a>();00143 00154 <a class="code" href="classPFilePath.html#z135_0">PFilePath</a>(00155 <span class="keyword">const</span> <span class="keywordtype">char</span> * cstr 00156 );00157 00168 <a class="code" href="classPFilePath.html#z135_0">PFilePath</a>(00169 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & str 00170 );00171 00174 <a class="code" href="classPFilePath.html#z135_0">PFilePath</a>(00175 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & path 00176 );00177 00183 <a class="code" href="classPFilePath.html#z135_0">PFilePath</a>(00184 <span class="keyword">const</span> <span class="keywordtype">char</span> * prefix, 00185 <span class="keyword">const</span> <span class="keywordtype">char</span> * dir 00186 );00187 00190 <a class="code" href="classPFilePath.html">PFilePath</a> & <a class="code" href="classPFilePath.html#z135_5">operator=</a>(00191 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & path 00192 );00203 <a class="code" href="classPFilePath.html">PFilePath</a> & <a class="code" href="classPFilePath.html#z135_5">operator=</a>(00204 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & str 00205 );00216 <a class="code" href="classPFilePath.html">PFilePath</a> & <a class="code" href="classPFilePath.html#z135_5">operator=</a>(00217 <span class="keyword">const</span> <span class="keywordtype">char</span> * cstr 00218 );00220 00228 <a class="code" href="classPFilePath.html">PFilePath</a> & <a class="code" href="classPFilePath.html#z137_0">operator+=</a>(00229 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & str 00230 );00231 00241 <a class="code" href="classPFilePath.html">PFilePath</a> & <a class="code" href="classPFilePath.html#z137_0">operator+=</a>(00242 <span class="keyword">const</span> <span class="keywordtype">char</span> * cstr 00243 );00244 00254 <a class="code" href="classPFilePath.html">PFilePath</a> & <a class="code" href="classPFilePath.html#z137_0">operator+=</a>(00255 <span class="keywordtype">char</span> ch <span class="comment">// Character to concatenate.</span>00256 );00258 00269 <a class="code" href="classPString.html">PFilePathString</a> <a class="code" href="classPFilePath.html#z139_0">GetVolume</a>() <span class="keyword">const</span>;00270 00279 <a class="code" href="classPString.html">PFilePathString</a> <a class="code" href="classPFilePath.html#z139_1">GetPath</a>() <span class="keyword">const</span>;00280 00287 <a class="code" href="classPString.html">PFilePathString</a> <a class="code" href="classPFilePath.html#z139_2">GetTitle</a>() <span class="keyword">const</span>;00288 00300 <a class="code" href="classPString.html">PFilePathString</a> <a class="code" href="classPFilePath.html#z139_3">GetType</a>() <span class="keyword">const</span>;00301 00311 <a class="code" href="classPString.html">PFilePathString</a> <a class="code" href="classPFilePath.html#z139_4">GetFileName</a>() <span class="keyword">const</span>;00312 00325 <a class="code" href="classPDirectory.html">PDirectory</a> <a class="code" href="classPFilePath.html#z139_5">GetDirectory</a>() <span class="keyword">const</span>;00326 00330 <span class="keywordtype">void</span> <a class="code" href="classPFilePath.html#z139_6">SetType</a>(00331 <span class="keyword">const</span> <a class="code" href="classPString.html">PFilePathString</a> & type 00332 );00334 00342 <span class="keyword">static</span> BOOL <a class="code" href="classPFilePath.html#z141_0">IsValid</a>(00343 <span class="keywordtype">char</span> c 00344 );00345 00351 <span class="keyword">static</span> BOOL <a class="code" href="classPFilePath.html#z141_0">IsValid</a>(00352 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & str 00353 );00355 00356 00357 <span class="keyword">protected</span>:00358 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPFilePath.html#b0">AssignContents</a>(<span class="keyword">const</span> <a class="code" href="classPContainer.html">PContainer</a> & cont);00359 00360 00361 <span class="comment">// Include platform dependent part of class</span>00362 <span class="preprocessor">#ifdef _WIN32</span>00363 <span class="preprocessor"></span><span class="preprocessor">#include "msos/ptlib/filepath.h"</span>00364 <span class="preprocessor">#else</span>00365 <span class="preprocessor"></span><span class="preprocessor">#include "unix/ptlib/filepath.h"</span>00366 <span class="preprocessor">#endif</span>00367 <span class="preprocessor"></span>};00368 00369 <span class="preprocessor">#endif</span>00370 <span class="preprocessor"></span>00371 <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 + -