PluginProbe ʕ •ᴥ•ʔ
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets / 3.0
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets v3.0
3.9.5 3.9.6 4.0.0 4.0.1 4.1.0 trunk 2.12 2.13 2.14 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9 3.7.0 3.7.1 3.7.2 3.7.3 3.7.3-beta-1.0 3.7.4 3.7.4-beta-1.0 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4
wp-all-import / libraries / XmlImportStringReader.php
wp-all-import / libraries Last commit date
ast 13 years ago cache 13 years ago XmlImportConfig.php 13 years ago XmlImportCsvParse.php 13 years ago XmlImportException.php 13 years ago XmlImportParser.php 13 years ago XmlImportReaderInterface.php 13 years ago XmlImportStringReader.php 13 years ago XmlImportTemplate.php 13 years ago XmlImportTemplateCodeGenerator.php 13 years ago XmlImportTemplateParser.php 13 years ago XmlImportTemplateScanner.php 13 years ago XmlImportToken.php 13 years ago pclzip.lib.php 13 years ago
XmlImportStringReader.php
67 lines
1 <?php
2 /**
3 * @author Olexandr Zanichkovsky <olexandr.zanichkovsky@zophiatech.com>
4 * @package General
5 */
6
7 require_once dirname(__FILE__) . '/XmlImportReaderInterface.php';
8
9 /**
10 * Allows to either peek or read a character from a string buffer
11 */
12 class XmlImportStringReader implements XmlImportReaderInterface
13 {
14 /**
15 * String buffer
16 *
17 * @var string
18 */
19 private $buffer;
20
21 /**
22 * Current index
23 *
24 * @var int
25 */
26 private $index = -1;
27
28 /**
29 * Creates new instance
30 *
31 * @param string $input
32 */
33 public function __construct($input)
34 {
35 if (is_string($input))
36 $this->buffer = $input;
37 else
38 throw new InvalidArgumentException("String expected as argument.");
39 }
40
41 /**
42 * Returns the next symbol from the buffer without changes to current index
43 * or false if buffer ends
44 *
45 * @return string
46 */
47 public function peek()
48 {
49 if ($this->index + 1 >= strlen($this->buffer))
50 return false;
51 else
52 return $this->buffer[$this->index + 1];
53 }
54
55 /**
56 * Returns the next symbol from the buffer or false if buffer is ended
57 *
58 * @return string
59 */
60 public function read()
61 {
62 $result = $this->peek();
63 if ($this->index < strlen($this->buffer))
64 $this->index++;
65 return $result;
66 }
67 }