Package DE_EPAGES::Core::API::CSV::BaseImportHandler
Base class for csv import drivers
Functions
- converter
- drive
- encodeFrom
- fileHandle
- fileName
- header
- importCSV
- importLine
- incLineNumber
- lineNumber
- linesCount
- new
- parse
- popID
- pushID
- readHeader
- readLine
- readLines
- topID
- useBOM
converter
return the current csv converter
Syntax |
$converter = $self->converter; |
Return |
|
drive
read the data content lines, uses function readLines
Syntax |
$self->drive(); |
encodeFrom
returns the target encoding (was set in exportCSV)
Syntax |
encodeFrom(); |
Example |
$Driver->encodeFrom(); |
Return |
|
fileHandle
return the current fileHandle
Syntax |
$self->fileHandle; |
Return |
|
fileName
return the current fileName
Syntax |
$self->fileName; |
Return |
|
header
return the header columns
Syntax |
$self->header; |
Return |
|
importCSV
imports data (2 dim. array) from a file. opens the document, calls function setLinesCount, calls function parse and closes the document
Syntax |
$Package->importCSV($FileName, $hFormat); |
Input |
|
Return |
|
importLine
imports one data line, get the line element from function topID('Item') this is only a dummy funtion here.
Syntax |
$self->importLine(); |
incLineNumber
increments the line number and returns the new number
Syntax |
$linenumber = $self->incLineNumber; |
Return |
|
lineNumber
return the current linenumber
Syntax |
$linenumber = $self->lineNumber; |
Return |
|
linesCount
return the count of lines of current fileHandle
Syntax |
$self->linesCount; |
Return |
|
new
create a new csv import handler
Syntax |
$Handler = DE_EPAGES::Core::API::CSV::BaseImportHandler->new(%options); |
Input |
|
Return |
|
parse
reads the header via function readHeader, calls function drive
Syntax |
$self->parse(); |
popID
removes a parameter from the parameter stack and returns its value.
Syntax |
$Value = $self->popID( $Key ); |
Example |
$CompanyID = $self->popID( 'CompanyID' ); |
Input |
|
Return |
|
pushID
adds a parameter to the parameter stack. Any previous parameter with the same name will be hidden until $self->popID( $Key ) is called. Use $self->topID( $Key ) to get the parameter value. Use $self->popID( $Key ) to remove the parameter from the stack.
Syntax |
$self->pushID( $Key, $Value ); |
Example |
$self->pushID( 'CompanyID', $CompanyID ); |
Input |
|
readHeader
read the header
Syntax |
$self->readHeader(); |
readLine
imports a line ( reads and converts from the filehandle )
Syntax |
$aLineElements = $self->readLine; |
Return |
|
readLines
reads the content lines via function readLine, calls for each line function importLine
Syntax |
$self->readLines(); |
topID
returns the current value of a parameter
Syntax |
$Value = $self->topID( $Key ); |
Example |
$CompanyID = $self->topID( 'CompanyID' ); |
Input |
|
Return |
|
useBOM
returns true if the file has a Unicode Byte Order Mark
Syntax |
$UseBPM = $Driver->useBOM; |
Return |
|