Giter Club home page Giter Club logo

jesy's Introduction

JESy

JSON for Embedded Systems is a lightweight JSON library implemented for Embedded targets with some restrictions such as no dynamic memory allocations or limited stack size to support recursion. The goal is to make JESy fully conform to the [JSON](complies with RFC 8259 JSON standard,) standard.

JESy provides an API to parse JSON documents into a tree of JSON elements, manipulate the elements and then render the elements into a string.

Key features

  • No dynamic memory allocation. All objects will be stotred on a single working buffer.

  • Non-recursive parser.

  • Can process multiple JSON documents at the same time. The parser context is unique for each document and is mamintained on the working buffer.

  • It's fast since it doesn't copy any data from the source document.

  • No external dependencies

  • Configurable to support/overwrite duplicate keys

Usage

Parse a JSON string

#include "jesy.h"

const char input_data[] = "{ \"key1\": { \"key2\": \"some_value\" }}";
static uint8_t buffer[0x1000];
jesy_status err;

struct jesy_context *doc = jesy_init_context(buffer, sizeof(buffer));
if (!doc) {
    /* Error handling... */
    return;
}

if (0 != (err = jesy_parse(doc, input_data , sizeof(input_data)))) {
    /* Error handling... */
    return;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.