LCONF LOGO

This file is part of the LCONF-Data-Serialization-Format-Standard Documentation.

Copyright (c) 2014 - 2015, peter1000 https://github.com/peter1000.

6. LCONF-Value-Types

The set of six main value types includes NOTSET, String, Boolean, Number, Date & Time and Range.

When Is A LCONF-Value Interpreted As One Of The LCONF-Value-Types ?

Only the corresponding LCONF-Schema-Definition determinates which LCONF-Value is interpreted as which LCONF-Value-Type.

6.1. TYPE_NOTSET

A TYPE_NOTSET Value is the Literal Name Token NOTSET and is used to indicate the lack of a value and is different from an Empty-Value. In a LCONF-Section it is the same as if that item was not specified at all and the implemented default value will stay assigned.

The main difference between an Empty-Value and TYPE_NOTSET is:

Only simple LCONF-Structures MAY contain TYPE_NOTSET values:

It is most useful in STRUCTURE_TABLEs if there are missing data.

___SECTION :: 4 :: LCONF :: example Value Not Set

first :: John
last :: Doe
age :: NOTSET

| people_table
    # name  | height_cm | weight_kg | age    |
    | Tim   | 178       | 86        | 37     |
    | Paula | 156       | NOTSET    | NOTSET |
    | John  | 186       | 84        | 23     |
    | Dora  | 173       | NOTSET    | 45     |

- color_name_list
    Red
    Blue
    NOTSET
    Green

- color_name_list :: Red, Blue, NOTSET, Green
___END

LCONF-Template-Structure usually will implement a TYPE_NOTSET Values as None, nothing, void.

TYPE_NOTSET is also special that it can be used in a LCONF-Section in place of any other expected Value Type. NOTE: A LCONF-Schema-Definition can define that an item is required: which means it can not be set to TYPE_NOTSET.

6.2. String

There a three subtypes of Strings.

6.2.1 TYPE_STRING

A sequence of zero or more Unicode characters. It never spans multiple lines.

key1 :: This is a string value of a STRUCTURE_PAIR.

- example_list
    This is a string value of a STRUCTURE_LIST.
    This is another string value of the same STRUCTURE_LIST.

NOTE: LCONF-Schema-Definition can further constrain TYPE_STRING e.g: require a minimum and/or maximum number of chars.

6.2.1 TYPE_DIGITS

A TYPE_STRING constraint to only LCONF_DIGITS (zero or more LCONF_DIGITS). These can be used for very long Digit sequences for e.g Unique Identity Numbers which will be kept as string values.

key1 :: 19453841344987531223565469

NOTE: LCONF-Schema-Definition can further constrain TYPE_DIGITS e.g: require a minimum and/or maximum number of chars.

6.2.2 TYPE_PATTERN_DIGITS

A TYPE_STRING constraint to a pattern where only the individual LCONF_DIGITS MAY change. (zero or more chars). These can be used for common pattern for e.g Social Security number which will be kept as string values.

TYPE_PATTERN_DIGITS format uses the LCONF_AT_SIGN @ as placeholder for expected digits.

1. Example: the LCONF-DateTime type could be also represented by a TYPE_PATTERN_DIGITS

@@@@-@@-@@T@@:@@:@@

2013-07-01T12:30:59

@@@@-@@-@@ @@:@@:@@

2013-07-01 12:30:59

2. Example: Social Security number

AAA-GG-SSSS could be a pattern @@@-@@-@@@@

123-55-6678

6.3. TYPE_BOOLEAN

LCONF_TRUE or LCONF_FALSE. Literal Name Token: true or false.

item1 :: true

item2 :: false

A LCONF-Template-Structure usually will implement an Empty TYPE_BOOLEAN Values as TYPE_NOTSET.

6.4. Numbers

6.4.1. TYPE_INTEGER

A TYPE_INTEGER MUST contain only LCONF_DIGITS. It MAY have a preceding LCONF_PLUS or LCONF_MINUS.
64 bit (signed long) range expected (-9223372036854775808 to +9223372036854775807).

key1 :: 89

- example_list
    +18950
    0
    -800000

LCONF-Template-Structure usually will implement an Empty LCONF-Integer Values as TYPE_NOTSET or a predefined Integer (e.g. zero)

NOTE: LCONF-Schema-Definition can further constrain TYPE_INTEGER e.g: require a minimum and/or maximum value.

6.4.2. TYPE_FLOAT

TYPE_FLOAT supports four different notations:

LCONF-Template-Structure usually will implement an Empty TYPE_FLOAT as TYPE_NOTSET or a predefined Float (e.g. 0.0).

NOTE: LCONF-Schema-Definition can further constrain TYPE_FLOAT e.g: require a minimum and/or maximum value.

6.4.2.1. Fractional Notation

A TYPE_INTEGER part followed by a LCONF-Number-Fractional-Part.

key1 :: +1.0

- example_list
    -0.01
    3.1415

6.4.2.2. Exponent Notation

A TYPE_INTEGER part followed by a LCONF-Number-Exponent-Part.

key1 :: 5e+22

- example_list
    -1e6
    -2E-2

6.4.2.3. Fractional And Exponent Mixed Notation

A TYPE_INTEGER part followed by a LCONF-Number-Fractional-Part followed by a LCONF-Number-Exponent-Part.

key1 :: 6.196E63

- example_list
    -1.54e-003
    -1.54e+003
    2.5e-4

6.4.2.4. Fraction P/Q Of Two Integers Notation

A TYPE_INTEGER part followed by a LCONF_SLASH followed by a TYPE_INTEGER part which MUST NOT be equal to 0 (zero).

key1 :: +3/4

- example_list
    -93/16
    1/8
    2789/-598

6.4.3. TYPE_NUMBER

A TYPE_NUMBER value can either be a TYPE_INTEGER or TYPE_FLOAT.

- example_valid_number_list
    -93/16
    1/8
    2789/-598
    -1.54e-003
    -1.54e+003
    2.5e-4
    5
    -189556
    +23
    -0.01
    3.1415

NOTE: LCONF-Schema-Definition can further constrain TYPE_FLOAT e.g: require a minimum and/or maximum value.

6.5. Date & Time

A LCONF Date & Time value is based on the ISO 8601 standard and supports following notations.

A LCONF-DateTime value is a combination of a LCONF-Date and LCONF-Time and has the LCONF-Date-Time-Separator between the Date and Time part.

LCONF-Template-Structure usually will implement an Empty LCONF Date & Time Value as TYPE_NOTSET or a predefined Date & Time Value (e.g. 1970-01, 1970-01-01, 00:00:00, 1970-01-01T00:00:00, 1970-01-01 00:00:00).

6.5.1. TYPE_MONTH

YYYY-MM:

1932-08

2015-01

6.5.2 TYPE_DAY

YYYY-MM-DD:

1932-08-31

2014-11-15

6.5.3. TYPE_MINUTE

hh:mm:

12:30

23:59

6.5.4. TYPE_SECOND

hh:mm:ss:

02:30:42

19:00:02

6.5.5. TYPE_SECOND_FRACTION

hh:mm:ss.fff:

StartFractionSecond :: 12:30:59.001

StartFractionSecond :: 18:53:16.1

StartFractionSecond :: 04:02:00.000156

6.5.6. TYPE_DAY_MINUTE1

YYYY-MM-DD hh:mm

2013-07-01 12:30

6.5.7. TYPE_DAY_MINUTE2

YYYY-MM-DDThh:mm

2013-07-01T12:30

6.5.8. TYPE_DAY_SECOND1

YYYY-MM-DD hh:mm:ss

2013-07-01 12:30:59

6.5.9. TYPE_DAY_SECOND2

YYYY-MM-DDThh:mm:ss

2013-07-01T12:30:59

6.5.10. TYPE_DAY_SECOND_FRACTION1

YYYY-MM-DD hh:mm:ss.fff

2013-07-01 12:30:59.001

2013-07-01 18:53:16.1

2013-07-01 04:02:00.000156

6.5.11. TYPE_DAY_SECOND_FRACTION2

YYYY-MM-DDThh:mm:ss.fff

2013-07-01T12:30:59.001

2013-07-01T18:53:16.1

2013-07-01T04:02:00.000156

6.6. Range

A range defines an arithmetic sequence where the first element is the LCONF-Range-Start-Number.

LCONF-Template-Structure usually will implement an Empty LCONF-Range Value as TYPE_NOTSET or a predefined LCONF-Range Value.

LCONF supports two types of ranges.

6.6.1. TYPE_RANGE_OF_ELEMENTS

A TYPE_RANGE_OF_ELEMENTS refers to an arithmetic sequence which contains as many elements as defined by the LCONF-Integer part of the LCONF-Range-Number-Of-Elements.

A TYPE_RANGE_OF_ELEMENTS MUST:

text LCONF-Range-Start-Number|LCONF-Range-Step-Number|LCONF-Range-Number-Of-Elements

-10|1|*21

512.4|0.125|*8

6.6.2. TYPE_RANGE_BY_END_VALUE

A TYPE_RANGE_BY_END_VALUE defines an arithmetic sequence where the first element is the LCONF-Range-Start-Number.

A TYPE_RANGE_BY_END_VALUE supports following notations:

A TYPE_RANGE_BY_END_VALUE MUST:

6.6.2.1. Positive LCONF-Range-Step-Number

If the LCONF-Range-Step-Number value is greater than zero then the LCONF-Range-Start-Number MUST be less or equal to the LCONF-Range-End-Number.

The last element is the largest: Start-Number + i * Step-Number less or equal to LCONF-Range-End-Number.

-10|1|5

-10|1|5|FORCE

100.8|1.27|106

100.8|1.27|106|FORCE

6.6.2.2. Negative LCONF-Range-Step-Number

If the LCONF-Range-Step-Number value is less than zero then the LCONF-Range-Start-Number MUST be greater or equal to the LCONF-Range-End-Number.

The last element is the smallest: Start-Number + i * Step-Number greater or equal to LCONF-Range-End-Number.

10|1|-5

10|1|-5|FORCE

100.8|-1.27|92.1

100.8|-1.27|92.1|FORCE