CommuniGate Pro
Version 5.1
Applications
 
 
 
Data

Data Formats

The CommuniGate Pro Server processes most types of data as generic objects. This section describes the generic, fundamental object types used in all Server components.

For each object type, a textual representation of the object data is specified.

When an object is stored in a file, sent in a CLI/API command response, or extracted from the Server in any other way, the object textual representation is used.

When the Server reads an object from outside (from a settings file, from a CLI command, etc.), it converts the provided textual representation into an internal object.

Strings

Strings are basic, unstructured textual data objects.

A textual representation of a string is either an atom - a sequence of latin letters (in the ASCII encoding) and digits, or a quoted string - a sequence of any printable symbols (using the UTF-8 encoding) except the quotation mark and the backslash symbol, enclosed into the quotation marks (").
Examples:
MyName   My2ndName   "My Name with spaces and the . symbol"
If you want to include the quotation mark symbol into a quoted string, include the backslash symbol and the quotation mark, if you want to include the backslash symbol into a quoted string, include two backslash symbols.
Examples:
"a \"string\" within string"   "Single \\ backslash"
You can use the \r symbol combination to include the carriage-return symbol into a string, you can use the \n symbol combination to include the line-feed symbol into a string, and your can use the \e symbol combination to include the system-independent End-Of-Line symbol(s) into a string.
Examples:
"Line1\eLine2"   "TEXT3\rTEXT67\nTEXT78"
Use the \r or \n combinations to include the carriage-return and line-feed characters only when they are NOT used as line separators.
You can use the \t symbol combination to include the tabulation symbol into a string.
Example:
"Line1:\tField1\tField2\eLine2:\tField1\tField2"
You can use the \nnn symbol combination to include any symbol into a string, if nnn is a 3-digit decimal number equal to the ASCII code of the desired symbol.
Example:
"Using the \012 (Vertical Tabulation) symbol"

DataBlocks

DataBlocks are basic, unstructured blocks of binary data. They are composed as text strings with the Base64 encoding of binary data enclosed into brackets.
Example:
[HcqHfHI=]
this is a binary block containing the following 5 binary data bytes: 0x1D 0xCA 0x87 0x7C 0x72

Numbers

Numbers are basic, unstructured data objects. Each Number object contains one 64-bit signed integer value. A Number is presented as a text string starting with the # symbol, followed by an optional minus (-) symbol, followed by 1 or more decimal digits.
Example:
#-234657

Time Stamps

Time Stamps are basic, unstructured data objects. Each Time Stamp object contains one global time value. The time value is presented in GMT time, as a text string starting with the #T symbols, and containing the day, months, year, and, optionally, the hour, minute, and the second values.
Example:
#T22-10-2007_15:24:45

IP Addresses

IP Addresses are basic, unstructured data objects. Each IP Address object contains an IPv4 or IPv6 address, and, optionally a port number. The IP Address is presented as a text string starting with the #I symbols, and containing the canonical IPv4 or IPv6 address, optionally followed by the port number.
Examples:
#I[10.0.44.55]:25  #I[2001:470:1f01:2565::a:80f]:25

Arrays

An array object is an ordered set of objects (array elements).

Array textual representation is a list of its element representations, separated with the comma (,) symbols, and enclosed into the parentheses.
Example:
(Element1 , "Element2" , "Element 3")
An array element can be any object - a string, an array, a dictionary, etc.
Example:
(Element1 , ("Sub Element1", SubElement2) , "Element 3")
Any number of spaces, tabulation symbols, and/or line breaks (end-of-line symbols) can be placed between a parenthesis and an element, and between an element and a comma symbol.
Example:
(
  Element1  ,
  (    "Sub Element1",
   SubElement2  )
  ,
"Element 3"  )
An array may have zero elements (an empty array).
Example:
()

Dictionaries

A dictionary object is a set of key-value pairs. Dictionary keys are strings. Each key in a dictionary should be unique. The dictionary keys are processed as case-sensitive strings, unless explicitly specified otherwise.

Any object can be used as a value associated with a key.

A dictionary textual representation is a sequence of its key value pairs, enclosed into the curvy brackets.
Each pair is represented as its key string representation, followed by the equal (=) symbol, followed by the textual representation of the associated value object, followed by the semicolon (;) symbol.
Example:
{Key1=Element1; Key2 ="Element2" ; "Third Key"="Element 3"; }

The value object in any key-value pair can be a string, an array, a dictionary, or any other object.

Example:
{Key1=(Elem1,Elem2); Key2={Sub1="XXX 1"; Sub2=X245;}; }

Any number of spaces, tabulation symbols, and/or line breaks (end-of-line symbols) can be placed between a bracket and a pair, around the equal symbol, and around the semicolon symbol.

Example:
{
 Key1  =   (Elem1,Elem2)   ;
 Key2 = {  Sub1 = "XXX 1";
    Sub2=X245;  };
}

A dictionary may have zero elements (an empty dictionary).

Example:
{}

Syntax Rules

Below is the formal syntax definition for textual representations of the basic type objects.

d-digit ::= 0 .. 9
h-digit ::= d-digit | A | B | C | D | E | F
a-symbol ::= A .. Z | a .. z | d-digit
l-symbol ::= a-symbol | . | _
atom ::= 1* l-symbol
b-symbol ::= a-symbol | + | / | =
s-symbol ::= any printable symbol except " and \ | \\ | \" | \r | \n | \e | \ d-digit d-digit d-digit
string ::= " 0* s-symbol " | atom
datablock ::= [ 1* b-symbol ]
day ::= 0 .. 3 d-digit (2-digit number in the 1..31 range)
month ::= 0 .. 1 d-digit (2-digit number in the 1..12 range)
year ::= 1 .. 2 d-digit d-digit d-digit (4-digit number in the 1970..2038 range)
hour ::= 0 .. 2 d-digit (2-digit number in the 0..23 range)
minute ::= 0 .. 5 d-digit (2-digit number in the 0..59 range)
second ::= 0 .. 5 d-digit (2-digit number in the 0..59 range)
number ::= # [ -] 1* d-digit
timestamp ::= # T day - month - year [ _ hour : minute : second ]
ip4 ::= 1* d-digit . 1* d-digit . 1* d-digit . 1* d-digit
ip6 ::= 0*(1* h-digit :) [: [ 0*(1* h-digit :) ] ]
ip-address ::= # I[ [ip4 | ip6] ] [ : 1*d-digit ]
array ::= ( [object 0*( , object ) ] )
dictionary ::= { 0*( string = object ; ) }
object ::= string | datablock | number | timestamp | ip-address | array | dictionary

CommuniGate® Pro Guide. Copyright © 1998-2007, Stalker Software, Inc.