cleanup
[xendri.git] / lib / type / String.php
blob5b2058a63441b310c1b770f6e1f221b2738d6ed1
1 <?php
2 //
3 //class String implements ArrayAccess, Countable, ByteArrayConvertable {
4 // protected $data;
5 // protected $source;
6 //
7 // function __construct($data) {
8 // $this->source = $data;
9 // $this->data = str_split($data, 1);
10 // }
12 // function offsetExists($offset) {
13 // return isset($this->data[$offset]);
14 // }
16 // function __toString() {
17 // return implode('', $this->data);
18 // }
20 // function offsetGet($offset) {
21 // return $this->data[$offset];
22 // }
24 // function offsetSet($offset, $value) {
25 // if (is_int($value)) $value = chr($value);
26 // if (is_string($value."")) {
27 // if (strlen($value) > 1) {
28 // $arr = str_split($value, 1);
29 // $value = $arr;
30 // }
31 // $this->data[$offset] = value;
32 // }
33 // }
35 // function offsetUnset($offset) {
36 // unset($this->data[$offset]);
37 // $this->data = array_values($this->data);
38 // }
40 // function change($subject, $replacement) {
41 // $str = str_replace($subject, $replacement, $this->__toString());
42 // $this->data = str_split($str, 1);
43 // }
45 // function replace($regexp, $replacement, $limit = NULL, &$count = NULL) {
46 // $str = $this->__toString();
47 // $str = preg_replace($regexp, $replacement, $str, $limit, $count);
48 // $this->data = str_split($str, 1);
49 // }
51 // function count() {
52 // return count($this->data);
53 // }
55 // function length() {
56 // return count($this->data);
57 // }
59 // function toBytesArray() {
60 // $ret = array();
61 // for($x=0; $x<$this->length(); $x++) {
62 // $ret[] = ord($this->data[$x]);
63 // }
64 // return $ret;
65 // }
67 // function toByteArray() {
68 // return new ByteArray($this->toBytesArray);
69 // }
71 // function fromByteArray(ByteArray $array) {
72 // $this->data = array();
73 // for($x=0; $x < count($array); $x++) {
74 // $this->data[] = chr($array[$x]);
75 // }
76 // }
77 //}
78 //?>