Removed dep on API
[ninja.git] / application / vendor / swiftmailer / classes / Swift / CharacterReader.php
blob53d39ece9cd878c88dc2a3f8a36f4a99152252c3
1 <?php
3 /*
4 * This file is part of SwiftMailer.
5 * (c) 2004-2009 Chris Corbyn
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
11 /**
12 * Analyzes characters for a specific character set.
13 * @package Swift
14 * @subpackage Encoder
15 * @author Chris Corbyn
16 * @author Xavier De Cock <xdecock@gmail.com>
18 interface Swift_CharacterReader
20 const MAP_TYPE_INVALID = 0x01;
21 const MAP_TYPE_FIXED_LEN = 0x02;
22 const MAP_TYPE_POSITIONS = 0x03;
24 /**
25 * Returns the complete charactermap
27 * @param string $string
28 * @param int $startOffset
29 * @param array $currentMap
30 * @param mixed $ignoredChars
31 * @return int
33 public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars);
35 /**
36 * Returns mapType
37 * @int mapType
39 public function getMapType();
41 /**
42 * Returns an integer which specifies how many more bytes to read.
43 * A positive integer indicates the number of more bytes to fetch before invoking
44 * this method again.
45 * A value of zero means this is already a valid character.
46 * A value of -1 means this cannot possibly be a valid character.
47 * @param int[] $bytes
48 * @return int
50 public function validateByteSequence($bytes, $size);
52 /**
53 * Returns the number of bytes which should be read to start each character.
54 * For fixed width character sets this should be the number of
55 * octets-per-character. For multibyte character sets this will probably be 1.
56 * @return int
58 public function getInitialByteSize();