📄 sfile_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>sfile.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>sfile.h</h1><a href="sfile_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * sfile.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Structured file I/O channel 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: sfile.h,v $</span>00030 <span class="comment"> * Revision 1.19 2003/09/17 05:41:59 csoutheren</span>00031 <span class="comment"> * Removed recursive includes</span>00032 <span class="comment"> *</span>00033 <span class="comment"> * Revision 1.18 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.17 2002/09/16 01:08:59 robertj</span>00038 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00039 <span class="comment"> * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00040 <span class="comment"> *</span>00041 <span class="comment"> * Revision 1.16 2001/05/22 12:49:32 robertj</span>00042 <span class="comment"> * Did some seriously wierd rewrite of platform headers to eliminate the</span>00043 <span class="comment"> * stupid GNU compiler warning about braces not matching.</span>00044 <span class="comment"> *</span>00045 <span class="comment"> * Revision 1.15 1999/03/09 02:59:51 robertj</span>00046 <span class="comment"> * Changed comments to doc++ compatible documentation.</span>00047 <span class="comment"> *</span>00048 <span class="comment"> * Revision 1.14 1999/02/16 08:11:10 robertj</span>00049 <span class="comment"> * MSVC 6.0 compatibility changes.</span>00050 <span class="comment"> *</span>00051 <span class="comment"> * Revision 1.13 1998/09/24 07:24:01 robertj</span>00052 <span class="comment"> * Moved structured fiel into separate module so don't need silly implementation file for GNU C.</span>00053 <span class="comment"> *</span>00054 <span class="comment"> * Revision 1.12 1998/09/23 06:21:23 robertj</span>00055 <span class="comment"> * Added open source copyright license.</span>00056 <span class="comment"> *</span>00057 <span class="comment"> * Revision 1.11 1996/01/23 13:15:38 robertj</span>00058 <span class="comment"> * Mac Metrowerks compiler support.</span>00059 <span class="comment"> *</span>00060 <span class="comment"> * Revision 1.10 1995/06/17 11:13:19 robertj</span>00061 <span class="comment"> * Documentation update.</span>00062 <span class="comment"> *</span>00063 <span class="comment"> * Revision 1.9 1995/03/14 12:42:34 robertj</span>00064 <span class="comment"> * Updated documentation to use HTML codes.</span>00065 <span class="comment"> *</span>00066 <span class="comment"> * Revision 1.8 1995/01/14 06:19:39 robertj</span>00067 <span class="comment"> * Documentation</span>00068 <span class="comment"> *</span>00069 <span class="comment"> * Revision 1.7 1994/08/23 11:32:52 robertj</span>00070 <span class="comment"> * Oops</span>00071 <span class="comment"> *</span>00072 <span class="comment"> * Revision 1.6 1994/08/22 00:46:48 robertj</span>00073 <span class="comment"> * Added pragma fro GNU C++ compiler.</span>00074 <span class="comment"> *</span>00075 <span class="comment"> * Revision 1.5 1994/04/20 12:17:44 robertj</span>00076 <span class="comment"> * PFilePath split</span>00077 <span class="comment"> *</span>00078 <span class="comment"> * Revision 1.4 1994/01/03 04:42:23 robertj</span>00079 <span class="comment"> * Mass changes to common container classes and interactors etc etc etc.</span>00080 <span class="comment"> *</span>00081 <span class="comment"> * Revision 1.3 1993/08/21 01:50:33 robertj</span>00082 <span class="comment"> * Made Clone() function optional, default will assert if called.</span>00083 <span class="comment"> *</span>00084 <span class="comment"> * Revision 1.2 1993/07/14 12:49:16 robertj</span>00085 <span class="comment"> * Fixed RCS keywords.</span>00086 <span class="comment"> *</span>00087 <span class="comment"> */</span>00088 00089 <span class="preprocessor">#ifndef _PSTRUCTUREDFILE</span>00090 <span class="preprocessor"></span><span class="preprocessor">#define _PSTRUCTUREDFILE</span>00091 <span class="preprocessor"></span>00092 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00093 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00094 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00095 <span class="preprocessor"></span>00096 <a name="l00104"></a><a class="code" href="classPStructuredFile.html">00104</a> <span class="keyword">class </span><a class="code" href="classPStructuredFile.html">PStructuredFile</a> : <span class="keyword">public</span> <a class="code" href="classPFile.html">PFile</a>00105 {00106 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPStructuredFile.html">PStructuredFile</a>, <a class="code" href="classPFile.html">PFile</a>);00107 00108 <span class="keyword">private</span>:00109 BOOL <a class="code" href="classPStructuredFile.html#z359_0">Read</a>(<span class="keywordtype">void</span> * buf, PINDEX len) { <span class="keywordflow">return</span> <a class="code" href="classPFile.html#z129_1">PFile::Read</a>(buf, len); }00110 BOOL <a class="code" href="classPStructuredFile.html#z359_1">Write</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> * buf, PINDEX len) { <span class="keywordflow">return</span> <a class="code" href="classPFile.html#z129_2">PFile::Write</a>(buf, len); }00111 00112 <span class="keyword">public</span>:00122 <a class="code" href="classPStructuredFile.html#z357_0">PStructuredFile</a>();00123 00132 <a class="code" href="classPStructuredFile.html#z357_0">PStructuredFile</a>(00133 <a class="code" href="classPFile.html#z125_0">OpenMode</a> mode, 00134 <span class="keywordtype">int</span> opts = <a class="code" href="classPFile.html#z125_1s3">ModeDefault</a> 00135 );00136 00143 <a class="code" href="classPStructuredFile.html#z357_0">PStructuredFile</a>(00144 <span class="keyword">const</span> <a class="code" href="classPFilePath.html">PFilePath</a> & name, 00145 <a class="code" href="classPFile.html#z125_0">OpenMode</a> mode = <a class="code" href="classPFile.html#z125_0s2">ReadWrite</a>, 00146 <span class="keywordtype">int</span> opts = <a class="code" href="classPFile.html#z125_1s3">ModeDefault</a> 00147 );00149 00159 BOOL <a class="code" href="classPStructuredFile.html#z359_0">Read</a>(00160 <span class="keywordtype">void</span> * buffer 00161 );00162 00170 BOOL <a class="code" href="classPStructuredFile.html#z359_1">Write</a>(00171 <span class="keyword">const</span> <span class="keywordtype">void</span> * buffer 00172 );00174 <a name="l00182"></a><a class="code" href="classPStructuredFile.html#z361_1">00182</a> PINDEX <a class="code" href="classPStructuredFile.html#z361_1">GetStructureSize</a>() { <span class="keywordflow">return</span> <a class="code" href="classPStructuredFile.html#n0">structureSize</a>; }00183 <a name="l00185"></a><a class="code" href="classPStructuredFile.html#z361_0">00185</a> <span class="keyword">enum</span> <a class="code" href="classPStructuredFile.html#z361_0">ElementType</a> {00187 <a class="code" href="classPStructuredFile.html#z361_0s0">Character</a>, 00189 <a class="code" href="classPStructuredFile.html#z361_0s1">Integer16</a>, 00191 <a class="code" href="classPStructuredFile.html#z361_0s2">Integer32</a>, 00193 <a class="code" href="classPStructuredFile.html#z361_0s3">Integer64</a>, 00195 <a class="code" href="classPStructuredFile.html#z361_0s4">Float32</a>, 00197 <a class="code" href="classPStructuredFile.html#z361_0s5">Float64</a>, 00199 <a class="code" href="classPStructuredFile.html#z361_0s6">Float80</a>, 00200 <a class="code" href="classPStructuredFile.html#z361_0s7">NumElementTypes</a>00201 };00202 <a name="l00204"></a><a class="code" href="structPStructuredFile_1_1Element.html">00204</a> <span class="keyword">struct </span><a class="code" href="structPStructuredFile_1_1Element.html">Element</a> {<a name="l00206"></a><a class="code" href="structPStructuredFile_1_1Element.html#m0">00206</a> ElementType <a class="code" href="structPStructuredFile_1_1Element.html#m0">type</a>; <a name="l00208"></a><a class="code" href="structPStructuredFile_1_1Element.html#m1">00208</a> PINDEX <a class="code" href="structPStructuredFile_1_1Element.html#m1">count</a>; 00209 };00210 00212 <span class="keywordtype">void</span> <a class="code" href="classPStructuredFile.html#z361_2">SetStructure</a>(00213 Element * <a class="code" href="classPStructuredFile.html#n1">structure</a>, 00214 PINDEX <a class="code" href="classPStructuredFile.html#n2">numElements</a> 00215 );00217 00218 <span class="keyword">protected</span>:00219 <span class="comment">// Member variables</span><a name="l00221"></a><a class="code" href="classPStructuredFile.html#n0">00221</a> <span class="comment"> PINDEX structureSize;</span>00222 <a name="l00224"></a><a class="code" href="classPStructuredFile.html#n1">00224</a> <a class="code" href="structPStructuredFile_1_1Element.html">Element</a> * <a class="code" href="classPStructuredFile.html#n1">structure</a>;00225 <a name="l00227"></a><a class="code" href="classPStructuredFile.html#n2">00227</a> PINDEX <a class="code" href="classPStructuredFile.html#n2">numElements</a>;00228 00229 00230 <span class="comment">// Include platform dependent part of class</span>00231 <span class="preprocessor">#ifdef _WIN32</span>00232 <span class="preprocessor"></span><span class="preprocessor">#include "msos/ptlib/sfile.h"</span>00233 <span class="preprocessor">#else</span>00234 <span class="preprocessor"></span><span class="preprocessor">#include "unix/ptlib/sfile.h"</span>00235 <span class="preprocessor">#endif</span>00236 <span class="preprocessor"></span>};00237 00238 <span class="preprocessor">#endif</span>00239 <span class="preprocessor"></span>00240 <span class="comment">// End Of File ///////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:12 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 + -