Package DE_EPAGES::CSVExportImport::API::Tools
This module implements functions needed for csv export / import.
Functions
- FormatDateTime
- FormatFloat
- FormatValue
- ParseDateTime
- ParseFloat
- ParseString
- ParseValue
FormatDateTime
Obsolete. Use DE_EPAGES::CSVExportImport::API::CSV::ObjectExportDriver::formatValue instead.
Syntax |
FormatDateTime( $Type, $rValue, $hFormat );
|
Input |
- $Type (string)
- type of the attribute, could be 'Date', 'Time', 'DateTime'
- $rValue (ref)
- reference to value of the attribute
- $hFormat (ref.hash.*)
- format parameters, keys are
- LocaleID - locale id - string
|
FormatFloat
Obsolete. Use DE_EPAGES::CSVExportImport::API::CSV::ObjectExportDriver::formatValue instead.
Syntax |
FormatFloat( $rValue, $hFormat )
|
Input |
- $rValue (ref)
- reference to value of the attribute
- $hFormat (ref.hash.*)
- format parameters, keys are
- DecimalSep - decimal separator - string
- ThousandSep - thousands separator - string
|
FormatValue
Obsolete. Use DE_EPAGES::CSVExportImport::API::CSV::ObjectExportDriver::formatValue instead.
Syntax |
FormatValue( $rValue, $Type, $hFormat );
|
Input |
- $rValue (ref)
- reference to value of the attribute
- $Type (string)
- type of the attribute, could be 'Boolean', 'Integer', 'Float',
'Money', 'Price', 'Date', 'Time', 'DateTime'
- $hFormat (ref.hash.*)
- format parameters, keys are
- LocaleID - locale id - string
- DecimalSep - decimal separator - string
- ThousandSep - thousands separator - string
|
ParseDateTime
Normalizes DateTime values.
Syntax |
ParseDateTime( $Name, $Type, $rValue, $hFormat )
|
Input |
- $Name (string)
- alias of the attribute
- $Type (string)
- type of the attribute, could be 'Date', 'Time', 'DateTime'
- $rValue (ref)
- reference to value of the attribute
- $hFormat (ref.hash.*)
- format parameters, keys are
- LocaleID - locale id - string
|
ParseFloat
Normalizes float values.
Syntax |
ParseFloat( $Name, $rValue, $hFormat )
|
Input |
- $Name (string)
- alias of the attribute
- $rValue (ref)
- reference to value of the attribute
- $hFormat (ref.hash.*)
- format parameters, keys are
- DecimalSep - decimal separator - string
- ThousandSep - thousands separator - string
|
ParseString
Tests if the value is a string.
Throws an error if the format is not ok.
Syntax |
ParseString( $Name, $rValue );
ParseString( $Name, $rValue, $hLimits );
|
Input |
- $Name (string)
- alias of the attribute
- $rValue (ref)
- reference to value of the attribute
- $hLimits (ref.hash.*)
- (optional) upper and lower limits for some data types, at the moment
- MaxLength - maximum string length - int
|
Output |
- $rValue (ref)
- set to the parsed value if the format is ok,
set to undef if the original value contains whitespace only
|
ParseValue
Tests variable and converts from external to internal representation.
Changes the value of $$rValue.
Throws an error if the format is not ok.
Syntax |
ParseValue( $Name, $Type, $rValue );
ParseValue( $Name, $Type, $rValue, $hFormat );
ParseValue( $Name, $Type, $rValue, $hFormat, $hLimits );
|
Input |
- $Name (string)
- alias of the attribute
- $Type (string)
- type of the attribute, could be 'Boolean','Integer', 'Float',
'Money', 'Price', 'Date', 'Time', 'DateTime'
- $rValue (ref)
- reference to value of the attribute
- $hFormat (ref.hash.*)
- (optional) format parameters, keys are
- LocaleID - locale id - string
- DecimalSep - decimal separator - string
- ThousandSep - thousands separator - string
- $hLimits (ref.hash.*)
- (optional) upper and lower limits for some data types, at the moment
- MaxFloat - max. valid float value - float
- MinFloat - min. valid float value - float
|
Output |
- $rValue (ref)
- set to the parsed value if the format is ok,
set to undef if the original value contains whitespace only
|