libee 0.3.0
Public Member Functions

ee_int Class Reference

#include <int.h>

Public Member Functions

int  ee_intDec (ee_ctx ctx, int(*cbGetLine)(es_str_t **ln), int(*cbNewEvt)(struct ee_event *event), es_str_t **errMsg)

Detailed Description

The internal format is a very basic but easy to write and handle event representation. Its primary purpose is to help with testing libee.

Events are represented in plain text files, which should be handable as usual text files.

The format is line-oriented. Each line has exactly one meaning (being a field name or value) or is a comment. Position within file is important.

each line consits of three parts:

Field types: # - comment e - start of a new event, value is ignored f - start of a new field, value is field name v - value is a field value for the last defined field

It is invalid to have a "v" record type without a f directly in front of it. It is valid to have fields without values (assuming this is permitted for the field in question in the schema, if validation is active).

Values: UTF-8 encoded, but characters 0x0-0x1f, 0x7f must be escaped. Within the value, C escape sequences are supported, with the most important ones being (Note: double backslashes are for Doxygen, of course this is to be used with single backslashes):

Sample: # event with two fields e: f:field1 v:This a test
v:Multiple values f:field2 v:single value for this field

Member Function Documentation

int ee_intDec ( ee_ctx  ctx,
int(*)(es_str_t **ln)  cbGetLine,
int(*)(struct ee_event *event)  cbNewEvt,
es_str_t **  errMsg 

Decode an internal representation into a CEE structure.

The interface is heavily callback-based. The idea is to provide greatest flexibility by doing so.

[in] ctx library context to use
[in] cbGetLine get next line to be processed. Returns 0 if all went well, EE_EOF at end of file and something else otherwise.
[in] cbNewEvt callback for function that receives newly created events. It must return 0 on success and something else otherwise.
[out] errStr printable error message, provided only if an error occurs. If so, the caller must delete the provided pointer.
0 on success, something else otherwise

The documentation for this class was generated from the following files: