Sophie

Sophie

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

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::MemIo 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_1MemIo.html">MemIo</a>
  </div>
</div>
<div class="contents">
<h1>Exiv2::MemIo Class Reference</h1><!-- doxytag: class="Exiv2::MemIo" --><!-- doxytag: inherits="Exiv2::BasicIo" -->Provides binary IO on blocks of memory by implementing the <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> interface. A copy-on-write implementation ensures that the data passed in is only copied when necessary, i.e., as soon as data is written to 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>. The original data is only used for reading. If writes are performed, the changed data can be retrieved using the read methods (since the data used in construction is never modified).  
<a href="#_details">More...</a>
<p>
<code>#include &lt;basicio.hpp&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for Exiv2::MemIo:</div>
<div class="dynsection">
<p><center><img src="classExiv2_1_1MemIo__inherit__graph.png" border="0" usemap="#Exiv2_1_1MemIo__inherit__map" alt="Inheritance graph"></center>
<map name="Exiv2_1_1MemIo__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::MemIo:</div>
<div class="dynsection">
<p><center><img src="classExiv2_1_1MemIo__coll__graph.png" border="0" usemap="#Exiv2_1_1MemIo__coll__map" alt="Collaboration graph"></center>
<map name="Exiv2_1_1MemIo__coll__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>

<p>
<a href="classExiv2_1_1MemIo-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"><a class="anchor" name="b2273b64e44e90f6cdbf785b132d9dc8"></a><!-- doxytag: member="Exiv2::MemIo::MemIo" ref="b2273b64e44e90f6cdbf785b132d9dc8" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MemIo.html#b2273b64e44e90f6cdbf785b132d9dc8">MemIo</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor that results in an empty object. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MemIo.html#d65869d43163ab8d38484a1d36448f3d">MemIo</a> (const <a class="el" href="namespaceExiv2.html#16f60a5bd4207fe155f6cf93a15efa72">byte</a> *data, long size)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor that accepts a block of memory. A copy-on-write algorithm allows read operations directly from the original data and will create a copy of the buffer on the first write operation.  <a href="#d65869d43163ab8d38484a1d36448f3d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e73e710bb84dac0cae62a7eea9f5fd19"></a><!-- doxytag: member="Exiv2::MemIo::~MemIo" ref="e73e710bb84dac0cae62a7eea9f5fd19" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MemIo.html#e73e710bb84dac0cae62a7eea9f5fd19">~MemIo</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor. Releases all managed memory. <br></td></tr>
<tr><td colspan="2"><div class="groupHeader">Manipulators</div></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_1MemIo.html#cbc7726037d2eb0dbbdef649f30ebc5c">open</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Memory IO is always open for reading and writing. This method therefore only resets the IO position to the start.  <a href="#cbc7726037d2eb0dbbdef649f30ebc5c"></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_1MemIo.html#f2263c6d49984da7ce38daed9f327b1e">close</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Does nothing on <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> objects.  <a href="#f2263c6d49984da7ce38daed9f327b1e"></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_1MemIo.html#79993ba49c24c36b30f444c218ce4579">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 memory block. If needed, the size of the internal memory block is expanded. The IO position is advanced by the number of bytes written.  <a href="#79993ba49c24c36b30f444c218ce4579"></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_1MemIo.html#84c854a02e45febea5c0dfc0192e4b6e">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 memory block. If needed, the size of the internal memory block is expanded. The IO position is advanced by the number of bytes written.  <a href="#84c854a02e45febea5c0dfc0192e4b6e"></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_1MemIo.html#5999ba245f79d581c9c5a16982d736b6">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 memory block. The IO position is advanced by one byte.  <a href="#5999ba245f79d581c9c5a16982d736b6"></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_1MemIo.html#3d45d5be7b0e25c32d37d5055da0adc0">read</a> (long rcount)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read data from the memory block. Reading starts at the current IO position and the position is advanced by the number of bytes read.  <a href="#3d45d5be7b0e25c32d37d5055da0adc0"></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_1MemIo.html#7de679e4366d070dc6604db1d22275ce">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 memory block. Reading starts at the current IO position and the position is advanced by the number of bytes read.  <a href="#7de679e4366d070dc6604db1d22275ce"></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_1MemIo.html#b5d5467941f00e4bb47a411182955d44">getb</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read one byte from the memory block. The IO position is advanced by one byte.  <a href="#b5d5467941f00e4bb47a411182955d44"></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_1MemIo.html#223908a596491d75cebbb7a6f9c1559f">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">Clear the memory block 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 a new block of memory.  <a href="#223908a596491d75cebbb7a6f9c1559f"></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_1MemIo.html#b4a12d5b5ed6f8447c7167942c4aa4ae">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 IO position.  <a href="#b4a12d5b5ed6f8447c7167942c4aa4ae"></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_1MemIo.html#b3e20f77251ba80e65cd6e6ac93efd76">mmap</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allow direct access to the underlying data buffer. The buffer is not protected against write access except for the const specifier.  <a href="#b3e20f77251ba80e65cd6e6ac93efd76"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e6ec394a0cabdb3ad63ddf5bf84a4254"></a><!-- doxytag: member="Exiv2::MemIo::munmap" ref="e6ec394a0cabdb3ad63ddf5bf84a4254" args="()" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MemIo.html#e6ec394a0cabdb3ad63ddf5bf84a4254">munmap</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a mapping established with <a class="el" href="classExiv2_1_1MemIo.html#b3e20f77251ba80e65cd6e6ac93efd76" title="Allow direct access to the underlying data buffer. The buffer is not protected against...">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_1MemIo.html#e3d499cec109ea971b95ce088ae0473c">tell</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the current IO position.  <a href="#e3d499cec109ea971b95ce088ae0473c"></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_1MemIo.html#5c58a8d37b4546f1c06cb29099d72ae3">size</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the current memory buffer size in bytes.  <a href="#5c58a8d37b4546f1c06cb29099d72ae3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="79fc5d92978f8ec7412fb25c639f5ada"></a><!-- doxytag: member="Exiv2::MemIo::isopen" ref="79fc5d92978f8ec7412fb25c639f5ada" args="() const " -->
virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MemIo.html#79fc5d92978f8ec7412fb25c639f5ada">isopen</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Always returns true. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="434dc0ed0ec99c0577e7da1d39e651a2"></a><!-- doxytag: member="Exiv2::MemIo::error" ref="434dc0ed0ec99c0577e7da1d39e651a2" args="() const " -->
virtual int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MemIo.html#434dc0ed0ec99c0577e7da1d39e651a2">error</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Always returns 0. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="de95dc04c9b7e15eeb055d4287e78b3a"></a><!-- doxytag: member="Exiv2::MemIo::eof" ref="de95dc04c9b7e15eeb055d4287e78b3a" args="() const " -->
virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classExiv2_1_1MemIo.html#de95dc04c9b7e15eeb055d4287e78b3a">eof</a> () const </td></tr>

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

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a dummy path, indicating that memory access is used. <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_1MemIo.html#420aec675d4fabb48293003d9e7cce76">temporary</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a temporary data storage location. Currently returns an empty <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, but callers should not rely on this behavior since it may change.  <a href="#420aec675d4fabb48293003d9e7cce76"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Provides binary IO on blocks of memory by implementing the <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> interface. A copy-on-write implementation ensures that the data passed in is only copied when necessary, i.e., as soon as data is written to 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>. The original data is only used for reading. If writes are performed, the changed data can be retrieved using the read methods (since the data used in construction is never modified). 
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>If read only usage of this class is common, it might be worth creating a specialized readonly class or changing this one to have a readonly mode. </dd></dl>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="d65869d43163ab8d38484a1d36448f3d"></a><!-- doxytag: member="Exiv2::MemIo::MemIo" ref="d65869d43163ab8d38484a1d36448f3d" args="(const byte *data, long size)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Exiv2::MemIo::MemIo           </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>size</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor that accepts a block of memory. A copy-on-write algorithm allows read operations directly from the original data and will create a copy of the buffer on the first write operation. 
<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>size</em> bytes long </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>Number of bytes to copy. </td></tr>
  </table>
</dl>

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

<p>
Does nothing on <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> objects. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 </dd></dl>

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

</div>
</div><p>
<a class="anchor" name="b5d5467941f00e4bb47a411182955d44"></a><!-- doxytag: member="Exiv2::MemIo::getb" ref="b5d5467941f00e4bb47a411182955d44" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Exiv2::MemIo::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 memory block. The IO position is advanced by one byte. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The byte read from the memory block 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="b3e20f77251ba80e65cd6e6ac93efd76"></a><!-- doxytag: member="Exiv2::MemIo::mmap" ref="b3e20f77251ba80e65cd6e6ac93efd76" 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::MemIo::mmap           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Allow direct access to the underlying data buffer. The buffer is not protected against write access except for the const specifier. 
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The application must ensure that the memory pointed to by the returned pointer remains valid and allocated 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="cbc7726037d2eb0dbbdef649f30ebc5c"></a><!-- doxytag: member="Exiv2::MemIo::open" ref="cbc7726037d2eb0dbbdef649f30ebc5c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Exiv2::MemIo::open           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Memory IO is always open for reading and writing. This method therefore only resets the IO position to the start. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 </dd></dl>

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

</div>
</div><p>
<a class="anchor" name="5999ba245f79d581c9c5a16982d736b6"></a><!-- doxytag: member="Exiv2::MemIo::putb" ref="5999ba245f79d581c9c5a16982d736b6" args="(byte data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Exiv2::MemIo::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 memory block. The IO 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="7de679e4366d070dc6604db1d22275ce"></a><!-- doxytag: member="Exiv2::MemIo::read" ref="7de679e4366d070dc6604db1d22275ce" args="(byte *buf, long rcount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual long Exiv2::MemIo::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 memory block. Reading starts at the current IO 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 memory block 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="3d45d5be7b0e25c32d37d5055da0adc0"></a><!-- doxytag: member="Exiv2::MemIo::read" ref="3d45d5be7b0e25c32d37d5055da0adc0" 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::MemIo::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 memory block. Reading starts at the current IO 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="b4a12d5b5ed6f8447c7167942c4aa4ae"></a><!-- doxytag: member="Exiv2::MemIo::seek" ref="b4a12d5b5ed6f8447c7167942c4aa4ae" args="(long offset, Position pos)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual int Exiv2::MemIo::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 IO 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 IO 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="5c58a8d37b4546f1c06cb29099d72ae3"></a><!-- doxytag: member="Exiv2::MemIo::size" ref="5c58a8d37b4546f1c06cb29099d72ae3" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual long Exiv2::MemIo::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>
Get the current memory buffer size in bytes. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Size of the in memory data 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="e3d499cec109ea971b95ce088ae0473c"></a><!-- doxytag: member="Exiv2::MemIo::tell" ref="e3d499cec109ea971b95ce088ae0473c" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual long Exiv2::MemIo::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 IO position. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Offset from the start of the memory block </dd></dl>

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

</div>
</div><p>
<a class="anchor" name="420aec675d4fabb48293003d9e7cce76"></a><!-- doxytag: member="Exiv2::MemIo::temporary" ref="420aec675d4fabb48293003d9e7cce76" 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::MemIo::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. Currently returns an empty <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, but callers should not rely on this behavior 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> </dd></dl>

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

</div>
</div><p>
<a class="anchor" name="223908a596491d75cebbb7a6f9c1559f"></a><!-- doxytag: member="Exiv2::MemIo::transfer" ref="223908a596491d75cebbb7a6f9c1559f" args="(BasicIo &amp;src)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void Exiv2::MemIo::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>
Clear the memory block 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 a new block of memory. 
<p>
This method is optimized to simply swap memory block if the source object is another <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> instance. The source <a class="el" href="classExiv2_1_1BasicIo.html" title="An interface for simple binary IO.">BasicIo</a> instance 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 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="84c854a02e45febea5c0dfc0192e4b6e"></a><!-- doxytag: member="Exiv2::MemIo::write" ref="84c854a02e45febea5c0dfc0192e4b6e" args="(BasicIo &amp;src)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual long Exiv2::MemIo::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 memory block. If needed, the size of the internal memory block is expanded. The IO 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 memory block 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="79993ba49c24c36b30f444c218ce4579"></a><!-- doxytag: member="Exiv2::MemIo::write" ref="79993ba49c24c36b30f444c218ce4579" args="(const byte *data, long wcount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual long Exiv2::MemIo::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 memory block. If needed, the size of the internal memory block is expanded. The IO 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 memory block 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>