ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Public Methods | Protected Fields | List of all members
XTernalizer Class Reference
Collaboration diagram for XTernalizer:
[legend]

Class Description


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:

Public Methods

void externalizeValue (Object src, AString dest, char delim)
 
void internalizeValue (Substring src, AString dest)
 
void loadFromString (Variable variable, Object src)
 

Protected Fields

AString tmpAS = new AString()
 
Substring tmpSubs = new Substring()
 
Substring tmpSubs2 = new Substring()
 

Member Function Documentation

◆ externalizeValue()

void externalizeValue ( Object  src,
AString  dest,
char  delim 
)

Converts the given src string to an external representation.

Parameters
srcThe source string
destThe destination string
delimIf this character is found in the string, the value is quoted

◆ internalizeValue()

void internalizeValue ( Substring  src,
AString  dest 
)

Trims src, removes surrounding quotes and , un-escapes characters.

Parameters
srcThe source string
destThe destination string

◆ loadFromString()

void loadFromString ( Variable  variable,
Object  src 
)

If field Variable.delim is '\0', just invokes internalizeValue. Otherwise, parses values using the delimiter. Quotes are removed and parts within quotes are kept as is. Also, delimiters in quotes are ignored.

Parameters
variableThe destination variable.
srcThe source string

Member Data Documentation

◆ tmpAS

AString tmpAS = new AString()
protected

a reusable AString

◆ tmpSubs

Substring tmpSubs = new Substring()
protected

a reusable Substring

◆ tmpSubs2

Substring tmpSubs2 = new Substring()
protected

a reusable Substring


The documentation for this class was generated from the following file: