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 Struct 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 struct does not provide further logic.

Public Fields

String Category
 
AString CategoryFallback
 
String Comments
 
String DefaultValue
 
char Delim
 
String FormatAttrAlignment
 
Variable.FormatHint FormatHints
 
String Name
 

Public Methods

 VariableDecl (AString categoryFallback, String category, String name, String defaultValue, char delim, String formatAttrAlignment, Variable.FormatHint formatHints, String comments)
 

Constructor & Destructor Documentation

◆ VariableDecl()

VariableDecl ( AString  categoryFallback,
String  category,
String  name,
String  defaultValue,
char  delim,
String  formatAttrAlignment,
Variable.FormatHint  formatHints,
String  comments 
)
inline

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 cs.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

Variable.FormatHint 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 struct was generated from the following file: