libstud-json

[full]

JSON pull-parser/push-serializer library for C++

A portable, dependency-free, MIT-licensed JSON pull-parser/push-serializer library for C++.

The goal of this library is to provide a pull-style parser (instead of push/SAX or DOM) and push-style serializer with clean, modern interfaces and conforming, well-tested (and well-fuzzed, including the serializer) implementations. In particular, pull-style parsers are not very common, and we couldn't find any C++ implementations that also satisfy the above requirements.

Typical parser usage:

#include <iostream>

#include <libstud/json/parser.hxx>

int main ()
{
  using namespace stud::json;

  parser p (std::cin, "<stdin>");

  for (event e: p)
  {
    switch (e)
    {
    case event::begin_object:
      // ...
    case event::end_object:
      // ...
    case event::name:
      {
        const std::string& n (p.name ());
        // ...
      }
    case event::number:
      {
        int n (p.value<int> ());
        // ...
      }
    }
  }
}
... More
license MIT
project libstud
url github.com/libstud/libstud-json
topics C++JSONparsingserializationstreaming
1 Version
version 0.2.0
repository pkg:cppget.org/alpha
depends 0