|
private | checkInputField (string k, string name) |
| raises an error if an invalid input field name is declared; only call this if "input" is defined
|
|
private | checkMap () |
| verifies the input map in the constructor
|
|
private | checkMapField (string k, reference fh, *hash th) |
| perform per-field pre-processing on the passed map in the constructor More...
|
|
private | checkTimezoneOption (hash opts, string rn) |
| verifies a timezone constructor option
|
|
| constructor (hash mapv, *hash opts) |
| builds the object based on a hash providing field mappings, data constraints, and optionally custom mapping logic More...
|
|
private | constructor () |
| private constructor for subclasses
|
|
private | convertToHash (int t, string k, reference fh) |
| convert a field definition to a hash if possible
|
|
private | error (string fmt) |
| throws a MAP-ERROR exception; prepends the map name to the description if known More...
|
|
private | error2 (string ex, string fmt) |
| throws the given exception; prepends the map name to the description if known
|
|
int | getCount () |
| returns the internal record count More...
|
|
string | getFieldName (string fname) |
| returns a descriptive name of the given field if possible, otherwise returns the field name itself
|
|
*hash | getInputRecord () |
| returns the value of the "input" option
|
|
*hash | getOutputRecord () |
| returns the value of the "output" option
|
|
any | getRuntime (string key) |
| get current runtime option value for a key More...
|
|
| logOutput (hash h) |
| calls the output logging closure or call reference (if any) to log the output record
|
|
list | mapAll (list recs) |
| maps all input records and returns the mapped data as a list of output records More...
|
|
list | mapAll (hash recs) |
| maps all input records and returns the mapped data as a list of output records More...
|
|
hash | mapData (hash rec) |
| processes the input record and returns a hash of the mapped values where the keys in the hash returned are the target field names; the order of the fields in the hash returned is the same order as the keys in the map hash. More...
|
|
private hash | mapDataIntern (hash rec) |
| processes the input record and returns a hash of the mapped values where the keys in the hash returned are the target field names; the order of the fields in the hash returned is the same order as the keys in the map hash. More...
|
|
private | mapFieldType (string key, hash m, reference v, hash rec) |
| performs type handling
|
|
private any | mapSubclass (hash m, any v) |
| to be overridden as necessary in subclasses
|
|
hash | optionKeys () |
| returns a list of valid constructor options for this class (can be overridden in subclasses) More...
|
|
| replaceRuntime (*hash runtime) |
| replaces runtime options More...
|
|
| resetCount () |
| resets the internal record count More...
|
|
| setRuntime (string key, any value) |
| set the runtime option with "key" to value "value" More...
|
|
| setRuntime (hash runtime) |
| adds runtime options to the current runtime option hash More...
|
|
private | setup (hash mapv, *hash opts) |
| sets up the mapper object before checking the mapper hash
|
|
hash | validKeys () |
| returns a list of valid field keys for this class (can be overridden in subclasses) More...
|
|
hash | validTypes () |
| returns a list of valid field types for this class (can be overridden in subclasses) More...
|
|
|
bool | allow_dot = False |
| do not assume struct when field names have a "." in them; instead allow input field names to have a "." in them
|
|
bool | allow_output_dot = False |
| do not assume structured/hash output when output field names have a "." in them; instead allow output field names to have a "." in them
|
|
int | count = 0 |
| count of records mapped
|
|
*string | date_format |
| the global date format for parsing dates
|
|
string | encoding = "utf-8" |
| the output character encoding; if not given then the output encoding is assumed to be UTF-8
|
|
*code | info_log |
| an optional info logging callback; must accept a sprintf()-style format specifier and optional arguments
|
|
*hash | input |
| an optional description of possible input hash keys
|
|
*code | input_log |
| an optional input data logging callback; must accept a hash giving the input data hash
|
|
Qore::TimeZone | input_timezone = TimeZone::get() |
| the timezone for input fields in case of parsing text values; if not set defaults to the current TimeZone (see Qore::TimeZone::get())
|
|
bool | m_empty_strings_to_nothing = False |
| flag to enforce deletion of the empty string in the output record More...
|
|
*hash | m_runtime |
| current runtime values More...
|
|
hash | mapc |
| the hash providing output field names and mappings
|
|
*string | name |
| the optional name for the object (for example a table name); will be prepended to field names in error messages
|
|
*string | number_format |
| the global number format for parsing numbers
|
|
*hash | output |
| an optional description of the output data structure
|
|
*code | output_log |
| an optional output data logging callback; must accept a hash giving the output data hash
|
|
*Qore::TimeZone | timezone |
| an optional timezone for output date fields
|
|
bool | trunc_all = False |
| truncate all option
|
|
this class is a base class for mapping data; see Mapper Examples for usage examples