Data wrappers, The qot() wrapper, The u08() wrapper – Grass Valley K2 Edge Protocol Manual v1.0 User Manual

Page 52

Advertising
background image

K2 Edge Protocol Manual – document version 1.0 – Page 52

8.6. Data wrappers

The complex string format allows for data to be wrapped by a number of wrapper functions. An example:

{ count=42; text=#qot(Hello world!)toq#; }

This example demonstrates the

qot() wrapper that quotes the text between parenthesis to prevent it

from being misinterpreted by a complex string parser.

Wrapper functions apply to the following rules:

1. Wrapper functions always start with a

# sign at the first character of value part, right after the = sign.

2. Next, a three-letter function name (currently either

qot or u08)

3. Next, the open parenthesis, emulating a function calls like construct.

4. Next the data being wrapped, Hello world! in our example.

5. And finally 1, 2 and 3 mirrored, as shown in the example above.

8.6.1. The qot() wrapper
The qot() wrapper function quotes the wrapped text, preventing the complex string parser from

misinterpreting the text for formal language.

For example:

text=#qot(one;two;three)toq#;

As a general rule,

qot() should be used with any free-from text as it may contain characters that have a

special meaning in the complex string format syntax.

8.6.2. The u08() wrapper
The

u08() wrapper function is used to store UTF8 (8-bit) data in a field, and prevents the complex string

parser from misinterpreting the wrapped text (just like

qot).

An example:

text=#u08(hello world)80u#;

Advertising