An open API service indexing awesome lists of open source software.

https://github.com/nowisesys/libfoa

C library implementing the FOA (Fast Object and Array) encoding/decoding specification.
https://github.com/nowisesys/libfoa

c-library encoder-decoder foa

Last synced: about 1 year ago
JSON representation

C library implementing the FOA (Fast Object and Array) encoding/decoding specification.

Awesome Lists containing this project

README

          

** LIBFOA - Fast Object and Array encoding/decoding library **

** GENERAL:

This is a library implementing the FOA encoding/decoding method. FOA was
primarly designed to be used as an alternative to XML for data exchange
between i.e. web services.

Other domains are network protocol using FOA for encode/decode object
oriented messages or serializing objects to storage (letting you write
objects in i.e. C/C++ and read them back in Java).

It can also be useful as an generic encoding format, like JSON. FOA has an
design that makes it useful for object/array streaming.

** SPECIFICATION:

The official FOA specification can be read at:
http://it.bmc.uu.se/andlov/proj/libfoa/spec.php

** LICENSE:

The FOA library is released under the Lesser GNU General Public License
(LGPL). That means you are allowed to use it in commercial applications.
However, as a free software developer I encourage you to release your
software under GPL or similar licenses.

** DESIGN:

The FOA encoding/decoding was primarly designed for efficient transfer of
objects and arrays between networked computers. It will never use more
memory than required by you longest single line of data to decode, so its
memory footprint is small.

** VALIDATION:

At current the library will *not* perform any validation except for some
simple checks. If you want validation, use foa_scan() or foa_next() to
implement you own lexical analyzer.

** ENCODING/DECODING:

The characters '(', ')', '[' and ']' are special to FOA. These are used
to denote the start and end of encoded object and arrays. See doc/README.FOA
for more information.

The assignment '=' character is another special char that is used to name
data, objects and arrays. By using '=' to name your data, it's possible to
encode a wide range of data structures, including hashes (Perl) or hash
arrays (PHP).

By naming an object or array at encoding, it's possible to tell the receiver
the type of object to decode as. This can be really useful when implementing
network protocols.

// Anders Lövgren, 2009-03-15