1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of SwiftMailer. |
5
|
|
|
* (c) 2004-2009 Chris Corbyn |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
/** |
12
|
|
|
* Analyzes characters for a specific character set. |
13
|
|
|
* |
14
|
|
|
* @author Chris Corbyn |
15
|
|
|
* @author Xavier De Cock <[email protected]> |
16
|
|
|
*/ |
17
|
|
|
interface Swift_CharacterReader |
|
|
|
|
18
|
|
|
{ |
19
|
|
|
const MAP_TYPE_INVALID = 0x01; |
20
|
|
|
const MAP_TYPE_FIXED_LEN = 0x02; |
21
|
|
|
const MAP_TYPE_POSITIONS = 0x03; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Returns the complete character map. |
25
|
|
|
* |
26
|
|
|
* @param string $string |
27
|
|
|
* @param int $startOffset |
28
|
|
|
* @param array $currentMap |
29
|
|
|
* @param mixed $ignoredChars |
30
|
|
|
* |
31
|
|
|
* @return int |
32
|
|
|
*/ |
33
|
|
|
public function getCharPositions($string, $startOffset, &$currentMap, &$ignoredChars); |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Returns the mapType, see constants. |
37
|
|
|
* |
38
|
|
|
* @return int |
39
|
|
|
*/ |
40
|
|
|
public function getMapType(); |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Returns an integer which specifies how many more bytes to read. |
44
|
|
|
* |
45
|
|
|
* A positive integer indicates the number of more bytes to fetch before invoking |
46
|
|
|
* this method again. |
47
|
|
|
* |
48
|
|
|
* A value of zero means this is already a valid character. |
49
|
|
|
* A value of -1 means this cannot possibly be a valid character. |
50
|
|
|
* |
51
|
|
|
* @param int[] $bytes |
52
|
|
|
* @param int $size |
53
|
|
|
* |
54
|
|
|
* @return int |
55
|
|
|
*/ |
56
|
|
|
public function validateByteSequence($bytes, $size); |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Returns the number of bytes which should be read to start each character. |
60
|
|
|
* |
61
|
|
|
* For fixed width character sets this should be the number of octets-per-character. |
62
|
|
|
* For multibyte character sets this will probably be 1. |
63
|
|
|
* |
64
|
|
|
* @return int |
65
|
|
|
*/ |
66
|
|
|
public function getInitialByteSize(); |
67
|
|
|
} |
68
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.