FIX/FAST decode/encode facility
Switch branches/tags
Nothing to show
Pull request Compare This branch is 108 commits behind dmitryme:master.
Latest commit aa8368a Oct 4, 2010 @dmitryme dmitryme TODO updated
Permalink
Failed to load latest commit information.
doc create context from XML string has been added Sep 27, 2010
include decoding has beed simplified Sep 24, 2010
src comments added Oct 3, 2010
test TODO updated Oct 4, 2010
Emakefile initial commit Aug 23, 2010
Makefile byteVector unicode decoding added Sep 3, 2010
README README changed Oct 3, 2010
TODO TODO updated Oct 4, 2010
run_tests initial commit Aug 23, 2010

README

FAST decoding/encoding has been implemented.

Example of usage:

decode_one_message() ->
   % create context. Assume FAST templates are saved into templates.xml file
   Context = erlang_fast:create_context({file, "templates.xml"}, fun logger/2),

   % read FAST encoded data from data.fast
   {ok, Data} = file:read_file("data.fast"),

   % Context1 and Data1 shall be used for decoding next messages, if needed
   {Msg, Data1, Context1} = erlang_fast:decode(Data, Context),
   io:format("Decoded message is ~p~n", [Msg]).

encode_one_message() ->
   % create context. Assume FAST templates are saved into templates.xml file
   Context = erlang_fast:create_context({file, "templates.xml"}, fun logger/2),

   % Msg is in format of previously decoded message
   {Data, Context1} = erlang_fast:encode(Msg, Context),

   io:format("Encoded data: ~p", [Data]).

logger([], _) ->
   ok;
logger(Err, Val) ->
   io:format("~p: ~p~n", [Err, Val]).