This virtual class is used by classes derived from ConfigurationPlugin to convert external string to internal values and vice versa, and for parsing lists of values from an external string.
Class ConfigurationPlugin owns a default object with field defaultStringConverter which by default points to field StringConverter.
- Note
- Replacing the converters is deemed to be an advanced usage of ALib. Consult the source code for detailed information about how to implement an application specific converter.
This default implementation proceeds as follows:
- "Externalizing" a value:
- Value is surrounded by quotes if it starts or ends with spaces or if it includes the delimiter token.
- A few characters are escaped using
'\'
. Those are \n
, \r
, \t
, \a
, \b
, \v
, \f
, \e
and also the double quotation marks \"
and the backslash itself (\\
).
- "Internalizing" a value:
- If (non-escaped) quote
"
characters are found, those are removed and whitespaces within such quotes are kept.
- Escaped characters are converted to their original value.
- Loading variables from external strings:
- If provided variable has a valid delimiter set, this character is used to tokenize the external string.
- Values are trimmed, unless quoted. Quotes characters themselves are removed.
- Delimiters found within a pair of quotes are ignored.
- Each value found is internalized separately