Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > 64656f00434e190abe8506174ca339ed > files > 763

ucommon-doc-4.3.1-1.mga1.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>ucommon: ucommon/stream.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ucommon</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00198.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<h1>ucommon/stream.h</h1>  </div>
</div>
<div class="contents">
<a href="a00198.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2006-2010 David Sugar, Tycho Softworks.</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// This file is part of GNU uCommon C++.</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005 <span class="comment">// GNU uCommon C++ is free software: you can redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment">// it under the terms of the GNU Lesser General Public License as published</span>
<a name="l00007"></a>00007 <span class="comment">// by the Free Software Foundation, either version 3 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">// (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment">//</span>
<a name="l00010"></a>00010 <span class="comment">// GNU uCommon C++ is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment">// GNU Lesser General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015 <span class="comment">// You should have received a copy of the GNU Lesser General Public License</span>
<a name="l00016"></a>00016 <span class="comment">// along with GNU uCommon C++.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00017"></a>00017 
<a name="l00024"></a>00024 <span class="preprocessor">#if defined(OLD_STDCPP) || defined(NEW_STDCPP)</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#ifndef _UCOMMON_STREAM_H_</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define _UCOMMON_STREAM_H_</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="preprocessor">#ifndef _UCOMMON_CONFIG_H</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#include &lt;ucommon/platform.h&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#endif</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a>00032 <span class="preprocessor">#ifndef _UCOMMON_PROTOCOLS_H_</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#include &lt;ucommon/protocols.h&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#endif</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00036"></a>00036 <span class="preprocessor">#ifndef _UCOMMON_THREAD_H_</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#include &lt;ucommon/thread.h&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#endif</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="preprocessor">#ifndef _UCOMMON_SOCKET_H_</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#include &lt;ucommon/socket.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#endif</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span>
<a name="l00044"></a>00044 <span class="preprocessor">#ifndef _UCOMMON_FSYS_H_</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#include &lt;ucommon/fsys.h&gt;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#endif</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00049"></a>00049 
<a name="l00050"></a>00050 NAMESPACE_UCOMMON
<a name="l00051"></a>00051 
<a name="l00058"></a><a class="code" href="a00149.html">00058</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00149.html" title="Common stream protocol for std C++ i/o classes.">StreamProtocol</a> : <span class="keyword">protected</span> std::streambuf, <span class="keyword">public</span> std::iostream, <span class="keyword">public</span> <a class="code" href="a00028.html" title="Common character processing protocol.">CharacterProtocol</a>
<a name="l00059"></a>00059 {
<a name="l00060"></a>00060 <span class="keyword">protected</span>:
<a name="l00061"></a>00061     <span class="keywordtype">size_t</span> bufsize;
<a name="l00062"></a>00062     <span class="keywordtype">char</span> *gbuf, *pbuf;
<a name="l00063"></a>00063 
<a name="l00064"></a>00064     <a class="code" href="a00149.html" title="Common stream protocol for std C++ i/o classes.">StreamProtocol</a>();
<a name="l00065"></a>00065 
<a name="l00066"></a>00066     <span class="keywordtype">int</span> underflow();
<a name="l00067"></a>00067 
<a name="l00068"></a>00068     <span class="keywordtype">int</span> overflow(<span class="keywordtype">int</span> code);
<a name="l00069"></a>00069 
<a name="l00078"></a>00078     <span class="keywordtype">int</span> uflow();
<a name="l00079"></a>00079 
<a name="l00080"></a>00080     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00081"></a>00081 
<a name="l00082"></a>00082     <span class="keywordtype">void</span> allocate(<span class="keywordtype">size_t</span> size);
<a name="l00083"></a>00083 
<a name="l00084"></a>00084 <span class="keyword">public</span>:
<a name="l00089"></a>00089     <span class="keywordtype">int</span> sync(<span class="keywordtype">void</span>);
<a name="l00090"></a>00090 
<a name="l00091"></a>00091     <span class="keyword">inline</span> <span class="keywordtype">bool</span> is_open(<span class="keywordtype">void</span>)
<a name="l00092"></a>00092         {<span class="keywordflow">return</span> bufsize &gt; 0;}
<a name="l00093"></a>00093 
<a name="l00094"></a>00094     <span class="keyword">inline</span> operator bool()
<a name="l00095"></a>00095         {<span class="keywordflow">return</span> bufsize &gt; 0;}
<a name="l00096"></a>00096 
<a name="l00097"></a>00097     <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator!()
<a name="l00098"></a>00098         {<span class="keywordflow">return</span> bufsize == 0;}
<a name="l00099"></a>00099 };
<a name="l00100"></a>00100 
<a name="l00109"></a><a class="code" href="a00155.html">00109</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00155.html" title="Streamable tcp connection between client and server.">tcpstream</a> : <span class="keyword">public</span> <a class="code" href="a00149.html" title="Common stream protocol for std C++ i/o classes.">StreamProtocol</a>
<a name="l00110"></a>00110 {
<a name="l00111"></a>00111 <span class="keyword">private</span>:
<a name="l00112"></a>00112     __LOCAL <span class="keywordtype">void</span> allocate(<span class="keywordtype">unsigned</span> size);
<a name="l00113"></a>00113     __LOCAL <span class="keywordtype">void</span> reset(<span class="keywordtype">void</span>);
<a name="l00114"></a>00114 
<a name="l00115"></a>00115 <span class="keyword">protected</span>:
<a name="l00116"></a>00116     socket_t so;
<a name="l00117"></a>00117     <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout;
<a name="l00118"></a>00118 
<a name="l00119"></a>00119     <span class="keyword">virtual</span> ssize_t _read(<span class="keywordtype">char</span> *buffer, <span class="keywordtype">size_t</span> size);
<a name="l00120"></a>00120 
<a name="l00121"></a>00121     <span class="keyword">virtual</span> ssize_t _write(<span class="keyword">const</span> <span class="keywordtype">char</span> *buffer, <span class="keywordtype">size_t</span> size);
<a name="l00122"></a>00122 
<a name="l00123"></a>00123     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> _wait(<span class="keywordtype">void</span>);
<a name="l00124"></a>00124 
<a name="l00128"></a>00128     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00129"></a>00129 
<a name="l00136"></a>00136     <span class="keywordtype">int</span> <a class="code" href="a00028.html#a1661df12a156024ca6568971e50d001a" title="Get the next character.">_getch</a>(<span class="keywordtype">void</span>);
<a name="l00137"></a>00137 
<a name="l00144"></a>00144     <span class="keywordtype">int</span> <a class="code" href="a00028.html#a3c0bf7b330cf8c090ae07f657ee10b43" title="Put the next character.">_putch</a>(<span class="keywordtype">int</span> ch);
<a name="l00145"></a>00145 
<a name="l00146"></a>00146     <span class="keyword">inline</span> socket_t getsocket(<span class="keywordtype">void</span>)<span class="keyword"> const</span>
<a name="l00147"></a>00147 <span class="keyword">        </span>{<span class="keywordflow">return</span> so;}
<a name="l00148"></a>00148 
<a name="l00149"></a>00149 <span class="keyword">public</span>:
<a name="l00154"></a>00154     <a class="code" href="a00155.html" title="Streamable tcp connection between client and server.">tcpstream</a>(<span class="keyword">const</span> <a class="code" href="a00155.html" title="Streamable tcp connection between client and server.">tcpstream</a>&amp; <a class="code" href="a00191.html#ad2ae27334723e41f9cfa1c2b341591ac" title="Convenience function to access object copy.">copy</a>);
<a name="l00155"></a>00155 
<a name="l00162"></a>00162     <a class="code" href="a00155.html" title="Streamable tcp connection between client and server.">tcpstream</a>(<span class="keyword">const</span> <a class="code" href="a00154.html" title="A generic tcp server class.">TCPServer</a> *server, <span class="keywordtype">unsigned</span> segsize = 536, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = 0);
<a name="l00163"></a>00163 
<a name="l00169"></a>00169     <a class="code" href="a00155.html" title="Streamable tcp connection between client and server.">tcpstream</a>(<span class="keywordtype">int</span> family = PF_INET, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = 0);
<a name="l00170"></a>00170 
<a name="l00179"></a>00179     <a class="code" href="a00155.html" title="Streamable tcp connection between client and server.">tcpstream</a>(<a class="code" href="a00143.html" title="A generic socket address class.">Socket::address</a>&amp; address, <span class="keywordtype">unsigned</span> segsize = 536, <a class="code" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout = 0);
<a name="l00180"></a>00180 
<a name="l00184"></a>00184     <span class="keyword">virtual</span> ~<a class="code" href="a00155.html" title="Streamable tcp connection between client and server.">tcpstream</a>();
<a name="l00185"></a>00185 
<a name="l00190"></a><a class="code" href="a00155.html#ac09fb5c8c889a1ca6cc41f34d12e4bd2">00190</a>     <span class="keyword">inline</span> operator bool()<span class="keyword"> const</span>
<a name="l00191"></a>00191 <span class="keyword">        </span>{<span class="keywordflow">return</span> so != INVALID_SOCKET &amp;&amp; bufsize &gt; 0;};
<a name="l00192"></a>00192 
<a name="l00197"></a><a class="code" href="a00155.html#a2a56a41c6a0258ec134a2be3acf716ba">00197</a>     <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator!()<span class="keyword"> const</span>
<a name="l00198"></a>00198 <span class="keyword">        </span>{<span class="keywordflow">return</span> so == INVALID_SOCKET || bufsize == 0;};
<a name="l00199"></a>00199 
<a name="l00205"></a>00205     <span class="keywordtype">void</span> open(<a class="code" href="a00143.html" title="A generic socket address class.">Socket::address</a>&amp; address, <span class="keywordtype">unsigned</span> segment = 536);
<a name="l00206"></a>00206 
<a name="l00213"></a>00213     <span class="keywordtype">void</span> open(<span class="keyword">const</span> <span class="keywordtype">char</span> *host, <span class="keyword">const</span> <span class="keywordtype">char</span> *service, <span class="keywordtype">unsigned</span> segment = 536);
<a name="l00214"></a>00214 
<a name="l00219"></a>00219     <span class="keywordtype">void</span> close(<span class="keywordtype">void</span>);
<a name="l00220"></a>00220 };
<a name="l00221"></a>00221 
<a name="l00230"></a><a class="code" href="a00107.html">00230</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00107.html" title="Streamable tcp connection between client and server.">pipestream</a> : <span class="keyword">public</span> <a class="code" href="a00149.html" title="Common stream protocol for std C++ i/o classes.">StreamProtocol</a>
<a name="l00231"></a>00231 {
<a name="l00232"></a>00232 <span class="keyword">public</span>:
<a name="l00233"></a>00233     <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00234"></a>00234         RDONLY,
<a name="l00235"></a>00235         WRONLY,
<a name="l00236"></a>00236         RDWR
<a name="l00237"></a>00237     } access_t;
<a name="l00238"></a>00238 
<a name="l00239"></a>00239 <span class="keyword">private</span>:
<a name="l00240"></a>00240     __LOCAL <span class="keywordtype">void</span> allocate(<span class="keywordtype">size_t</span> size, access_t mode);
<a name="l00241"></a>00241 
<a name="l00242"></a>00242 <span class="keyword">protected</span>:
<a name="l00243"></a>00243     <a class="code" href="a00050.html" title="A container for generic and o/s portable threadsafe file system functions.">fsys_t</a> rd, wr;
<a name="l00244"></a>00244     pid_t pid;
<a name="l00245"></a>00245 
<a name="l00249"></a>00249     <span class="keywordtype">void</span> <a class="code" href="a00176.html#adc60e12f44fcd76b53cda844f8aa8e81" title="Convenience function to unlock shared object through it&amp;#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00250"></a>00250 
<a name="l00257"></a>00257     <span class="keywordtype">int</span> <a class="code" href="a00028.html#a1661df12a156024ca6568971e50d001a" title="Get the next character.">_getch</a>(<span class="keywordtype">void</span>);
<a name="l00258"></a>00258 
<a name="l00266"></a>00266     <span class="keywordtype">int</span> <a class="code" href="a00028.html#a3c0bf7b330cf8c090ae07f657ee10b43" title="Put the next character.">_putch</a>(<span class="keywordtype">int</span> ch);
<a name="l00267"></a>00267 
<a name="l00268"></a>00268 <span class="keyword">public</span>:
<a name="l00272"></a>00272     <a class="code" href="a00107.html" title="Streamable tcp connection between client and server.">pipestream</a>();
<a name="l00273"></a>00273 
<a name="l00281"></a>00281     <a class="code" href="a00107.html" title="Streamable tcp connection between client and server.">pipestream</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *command, access_t <a class="code" href="a00176.html#af11d6983ce975637031c6eaa0b8cf621" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>, <span class="keyword">const</span> <span class="keywordtype">char</span> **env = NULL, <span class="keywordtype">size_t</span> size = 512);
<a name="l00282"></a>00282 
<a name="l00286"></a>00286     <span class="keyword">virtual</span> ~<a class="code" href="a00107.html" title="Streamable tcp connection between client and server.">pipestream</a>();
<a name="l00287"></a>00287 
<a name="l00292"></a><a class="code" href="a00107.html#a21fa0e9e97874b741a480fde83dbe253">00292</a>     <span class="keyword">inline</span> operator bool()<span class="keyword"> const</span>
<a name="l00293"></a>00293 <span class="keyword">        </span>{<span class="keywordflow">return</span> (bufsize &gt; 0);};
<a name="l00294"></a>00294 
<a name="l00299"></a><a class="code" href="a00107.html#abf864cd66d16e530dea42ef888cee850">00299</a>     <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator!()<span class="keyword"> const</span>
<a name="l00300"></a>00300 <span class="keyword">        </span>{<span class="keywordflow">return</span> bufsize == 0;};
<a name="l00301"></a>00301 
<a name="l00309"></a>00309     <span class="keywordtype">void</span> open(<span class="keyword">const</span> <span class="keywordtype">char</span> *command, access_t access, <span class="keyword">const</span> <span class="keywordtype">char</span> **env = NULL, <span class="keywordtype">size_t</span> buffering = 512);
<a name="l00310"></a>00310 
<a name="l00315"></a>00315     <span class="keywordtype">void</span> close(<span class="keywordtype">void</span>);
<a name="l00316"></a>00316 
<a name="l00320"></a>00320     <span class="keywordtype">void</span> terminate(<span class="keywordtype">void</span>);
<a name="l00321"></a>00321 };
<a name="l00322"></a>00322 
<a name="l00331"></a><a class="code" href="a00049.html">00331</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00049.html" title="Streamable tcp connection between client and server.">filestream</a> : <span class="keyword">public</span> <a class="code" href="a00149.html" title="Common stream protocol for std C++ i/o classes.">StreamProtocol</a>
<a name="l00332"></a>00332 {
<a name="l00333"></a>00333 <span class="keyword">public</span>:
<a name="l00334"></a>00334     <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00335"></a>00335         RDONLY,
<a name="l00336"></a>00336         WRONLY,
<a name="l00337"></a>00337         RDWR
<a name="l00338"></a>00338     } access_t;
<a name="l00339"></a>00339 
<a name="l00340"></a>00340 <span class="keyword">private</span>:
<a name="l00341"></a>00341     __LOCAL <span class="keywordtype">void</span> allocate(<span class="keywordtype">size_t</span> size, <a class="code" href="a00050.html#a8e5c4bcc76ebe5c9b10f79f1999b0a75" title="Enumerated file access modes.">fsys::access_t</a> mode);
<a name="l00342"></a>00342 
<a name="l00343"></a>00343 <span class="keyword">protected</span>:
<a name="l00344"></a>00344     <a class="code" href="a00050.html" title="A container for generic and o/s portable threadsafe file system functions.">fsys_t</a> fd;
<a name="l00345"></a>00345     <a class="code" href="a00050.html#a8e5c4bcc76ebe5c9b10f79f1999b0a75" title="Enumerated file access modes.">fsys::access_t</a> ac;
<a name="l00346"></a>00346 
<a name="l00353"></a>00353     <span class="keywordtype">int</span> <a class="code" href="a00028.html#a1661df12a156024ca6568971e50d001a" title="Get the next character.">_getch</a>(<span class="keywordtype">void</span>);
<a name="l00354"></a>00354 
<a name="l00362"></a>00362     <span class="keywordtype">int</span> <a class="code" href="a00028.html#a3c0bf7b330cf8c090ae07f657ee10b43" title="Put the next character.">_putch</a>(<span class="keywordtype">int</span> ch);
<a name="l00363"></a>00363 
<a name="l00364"></a>00364 <span class="keyword">public</span>:
<a name="l00368"></a>00368     <a class="code" href="a00049.html" title="Streamable tcp connection between client and server.">filestream</a>();
<a name="l00369"></a>00369 
<a name="l00373"></a>00373     <a class="code" href="a00049.html" title="Streamable tcp connection between client and server.">filestream</a>(<span class="keyword">const</span> <a class="code" href="a00049.html" title="Streamable tcp connection between client and server.">filestream</a>&amp; <a class="code" href="a00191.html#ad2ae27334723e41f9cfa1c2b341591ac" title="Convenience function to access object copy.">copy</a>);
<a name="l00374"></a>00374 
<a name="l00378"></a>00378     <a class="code" href="a00049.html" title="Streamable tcp connection between client and server.">filestream</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <a class="code" href="a00050.html#a8e5c4bcc76ebe5c9b10f79f1999b0a75" title="Enumerated file access modes.">fsys::access_t</a> <a class="code" href="a00176.html#af11d6983ce975637031c6eaa0b8cf621" title="Convenience function to access (lock) shared object through it&amp;#39;s protocol.">access</a>, <span class="keywordtype">unsigned</span> mode, <span class="keywordtype">size_t</span> bufsize);
<a name="l00379"></a>00379 
<a name="l00383"></a>00383     <a class="code" href="a00049.html" title="Streamable tcp connection between client and server.">filestream</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <a class="code" href="a00050.html#a8e5c4bcc76ebe5c9b10f79f1999b0a75" title="Enumerated file access modes.">fsys::access_t</a> access, <span class="keywordtype">size_t</span> bufsize);
<a name="l00384"></a>00384 
<a name="l00388"></a>00388     <span class="keyword">virtual</span> ~<a class="code" href="a00049.html" title="Streamable tcp connection between client and server.">filestream</a>();
<a name="l00389"></a>00389 
<a name="l00394"></a><a class="code" href="a00049.html#aac5f1888a67c4ad0bd4a12873e99c6c8">00394</a>     <span class="keyword">inline</span> operator bool()<span class="keyword"> const</span>
<a name="l00395"></a>00395 <span class="keyword">        </span>{<span class="keywordflow">return</span> (bufsize &gt; 0);};
<a name="l00396"></a>00396 
<a name="l00401"></a><a class="code" href="a00049.html#a382fcb668b078f1528717fb6b8a87c33">00401</a>     <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator!()<span class="keyword"> const</span>
<a name="l00402"></a>00402 <span class="keyword">        </span>{<span class="keywordflow">return</span> bufsize == 0;};
<a name="l00403"></a>00403 
<a name="l00407"></a>00407     <span class="keywordtype">void</span> open(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <a class="code" href="a00050.html#a8e5c4bcc76ebe5c9b10f79f1999b0a75" title="Enumerated file access modes.">fsys::access_t</a> access, <span class="keywordtype">size_t</span> buffering = 512);
<a name="l00408"></a>00408 
<a name="l00412"></a>00412     <span class="keywordtype">void</span> create(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <a class="code" href="a00050.html#a8e5c4bcc76ebe5c9b10f79f1999b0a75" title="Enumerated file access modes.">fsys::access_t</a> access, <span class="keywordtype">unsigned</span> mode, <span class="keywordtype">size_t</span> buffering = 512);
<a name="l00413"></a>00413 
<a name="l00417"></a>00417     <span class="keywordtype">void</span> close(<span class="keywordtype">void</span>);
<a name="l00418"></a>00418 
<a name="l00422"></a>00422     <span class="keywordtype">void</span> seek(<a class="code" href="a00050.html#ae9c080c13d2d885db8f11383c191512d" title="File offset type.">fsys::offset_t</a> offset);
<a name="l00423"></a>00423 
<a name="l00428"></a><a class="code" href="a00049.html#ac15fd4f6a606fb011b7f1f441a38d30e">00428</a>     <span class="keyword">inline</span> <span class="keywordtype">int</span> err(<span class="keywordtype">void</span>)<span class="keyword"> const</span>
<a name="l00429"></a>00429 <span class="keyword">        </span>{<span class="keywordflow">return</span> fd.err();};
<a name="l00430"></a>00430 };
<a name="l00431"></a>00431 
<a name="l00432"></a>00432 END_NAMESPACE
<a name="l00433"></a>00433 
<a name="l00434"></a>00434 <span class="preprocessor">#endif</span>
<a name="l00435"></a>00435 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00198.html">stream.h</a>      </li>
      <li class="footer">Generated on Wed Apr 13 2011 22:39:47 for ucommon by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
    </ul>
  </div>

</body>
</html>