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

Class Description


Implements the interface ObjectConverter. Class TextLogger creates an instance of this type in the moment no other (custom) type was set prior to the first log statement.

This implementation uses two specialisations of class Formatter to format the given logables to a textual representation. The formatters (and their sequence!) are:

  1. FormatterPythonStyle
  2. FormatterJavaStyle

This way, standard text logging supports format strings in Python style as well as in Java style.

Public Fields

FormatterJavaStyle formatterJS
 
FormatterPythonStyle formatterPS
 

Public Methods

 StandardConverter ()
 
void convertObjects (AString target, ArrayList< Object > logables)
 
AutoSizes getAutoSizes ()
 
void resetAutoSizes ()
 

Protected Fields

int cntRecursion = 0
 
ArrayList< FormatterPythonStylerecursionFormatters = new ArrayList<FormatterPythonStyle>()
 

Constructor & Destructor Documentation

◆ StandardConverter()


Constructor. 6

Member Function Documentation

◆ convertObjects()

void convertObjects ( AString  target,
ArrayList< Object >  logables 
)

The conversion method. Passes target and logables to formatterPS.

Parameters
logablesThe objects to convert.
targetAn AString that takes the result.

Implements ObjectConverter.

◆ getAutoSizes()

AutoSizes getAutoSizes ( )

Returns a pointer to the auto sizes object of the formatter formatterPS.

Returns
The auto sizes object of the main formatter.

Implements ObjectConverter.

◆ resetAutoSizes()

void resetAutoSizes ( )

Resets automatically widened tab stops and field widths of this converter.

Implements ObjectConverter.

Member Data Documentation

◆ cntRecursion

int cntRecursion = 0
protected

A counter to detect recursive calls.

◆ formatterJS

FormatterJavaStyle formatterJS

Formatter to process Java style format strings. Attached to formatterPS as second format option.

◆ formatterPS

FormatterPythonStyle formatterPS

Formatter to process python style format strings. Used as the first (main) formatter.

◆ recursionFormatters

ArrayList<FormatterPythonStyle> recursionFormatters = new ArrayList<FormatterPythonStyle>()
protected

Formatters used with recursive calls log calls. If recursion occurs, the formatters are created, respectively re-used from last time and their settings are reset to those of the main formatters.


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