<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.event.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'class.eventbuffer.php',
    1 => 'EventBuffer',
    2 => 'La classe EventBuffer',
  ),
  'up' => 
  array (
    0 => 'book.event.php',
    1 => 'Event',
  ),
  'prev' => 
  array (
    0 => 'eventbase.stop.php',
    1 => 'EventBase::stop',
  ),
  'next' => 
  array (
    0 => 'eventbuffer.add.php',
    1 => 'EventBuffer::add',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/event/eventbuffer.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.eventbuffer.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.eventbuffer" class="reference">
 <h1 class="title">La classe EventBuffer</h1>
 
 <div class="partintro"><p class="verinfo">(PECL event &gt;= 1.5.0)</p>

  <div class="section" id="eventbuffer.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    La classe <span class="classname"><strong class="classname">EventBuffer</strong></span> représente
    &quot;evbuffer&quot; de Libevent, un utilitaire pour les I/O bufferisés.
   </p>
   <p class="para">
    Les buffers d&#039;événements sont généralement utiles pour réaliser la
    partie buffer d&#039;un réseau I/O bufferisé.
   </p>
  </div>

  <div class="section" id="eventbuffer.synopsis">
   <h2 class="title">Synopsis de la classe</h2>


   <div class="classsynopsis">
    <span class="ooclass">
     <strong class="classname"></strong>
    </span>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">EventBuffer</strong>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constantes */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.eventbuffer.php#eventbuffer.constants.eol-any"><var class="varname">EOL_ANY</var></a></var><span class="initializer"> = 0</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.eventbuffer.php#eventbuffer.constants.eol-crlf"><var class="varname">EOL_CRLF</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.eventbuffer.php#eventbuffer.constants.eol-crlf-strict"><var class="varname">EOL_CRLF_STRICT</var></a></var><span class="initializer"> = 2</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.eventbuffer.php#eventbuffer.constants.eol-lf"><var class="varname">EOL_LF</var></a></var><span class="initializer"> = 3</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.eventbuffer.php#eventbuffer.constants.ptr-set"><var class="varname">PTR_SET</var></a></var><span class="initializer"> = 0</span>;</div>

    <div class="fieldsynopsis"><span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.eventbuffer.php#eventbuffer.constants.ptr-add"><var class="varname">PTR_ADD</var></a></var><span class="initializer"> = 1</span>;</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Propriétés */</div>
    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">readonly</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="varname"><a href="class.eventbuffer.php#eventbuffer.props.length">$<var class="varname">length</var></a></var>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">readonly</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="varname"><a href="class.eventbuffer.php#eventbuffer.props.contiguous-space">$<var class="varname">contiguous_space</var></a></var>;</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Méthodes */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.add.php" class="methodname">add</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$data</code>
   </span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.addbuffer.php" class="methodname">addBuffer</a></span>(<span class="methodparam">
    
    <span class="type"><a href="class.eventbuffer.php" class="type EventBuffer">EventBuffer</a></span> <code class="parameter">$buf</code>
   </span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.appendfrom.php" class="methodname">appendFrom</a></span>(<span class="methodparam">
    
    <span class="type"><a href="class.eventbuffer.php" class="type EventBuffer">EventBuffer</a></span> <code class="parameter">$buf</code>
   </span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$len</code>
   </span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.construct.php" class="methodname">__construct</a></span>()</div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.copyout.php" class="methodname">copyout</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter reference">&$data</code>
   </span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$max_bytes</code>
   </span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.drain.php" class="methodname">drain</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$len</code>
   </span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.enablelocking.php" class="methodname">enableLocking</a></span>(): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.expand.php" class="methodname">expand</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$len</code>
   </span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.freeze.php" class="methodname">freeze</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$at_front</code>
   </span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.lock.php" class="methodname">lock</a></span>(): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.prepend.php" class="methodname">prepend</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$data</code>
   </span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.prependbuffer.php" class="methodname">prependBuffer</a></span>(<span class="methodparam">
    
    <span class="type"><a href="class.eventbuffer.php" class="type EventBuffer">EventBuffer</a></span> <code class="parameter">$buf</code>
   </span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.pullup.php" class="methodname">pullup</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$size</code>
   </span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.read.php" class="methodname">read</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$max_bytes</code>
   </span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.read.php" class="methodname">read</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$fd</code>
   </span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$howmuch</code>
   </span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.readline.php" class="methodname">readLine</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$eol_style</code>
   </span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.search.php" class="methodname">search</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$what</code>
   </span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$start</code>
    <span class="initializer"> = -1</span>
   </span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$end</code>
    <span class="initializer"> = -1</span>
   </span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.searcheol.php" class="methodname">searchEol</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$start</code>
    <span class="initializer"> = -1</span>
   </span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$eol_style</code>
    <span class="initializer"> = 
     <strong><code><a href="class.eventbuffer.php#eventbuffer.constants.eol-any">EventBuffer::EOL_ANY</a></code></strong>
    </span>
   </span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.substr.php" class="methodname">substr</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$start</code>
   </span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$length</code>
   <span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.unfreeze.php" class="methodname">unfreeze</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$at_front</code>
   </span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.unlock.php" class="methodname">unlock</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span>
   <span class="methodname"><a href="eventbuffer.write.php" class="methodname">write</a></span>(<span class="methodparam">
    
    <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$fd</code>
   </span>, <span class="methodparam">
    
    <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$howmuch</code>
   <span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

   }</div>

  </div>

  <div class="section" id="eventbuffer.props">
   <h2 class="title">Propriétés</h2>
   <dl>
    
     <dt id="eventbuffer.props.length">
      <var class="varname">length</var>
     </dt>
     <dd>
      <p class="para">
       Le nombre d&#039;octets stockés dans un buffer d&#039;événement.
      </p>
     </dd>
    
    
     <dt id="eventbuffer.props.contiguous-space">
      <var class="varname">contiguous_space</var>
     </dt>
     <dd>
      <p class="para">
       Le nombre d&#039;octets stockés de façon contiguë au début du buffer.
       Les octets dans un buffer peuvent être stockés dans plusieurs parties
       séparées de la mémoire ; cette propriété retourne le nombre d&#039;octets
       actuellement stockés dans la première partie.
      </p>
     </dd>
    
   </dl>
  </div>


  <div class="section" id="eventbuffer.constants">
   <h2 class="title">Constantes pré-définies</h2>
   <dl>
    
     <dt id="eventbuffer.constants.eol-any">
      <strong><code><a href="class.eventbuffer.php#eventbuffer.constants.eol-any">EventBuffer::EOL_ANY</a></code></strong>
     </dt>
     <dd>
      <p class="para">
       La fin de ligne est une séquence de nombres représentant un retour chariot
       et une nouvelle ligne. Ce format n&#039;est pas très utile ; il existe encore
       seulement pour des raisons de compatibilité ascendante.
      </p>
     </dd>
    
    
     <dt id="eventbuffer.constants.eol-crlf">
      <strong><code><a href="class.eventbuffer.php#eventbuffer.constants.eol-crlf">EventBuffer::EOL_CRLF</a></code></strong>
     </dt>
     <dd>
      <p class="para">
       La fin de ligne est un retour chariot optionnel, suivi par une nouvelle
       ligne. (En d&#039;autres termes, c&#039;est soit <code class="literal">&quot;\r\n&quot;</code>,
       soit <code class="literal">&quot;\n&quot;</code>). Ce format est utile pour analyser
       les protocoles Internet basés sur du texte ; le standard veut qu&#039;on
       utilise <code class="literal">&quot;\r\n&quot;</code> mais quelques clients fournissent
       seulement <code class="literal">&quot;\n&quot;</code>.
      </p>
     </dd>
    
    
     <dt id="eventbuffer.constants.eol-crlf-strict">
      <strong><code><a href="class.eventbuffer.php#eventbuffer.constants.eol-crlf-strict">EventBuffer::EOL_CRLF_STRICT</a></code></strong>
     </dt>
     <dd>
      <p class="para">
       La fin de ligne est un simple retour chariot, suivi par une
       simple nouvelle ligne (aussi connu comme <code class="literal">&quot;\r\n&quot;</code>.
       Les valeurs ASCII sont <code class="literal">0x0D</code> <code class="literal">0x0A</code>).
      </p>
     </dd>
    
    
     <dt id="eventbuffer.constants.eol-lf">
      <strong><code><a href="class.eventbuffer.php#eventbuffer.constants.eol-lf">EventBuffer::EOL_LF</a></code></strong>
     </dt>
     <dd>
      <p class="para">
       La fin de ligne est un simple caractère de nouvelle ligne (aussi connu
       comme <code class="literal">&quot;\n&quot;</code>. La valeur ASCII est <code class="literal">0x0A</code>).
      </p>
     </dd>
    
    
     <dt id="eventbuffer.constants.ptr-set">
      <strong><code><a href="class.eventbuffer.php#eventbuffer.constants.ptr-set">EventBuffer::PTR_SET</a></code></strong>
     </dt>
     <dd>
      <p class="para">
       Drapeau utilisé comme argument de la méthode
       <span class="methodname"><strong>EventBuffer::setPosition()</strong></span>. Si ce drapeau est spécifié,
       la position du pointeur est déplacée à une position absolue du buffer.
      </p>
     </dd>
    
    
     <dt id="eventbuffer.constants.ptr-add">
      <strong><code><a href="class.eventbuffer.php#eventbuffer.constants.ptr-add">EventBuffer::PTR_ADD</a></code></strong>
     </dt>
     <dd>
      <p class="para">
       Identique à <strong><code><a href="class.eventbuffer.php#eventbuffer.constants.ptr-set">EventBuffer::PTR_SET</a></code></strong>,
       sauf que ce drapeau fait que la méthode
       <span class="methodname"><strong>EventBuffer::setPosition()</strong></span>
       se déplace à une position en arrière par rapport au numéro
       d&#039;octets spécifié (au lieu de définir une position absolue).
      </p>
     </dd>
    
   </dl>
  </div>

 </div>

 





































































































































































<h2>Sommaire</h2><ul class="chunklist chunklist_reference"><li><a href="eventbuffer.add.php">EventBuffer::add</a> — Ajoute des donn&eacute;es &agrave; la fin du tampon d'&eacute;v&eacute;nement</li><li><a href="eventbuffer.addbuffer.php">EventBuffer::addBuffer</a> — D&eacute;place toutes les donn&eacute;es du tampon fourni dans l'instance courante EventBuffer</li><li><a href="eventbuffer.appendfrom.php">EventBuffer::appendFrom</a> — D&eacute;place le nombre d'octets fourni depuis un tampon source vers la fin du tampon courant</li><li><a href="eventbuffer.construct.php">EventBuffer::__construct</a> — Construit un objet EventBuffer</li><li><a href="eventbuffer.copyout.php">EventBuffer::copyout</a> — Copie le nombre d'octets sp&eacute;cifi&eacute; depuis le d&eacute;but du tampon</li><li><a href="eventbuffer.drain.php">EventBuffer::drain</a> — Supprime un nombre sp&eacute;cifi&eacute; d'octets depuis le d&eacute;but du tampon
   sans copier les donn&eacute;es</li><li><a href="eventbuffer.enablelocking.php">EventBuffer::enableLocking</a> — Description</li><li><a href="eventbuffer.expand.php">EventBuffer::expand</a> — R&eacute;serve de l'espace dans le tampon</li><li><a href="eventbuffer.freeze.php">EventBuffer::freeze</a> — Permet d'emp&ecirc;cher les appels qui tentent de modifier un
   tampon d'&eacute;v&eacute;nements de r&eacute;ussir</li><li><a href="eventbuffer.lock.php">EventBuffer::lock</a> — Acquiert un verrou sur le buffer</li><li><a href="eventbuffer.prepend.php">EventBuffer::prepend</a> — Ajoute des donn&eacute;es au d&eacute;but du buffer</li><li><a href="eventbuffer.prependbuffer.php">EventBuffer::prependBuffer</a> — D&eacute;place toutes les donn&eacute;es depuis le buffer source vers le d&eacute;but
   du buffer courant</li><li><a href="eventbuffer.pullup.php">EventBuffer::pullup</a> — S&eacute;rialise les donn&eacute;es du buffer et retourne le contenu du
   buffer sous la forme d'une cha&icirc;ne</li><li><a href="eventbuffer.read.php">EventBuffer::read</a> — Lit les donn&eacute;es d'un evbuffer, et vide les octets lus</li><li><a href="eventbuffer.readfrom.php">EventBuffer::readFrom</a> — Lit des donn&eacute;es depuis un fichier et les place &agrave; la fin du tampon</li><li><a href="eventbuffer.readline.php">EventBuffer::readLine</a> — Extrait une ligne depuis le d&eacute;but du tampon</li><li><a href="eventbuffer.search.php">EventBuffer::search</a> — Recherche dans le tampon une occurrence d'une cha&icirc;ne</li><li><a href="eventbuffer.searcheol.php">EventBuffer::searchEol</a> — Cherche dans le tampon une occurrence de fin de ligne</li><li><a href="eventbuffer.substr.php">EventBuffer::substr</a> — Soustrait une portion des donn&eacute;es du tampon</li><li><a href="eventbuffer.unfreeze.php">EventBuffer::unfreeze</a> — R&eacute;-active les appels qui permettent de modifier un buffer d'&eacute;v&eacute;nements</li><li><a href="eventbuffer.unlock.php">EventBuffer::unlock</a> — Lib&egrave;re un verrou acquis avec EventBuffer::lock</li><li><a href="eventbuffer.write.php">EventBuffer::write</a> — &Eacute;crit le contenu du buffer dans un fichier ou dans un socket</li></ul>
</div>
<?php manual_footer($setup); ?>