home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / XML / Indexing / Builder / Numeric.php < prev   
Encoding:
PHP Script  |  2008-07-02  |  2.4 KB  |  86 lines

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3. /**
  4.  * XML_Indexing's numerical indexes builder
  5.  *
  6.  * PHP versions 4 and 5
  7.  *
  8.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  9.  * that is available through the world-wide-web at the following URI:
  10.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  11.  * the PHP License and are unable to obtain it through the web, please
  12.  * send a note to license@php.net so we can mail you a copy immediately.
  13.  *
  14.  * @category   XML
  15.  * @package    XML_Indexing
  16.  * @copyright  2004 Samalyse SARL corporation
  17.  * @author     Olivier Guilyardi <olivier@samalyse.com>
  18.  * @license    http://www.php.net/license/3_0.txt  PHP License
  19.  * @version    CVS: $Id: Numeric.php,v 1.1 2005/02/17 16:37:29 olivierg Exp $
  20.  * @link       http://pear.php.net
  21.  * @link       http://www.samalyse.com/code/xml_indexing
  22.  * @since      File available since Release 0.1
  23.  */
  24.     
  25. require_once 'XML/Indexing/Builder.php';
  26.  
  27. /**
  28.  * Numerical indexes builder
  29.  *
  30.  * @copyright  2004 Samalyse SARL corporation
  31.  * @author  Olivier Guilyardi <olivier@samalyse.com>
  32.  * @license    http://www.php.net/license/3_0.txt  PHP License
  33.  * @version    Release: @package_version@
  34.  * @link       http://pear.php.net
  35.  * @since      Class available since Release 0.1
  36.  */
  37. class XML_Indexing_Builder_Numeric extends XML_Indexing_Builder
  38. {
  39.  
  40.     /**
  41.      * Numerical index counter
  42.      * @var int
  43.      * @access private
  44.      */
  45.     var $_counter = 0;
  46.  
  47.     /**
  48.      * Constructor
  49.      * 
  50.      * @param string $filename The filename to build an index against
  51.      * @param string $xroot XPath root 
  52.      * @access public
  53.      */
  54.     function XML_Indexing_Builder_Numeric ($filename, $xroot)
  55.     {
  56.         $this->XML_Indexing_Builder ($filename, $xroot);
  57.     }
  58.  
  59.     /**
  60.      * Handle a matched region
  61.      *
  62.      * @param int $offset Byte offset of the matched region
  63.      * @param int $length Length in bytes of the matched region
  64.      * @param array $attribs Attributes of the tag enclosing the region
  65.      * @access protected
  66.      * @return void
  67.      */
  68.     function _handleRegion ($offset, $length, $attribs)
  69.     {
  70.         $this->_regions[++$this->_counter][] = array($offset,$length);
  71.     }
  72.  
  73.     /**
  74.      * Handle entering node scope
  75.      *
  76.      * @access protected
  77.      * @return void
  78.      */
  79.     function _enterScope ()
  80.     {
  81.         $this->_counter = 0;
  82.     }
  83. }
  84.     
  85. ?>
  86.