Since this escaping policy will be common to all camera generated delimited strings (i.e. string arrays) it should be documented in one place and referenced in all descriptions. For the moment I am documenting it here.
SAL does not support string arrays, so in place of this we typically use a single string with a well defined delimiter between strings. For camera we typically use : as the delimiter. This causes problems if the delimiter occurs in one of the values, so we have adopted the following convention:
- If the delimiter occurs in a string value, it will be escaped with backslash (), e.g. \:
- If a backslash () occurs in the string value, it will also be escaped with a backslash, e.g.
Note: One shortcoming with this scheme is that there is no way to represent a zero length array, a single token or empty string is interpreted as a length one array.