Sophie

Sophie

distrib > * > 2010.0 > * > by-pkgid > b36c97ff723e66f0f38bce83645c99dc > files > 254

exiv2-doc-0.18.2-1mdv2010.0.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Exiv2: Exiv2::FileIo Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    <li>
      <form action="search.php" method="get">
        <table cellspacing="0" cellpadding="0" border="0">
          <tr>
            <td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
            <td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
          </tr>
        </table>
      </form>
    </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceExiv2.html">Exiv2</a>::<a class="el" href="classExiv2_1_1FileIo.html">FileIo</a>
  </div>
</div>
<div class="contents">
<h1>Exiv2::FileIo Class Reference</h1><!-- doxytag: class="Exiv2::FileIo" --><!-- doxytag: inherits="Exiv2::BasicIo" -->Provides binary file IO by implementing the <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> interface.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;basicio.hpp&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for Exiv2::FileIo:</div>
<div class="dynsection">
<p><center><img src="classExiv2_1_1FileIo__inherit__graph.png" border="0" usemap="#Exiv2_1_1FileIo__inherit__map" alt="Inheritance graph"></center>
<map name="Exiv2_1_1FileIo__inherit__map">
<area shape="rect" id="node2" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO." alt="" coords="5,5,165,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>
<div class="dynheader">
Collaboration diagram for Exiv2::FileIo:</div>
<div class="dynsection">
<p><center><img src="classExiv2_1_1FileIo__coll__graph.png" border="0" usemap="#Exiv2_1_1FileIo__coll__map" alt="Collaboration graph"></center>
<map name="Exiv2_1_1FileIo__coll__map">
<area shape="rect" id="node2" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO." alt="" coords="5,83,165,109"><area shape="rect" id="node4" title="STL class." alt="" coords="189,83,320,109"><area shape="rect" id="node6" title="STL class." alt="" coords="129,5,380,32"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classExiv2_1_1FileIo-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 Member Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Creators</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#940ebd4fc3630f31c59adf99a52824c3">FileIo</a> (const std::string &amp;path)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor that accepts the file path on which IO will be performed. The constructor does not open the file, and therefore never failes.  <a href="#940ebd4fc3630f31c59adf99a52824c3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d04edcc7bb11ff1ef7370967c31282bf"></a><!-- doxytag: member="Exiv2::FileIo::~FileIo" ref="d04edcc7bb11ff1ef7370967c31282bf" args="()" -->
virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#d04edcc7bb11ff1ef7370967c31282bf">~FileIo</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. Flushes and closes an open file. <br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Manipulators</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#1793ddca7f8c94619ceae7a127da73c2">open</a> (const std::string &amp;mode)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open the file using using the specified mode.  <a href="#1793ddca7f8c94619ceae7a127da73c2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#88b8ab582237647a4c28120c15030a71">open</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open the file using using the default access mode of "rb". This method can also be used to "reopen" a file which will flush any unwritten data and reset the IO position to the start.  <a href="#88b8ab582237647a4c28120c15030a71"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#794be686e28524d9eed2a0811d477d3b">close</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flush and unwritten data and close the file . It is safe to call close on an already closed instance.  <a href="#794be686e28524d9eed2a0811d477d3b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#1a576f408124d428d5c446a19e2a504d">write</a> (const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *data, long wcount)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write data to the file. The file position is advanced by the number of bytes written.  <a href="#1a576f408124d428d5c446a19e2a504d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#7fd4444f019a2cfbd0e925e9b181c95c">write</a> (<a class="el" href="classExiv2_1_1BasicIo.html">BasicIo</a> &amp;src)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write data that is read from another <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> instance to the file. The file position is advanced by the number of bytes written.  <a href="#7fd4444f019a2cfbd0e925e9b181c95c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#581c10115b42fc3a6c2b177337988922">putb</a> (<a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> data)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write one byte to the file. The file position is advanced by one byte.  <a href="#581c10115b42fc3a6c2b177337988922"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classExiv2_1_1DataBuf.html">DataBuf</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#48ed0700ccfb60a6a435ab7086734965">read</a> (long rcount)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read data from the file. Reading starts at the current file position and the position is advanced by the number of bytes read.  <a href="#48ed0700ccfb60a6a435ab7086734965"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#a54d2b91db8ac2073fbe438ef19ac055">read</a> (<a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *buf, long rcount)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read data from the file. Reading starts at the current file position and the position is advanced by the number of bytes read.  <a href="#a54d2b91db8ac2073fbe438ef19ac055"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#0741ebecd2ea70f86c40457c33cd6c66">getb</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read one byte from the file. The file position is advanced by one byte.  <a href="#0741ebecd2ea70f86c40457c33cd6c66"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#a860f63e95d227be73b86b2fe64ad7b8">transfer</a> (<a class="el" href="classExiv2_1_1BasicIo.html">BasicIo</a> &amp;src)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove the contents of the file and then transfer data from the <em>src</em> <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> object into the empty file.  <a href="#a860f63e95d227be73b86b2fe64ad7b8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#889840bb9764987ce7a13c10d3ddcf2e">seek</a> (long offset, <a class="el" href="classExiv2_1_1BasicIo.html#1d23c3bf7618f2ee6ebb5cf033b10911">Position</a> pos)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Move the current file position.  <a href="#889840bb9764987ce7a13c10d3ddcf2e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#262356ec3c52ccdba2862b289f8e5e37">mmap</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Map the file into the process's address space. The file must be open before <a class="el" href="classExiv2_1_1FileIo.html#262356ec3c52ccdba2862b289f8e5e37" title="Map the file into the process&#39;s address space. The file must be open before mmap()...">mmap()</a> is called.  <a href="#262356ec3c52ccdba2862b289f8e5e37"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="636924cdba166cd1c70ae5d424d6912d"></a><!-- doxytag: member="Exiv2::FileIo::munmap" ref="636924cdba166cd1c70ae5d424d6912d" args="()" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#636924cdba166cd1c70ae5d424d6912d">munmap</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a mapping established with <a class="el" href="classExiv2_1_1FileIo.html#262356ec3c52ccdba2862b289f8e5e37" title="Map the file into the process&#39;s address space. The file must be open before mmap()...">mmap()</a>. <br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Accessors</div></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#15209532fb5b3991b033046d50b30b40">tell</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the current file position.  <a href="#15209532fb5b3991b033046d50b30b40"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#d4ca7c5f50eac795ab981c5913d12345">size</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Flush any buffered writes and get the current file size in bytes.  <a href="#d4ca7c5f50eac795ab981c5913d12345"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="38c1a6f22036afbfb968ba9da4c2c65d"></a><!-- doxytag: member="Exiv2::FileIo::isopen" ref="38c1a6f22036afbfb968ba9da4c2c65d" args="() const " -->
virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#38c1a6f22036afbfb968ba9da4c2c65d">isopen</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if the file is open, otherwise false. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9c337bb27daca73a3d588d65d1d45a15"></a><!-- doxytag: member="Exiv2::FileIo::error" ref="9c337bb27daca73a3d588d65d1d45a15" args="() const " -->
virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#9c337bb27daca73a3d588d65d1d45a15">error</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns 0 if the file is in a valid state, otherwise nonzero. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="74be2366d049a5841d1c54139d76f782"></a><!-- doxytag: member="Exiv2::FileIo::eof" ref="74be2366d049a5841d1c54139d76f782" args="() const " -->
virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#74be2366d049a5841d1c54139d76f782">eof</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if the file position has reach the end, otherwise false. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a49d03fce2b8040baaec49f7de51c4fe"></a><!-- doxytag: member="Exiv2::FileIo::path" ref="a49d03fce2b8040baaec49f7de51c4fe" args="() const " -->
virtual std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#a49d03fce2b8040baaec49f7de51c4fe">path</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the path of the file. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classExiv2_1_1BasicIo.html#f8f989522925b884d8c9d3a257265fa1">BasicIo::AutoPtr</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1FileIo.html#02656814c3dd891fcd5537eb70920c25">temporary</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a temporary data storage location. The actual type returned depends upon the size of the file represented a <a class="el" href="classExiv2_1_1FileIo.html" title="Provides binary file IO by implementing the BasicIo interface.">FileIo</a> object. For small files, a <a class="el" href="classExiv2_1_1MemIo.html" title="Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write...">MemIo</a> is returned while for large files a <a class="el" href="classExiv2_1_1FileIo.html" title="Provides binary file IO by implementing the BasicIo interface.">FileIo</a> is returned. Callers should not rely on this behavior, however, since it may change.  <a href="#02656814c3dd891fcd5537eb70920c25"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Provides binary file IO by implementing the <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> interface. <hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="940ebd4fc3630f31c59adf99a52824c3"></a><!-- doxytag: member="Exiv2::FileIo::FileIo" ref="940ebd4fc3630f31c59adf99a52824c3" args="(const std::string &amp;path)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Exiv2::FileIo::FileIo           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>path</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor that accepts the file path on which IO will be performed. The constructor does not open the file, and therefore never failes. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>path</em>&nbsp;</td><td>The full path of a file </td></tr>
  </table>
</dl>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="794be686e28524d9eed2a0811d477d3b"></a><!-- doxytag: member="Exiv2::FileIo::close" ref="794be686e28524d9eed2a0811d477d3b" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Exiv2::FileIo::close           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Flush and unwritten data and close the file . It is safe to call close on an already closed instance. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if successful;<br>
 Nonzero if failure; </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#67ae3ca0f8aece92a7b7749dfb02edde">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="0741ebecd2ea70f86c40457c33cd6c66"></a><!-- doxytag: member="Exiv2::FileIo::getb" ref="0741ebecd2ea70f86c40457c33cd6c66" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Exiv2::FileIo::getb           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Read one byte from the file. The file position is advanced by one byte. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The byte read from the file if successful;<br>
 EOF if failure; </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#648bc0d9b1a79e34684375074d806534">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="262356ec3c52ccdba2862b289f8e5e37"></a><!-- doxytag: member="Exiv2::FileIo::mmap" ref="262356ec3c52ccdba2862b289f8e5e37" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a>* Exiv2::FileIo::mmap           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Map the file into the process's address space. The file must be open before <a class="el" href="classExiv2_1_1FileIo.html#262356ec3c52ccdba2862b289f8e5e37" title="Map the file into the process&#39;s address space. The file must be open before mmap()...">mmap()</a> is called. 
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The returned pointer is valid only as long as the <a class="el" href="classExiv2_1_1MemIo.html" title="Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write...">MemIo</a> object is in scope. </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#56dedc1898b73b376280fc9c9d656d9b">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="88b8ab582237647a4c28120c15030a71"></a><!-- doxytag: member="Exiv2::FileIo::open" ref="88b8ab582237647a4c28120c15030a71" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Exiv2::FileIo::open           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Open the file using using the default access mode of "rb". This method can also be used to "reopen" a file which will flush any unwritten data and reset the IO position to the start. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if successful;<br>
 Nonzero if failure. </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#1beff0dcdf03510bad13b6946379c5f2">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="1793ddca7f8c94619ceae7a127da73c2"></a><!-- doxytag: member="Exiv2::FileIo::open" ref="1793ddca7f8c94619ceae7a127da73c2" args="(const std::string &amp;mode)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Exiv2::FileIo::open           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>mode</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Open the file using using the specified mode. 
<p>
This method can also be used to "reopen" a file which will flush any unwritten data and reset the IO position to the start. Although files can be opened in binary or text mode, this class has only been tested carefully in binary mode.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>mode</em>&nbsp;</td><td>Specified that type of access allowed on the file. Valid values match those of the C fopen command exactly. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if successful;<br>
 Nonzero if failure. </dd></dl>

</div>
</div><p>
<a class="anchor" name="581c10115b42fc3a6c2b177337988922"></a><!-- doxytag: member="Exiv2::FileIo::putb" ref="581c10115b42fc3a6c2b177337988922" args="(byte data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Exiv2::FileIo::putb           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a>&nbsp;</td>
          <td class="paramname"> <em>data</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Write one byte to the file. The file position is advanced by one byte. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>The single byte to be written. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The value of the byte written if successful;<br>
 EOF if failure; </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#d16a1fab0f122c8ca11b86d09b03b9a7">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="a54d2b91db8ac2073fbe438ef19ac055"></a><!-- doxytag: member="Exiv2::FileIo::read" ref="a54d2b91db8ac2073fbe438ef19ac055" args="(byte *buf, long rcount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual long Exiv2::FileIo::read           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *&nbsp;</td>
          <td class="paramname"> <em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&nbsp;</td>
          <td class="paramname"> <em>rcount</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Read data from the file. Reading starts at the current file position and the position is advanced by the number of bytes read. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>Pointer to a block of memory into which the read data is stored. The memory block must be at least <em>rcount</em> bytes long. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>rcount</em>&nbsp;</td><td>Maximum number of bytes to read. Fewer bytes may be read if <em>rcount</em> bytes are not available. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Number of bytes read from the file successfully;<br>
 0 if failure; </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#ec8cb20c86e72b87577370a28d66a0ca">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="48ed0700ccfb60a6a435ab7086734965"></a><!-- doxytag: member="Exiv2::FileIo::read" ref="48ed0700ccfb60a6a435ab7086734965" args="(long rcount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classExiv2_1_1DataBuf.html">DataBuf</a> Exiv2::FileIo::read           </td>
          <td>(</td>
          <td class="paramtype">long&nbsp;</td>
          <td class="paramname"> <em>rcount</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Read data from the file. Reading starts at the current file position and the position is advanced by the number of bytes read. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>rcount</em>&nbsp;</td><td>Maximum number of bytes to read. Fewer bytes may be read if <em>rcount</em> bytes are not available. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="classExiv2_1_1DataBuf.html" title="Utility class containing a character array. All it does is to take care of memory...">DataBuf</a> instance containing the bytes read. Use the <a class="el" href="classExiv2_1_1DataBuf.html#5e6028d5cdae2e149749667cf66c3e91" title="The current size of the buffer.">DataBuf::size_</a> member to find the number of bytes read. <a class="el" href="classExiv2_1_1DataBuf.html#5e6028d5cdae2e149749667cf66c3e91" title="The current size of the buffer.">DataBuf::size_</a> will be 0 on failure. </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#8c9e6c7377b642afbb2c14a0e3896917">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="889840bb9764987ce7a13c10d3ddcf2e"></a><!-- doxytag: member="Exiv2::FileIo::seek" ref="889840bb9764987ce7a13c10d3ddcf2e" args="(long offset, Position pos)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Exiv2::FileIo::seek           </td>
          <td>(</td>
          <td class="paramtype">long&nbsp;</td>
          <td class="paramname"> <em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classExiv2_1_1BasicIo.html#1d23c3bf7618f2ee6ebb5cf033b10911">Position</a>&nbsp;</td>
          <td class="paramname"> <em>pos</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Move the current file position. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>offset</em>&nbsp;</td><td>Number of bytes to move the file position relative to the starting position specified by <em>pos</em> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pos</em>&nbsp;</td><td>Position from which the seek should start </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if successful;<br>
 Nonzero if failure; </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#561221bbe1d215b4d6b5ceceaa2e9a97">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="d4ca7c5f50eac795ab981c5913d12345"></a><!-- doxytag: member="Exiv2::FileIo::size" ref="d4ca7c5f50eac795ab981c5913d12345" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual long Exiv2::FileIo::size           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Flush any buffered writes and get the current file size in bytes. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Size of the file in bytes;<br>
 -1 if failure; </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#01903a1a2310197eb7e3fd41bedc3054">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="15209532fb5b3991b033046d50b30b40"></a><!-- doxytag: member="Exiv2::FileIo::tell" ref="15209532fb5b3991b033046d50b30b40" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual long Exiv2::FileIo::tell           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the current file position. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Offset from the start of the file if successful;<br>
 -1 if failure; </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#eb9673a48a7af7376b7018998fb552e6">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="02656814c3dd891fcd5537eb70920c25"></a><!-- doxytag: member="Exiv2::FileIo::temporary" ref="02656814c3dd891fcd5537eb70920c25" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classExiv2_1_1BasicIo.html#f8f989522925b884d8c9d3a257265fa1">BasicIo::AutoPtr</a> Exiv2::FileIo::temporary           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns a temporary data storage location. The actual type returned depends upon the size of the file represented a <a class="el" href="classExiv2_1_1FileIo.html" title="Provides binary file IO by implementing the BasicIo interface.">FileIo</a> object. For small files, a <a class="el" href="classExiv2_1_1MemIo.html" title="Provides binary IO on blocks of memory by implementing the BasicIo interface. A copy-on-write...">MemIo</a> is returned while for large files a <a class="el" href="classExiv2_1_1FileIo.html" title="Provides binary file IO by implementing the BasicIo interface.">FileIo</a> is returned. Callers should not rely on this behavior, however, since it may change. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>An instance of <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> on success </dd></dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classExiv2_1_1Error.html" title="Simple error class used for exceptions. An output operator is provided to print errors...">Error</a></em>&nbsp;</td><td>If opening the temporary file fails </td></tr>
  </table>
</dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#ec9dd2dd223ce57650462c74a0770502">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="a860f63e95d227be73b86b2fe64ad7b8"></a><!-- doxytag: member="Exiv2::FileIo::transfer" ref="a860f63e95d227be73b86b2fe64ad7b8" args="(BasicIo &amp;src)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void Exiv2::FileIo::transfer           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classExiv2_1_1BasicIo.html">BasicIo</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>src</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Remove the contents of the file and then transfer data from the <em>src</em> <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> object into the empty file. 
<p>
This method is optimized to simply rename the source file if the source object is another <a class="el" href="classExiv2_1_1FileIo.html" title="Provides binary file IO by implementing the BasicIo interface.">FileIo</a> instance. The source <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> object is invalidated by this operation and should not be used after this method returns. This method exists primarily to be used with the <a class="el" href="classExiv2_1_1BasicIo.html#ec9dd2dd223ce57650462c74a0770502" title="Returns a temporary data storage location. This is often needed to rewrite an IO...">BasicIo::temporary()</a> method.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>If the caller doesn't have permissions to write to the file, an exception is raised and <em>src</em> is deleted.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>src</em>&nbsp;</td><td>Reference to another <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> instance. The entire contents of src are transferred to this object. The <em>src</em> object is invalidated by the method. </td></tr>
  </table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classExiv2_1_1Error.html" title="Simple error class used for exceptions. An output operator is provided to print errors...">Error</a></em>&nbsp;</td><td>In case of failure </td></tr>
  </table>
</dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#cb964ff603c96da8711baddb66a385a4">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="7fd4444f019a2cfbd0e925e9b181c95c"></a><!-- doxytag: member="Exiv2::FileIo::write" ref="7fd4444f019a2cfbd0e925e9b181c95c" args="(BasicIo &amp;src)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual long Exiv2::FileIo::write           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classExiv2_1_1BasicIo.html">BasicIo</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>src</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Write data that is read from another <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> instance to the file. The file position is advanced by the number of bytes written. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>src</em>&nbsp;</td><td>Reference to another <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> instance. Reading start at the source's current IO position </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Number of bytes written to the file successfully;<br>
 0 if failure; </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#31334606e230bbe94d6b8768d3c6d75f">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<a class="anchor" name="1a576f408124d428d5c446a19e2a504d"></a><!-- doxytag: member="Exiv2::FileIo::write" ref="1a576f408124d428d5c446a19e2a504d" args="(const byte *data, long wcount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual long Exiv2::FileIo::write           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&nbsp;</td>
          <td class="paramname"> <em>wcount</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Write data to the file. The file position is advanced by the number of bytes written. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>Pointer to data. Data must be at least <em>wcount</em> bytes long </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>wcount</em>&nbsp;</td><td>Number of bytes to be written. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Number of bytes written to the file successfully;<br>
 0 if failure; </dd></dl>

<p>Implements <a class="el" href="classExiv2_1_1BasicIo.html#c548d52ef633ac425bd01d17ccd2e7e4">Exiv2::BasicIo</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="basicio_8hpp.html">basicio.hpp</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jun 25 15:17:50 2009 for Exiv2 by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>