|
|
string | $encoding |
| | Encoding of the CSV file to be read.
|
| |
|
Box Spout Common Helper EncodingHelper | $encodingHelper |
| | Helper to work with different encodings.
|
| |
|
Box Spout Reader CSV Creator InternalEntityFactory | $entityFactory |
| | Factory to create entities.
|
| |
|
string | $fieldDelimiter |
| | Defines the character used to delimit fields (one character only)
|
| |
|
string | $fieldEnclosure |
| | Defines the character used to enclose fields (one character only)
|
| |
|
resource | $filePointer |
| | Pointer to the CSV file to read.
|
| |
|
Box Spout Common Helper GlobalFunctionsHelper | $globalFunctionsHelper |
| | Helper to work with global functions.
|
| |
|
bool | $hasReachedEndOfFile = false |
| | Indicates whether all rows have been read.
|
| |
|
int | $numReadRows = 0 |
| | Number of read rows.
|
| |
|
Row null | $rowBuffer |
| | Buffer used to store the current row, while checking if there are more rows to read.
|
| |
|
bool | $shouldPreserveEmptyRows |
| | Whether empty rows should be returned or skipped.
|
| |
◆ __construct()
- Parameters
-
| resource | $filePointer | Pointer to the CSV file to read |
| OptionsManagerInterface | $optionsManager | |
| EncodingHelper | $encodingHelper | |
| InternalEntityFactory | $entityFactory | |
| GlobalFunctionsHelper | $globalFunctionsHelper | |
◆ current()
| Box\Spout\Reader\CSV\RowIterator::current |
( |
| ) |
|
◆ end()
| Box\Spout\Reader\CSV\RowIterator::end |
( |
| ) |
|
◆ getNextUTF8EncodedRow()
| Box\Spout\Reader\CSV\RowIterator::getNextUTF8EncodedRow |
( |
| ) |
|
|
protected |
Returns the next row, converted if necessary to UTF-8.
As fgetcsv() does not manage correctly encoding for non UTF-8 data, we remove manually whitespace with ltrim or rtrim (depending on the order of the bytes)
- Exceptions
-
- Return values
-
| array|false | The row for the current file pointer, encoded in UTF-8 or FALSE if nothing to read |
◆ isEmptyLine()
| Box\Spout\Reader\CSV\RowIterator::isEmptyLine |
( |
| $lineData | ) |
|
|
protected |
- Parameters
-
| array | bool | $lineData | Array containing the cells value for the line |
- Return values
-
| bool | Whether the given line is empty |
◆ key()
| Box\Spout\Reader\CSV\RowIterator::key |
( |
| ) |
|
◆ next()
| Box\Spout\Reader\CSV\RowIterator::next |
( |
| ) |
|
◆ readDataForNextRow()
| Box\Spout\Reader\CSV\RowIterator::readDataForNextRow |
( |
| ) |
|
|
protected |
◆ rewind()
| Box\Spout\Reader\CSV\RowIterator::rewind |
( |
| ) |
|
◆ rewindAndSkipBom()
| Box\Spout\Reader\CSV\RowIterator::rewindAndSkipBom |
( |
| ) |
|
|
protected |
This rewinds and skips the BOM if inserted at the beginning of the file by moving the file pointer after it, so that it is not read.
- Return values
-
◆ shouldReadNextRow()
| Box\Spout\Reader\CSV\RowIterator::shouldReadNextRow |
( |
| $currentRowData | ) |
|
|
protected |
- Parameters
-
| array | bool | $currentRowData | |
- Return values
-
| bool | Whether the data for the current row can be returned or if we need to keep reading |
◆ valid()
| Box\Spout\Reader\CSV\RowIterator::valid |
( |
| ) |
|
◆ MAX_READ_BYTES_PER_LINE
| const Box\Spout\Reader\CSV\RowIterator::MAX_READ_BYTES_PER_LINE = 0 |
Value passed to fgetcsv.
0 means "unlimited" (slightly slower but accomodates for very long lines).
The documentation for this class was generated from the following file:
- lib/spout/src/Spout/Reader/CSV/RowIterator.php