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

Class Description


A data record used to declare an ALib Configuration Variable. While variables can also be declared by setting their attributes individually, it is recommended to declare all external configuration variables in a central place, using statically or dynamically allocated objects of this type.
Objects of class Variable can be constructed and existing objects can be reused by invoking Variable.declare. Both, construction and re-declaration of variables, use objects of this type.

All fields (except delim) support placeholders "%1", "%2" ... "%N", which are replaced with the constructor of class Variable and method Variable.declare. This allows to define a series of variables whose category, name, description and value is dependent on runtime information.

Besides the use for passing parameters into objects of type Variable, this class does not provide further logic.

Public Fields

String category
 
AString categoryFallback
 
String comments
 
String defaultValue
 
char delim
 
String formatAttrAlignment
 
int formatHints
 
String name
 

Public Methods

 VariableDecl (AString categoryFallback, String category, String name, String defaultValue, char delim, String formatAttrAlignment, int formatHints, String comments)
 

Constructor & Destructor Documentation

◆ VariableDecl()

VariableDecl ( AString  categoryFallback,
String  category,
String  name,
String  defaultValue,
char  delim,
String  formatAttrAlignment,
int  formatHints,
String  comments 
)

Simple constructor copying values

Parameters
categoryFallbackValue for field categoryFallback (treated as reference, value not copied)
categoryValue for field category
nameValue for field name
defaultValueValue for field defaultValue
delimValue for field delim
formatAttrAlignmentValue for field formatAttrAlignment
formatHintsValue for field formatHints
commentsValue for field comments

Member Data Documentation

◆ category

String category

The category for this value. May be left nulled in which case field categoryFallback is applied.

◆ categoryFallback

AString categoryFallback

Reference to a category string which is used as fallback if field category is nulled. This is useful as usually most variables share one general application specific category. With the combination of fields categoryFallback and category, the user (of a library) is be entitled to change single variables or all at once. In the latter case, field category is left nulled, while this field is set to a global default value (which also can be changed, therefore a pointer).

◆ comments

String comments

Comments for the variable. Some plug-ins allow to store comments along with the variable (e.g. class com.aworx.lib.config.IniFile).

◆ defaultValue

String defaultValue

The default value. If this is null, no variable will be created with method Configuration.load.

Note
The field is ignored when using the plug-in interface ConfigurationPlugin.load.

◆ delim

char delim

The (preferred) delimiter of values when represented in external strings.

◆ formatAttrAlignment

String formatAttrAlignment

If set, attributes written in multi-lines are vertically aligned by this character or string. Use cases are "=", ":" or "->".
Used by IniFile and potentially by custom plug-ins.

◆ formatHints

int formatHints

Hints for formatting textual configuration files. (Used by class IniFile and potentially by custom plug-ins.

◆ name

String name

The name of the variable.


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