TYPO3 API  SVNRelease
CharacterReader.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * This file is part of SwiftMailer.
00005  * (c) 2004-2009 Chris Corbyn
00006  *
00007  * For the full copyright and license information, please view the LICENSE
00008  * file that was distributed with this source code.
00009  */
00010 
00011 /**
00012  * Analyzes characters for a specific character set.
00013  * @package Swift
00014  * @subpackage Encoder
00015  * @author Chris Corbyn
00016  * @author Xavier De Cock <xdecock@gmail.com>
00017  */
00018 interface Swift_CharacterReader
00019 {
00020   const MAP_TYPE_INVALID = 0x01;
00021   const MAP_TYPE_FIXED_LEN = 0x02;
00022   const MAP_TYPE_POSITIONS = 0x03;
00023 
00024   /**
00025    * Returns the complete charactermap
00026    *
00027    * @param string $string
00028    * @param int $startOffset
00029    * @param array $currentMap
00030    * @param mixed $ignoredChars
00031    * @return int
00032    */
00033   public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars);
00034 
00035   /**
00036    * Returns mapType
00037    * @int mapType
00038    */
00039   public function getMapType();
00040 
00041   /**
00042    * Returns an integer which specifies how many more bytes to read.
00043    * A positive integer indicates the number of more bytes to fetch before invoking
00044    * this method again.
00045    * A value of zero means this is already a valid character.
00046    * A value of -1 means this cannot possibly be a valid character.
00047    * @param int[] $bytes
00048    * @return int
00049    */
00050   public function validateByteSequence($bytes, $size);
00051 
00052   /**
00053    * Returns the number of bytes which should be read to start each character.
00054    * For fixed width character sets this should be the number of
00055    * octets-per-character. For multibyte character sets this will probably be 1.
00056    * @return int
00057    */
00058   public function getInitialByteSize();
00059 
00060 }