Giter VIP home page Giter VIP logo

simple_json's Introduction

simple_json

A free simple json library for C

No Dependencies beyond core C STD libraries.

View the documentation here.

This project is meant to add a simple way to parse json files into a lightweight data structure that can be used to store and retreive information parsed from a json file. The underlying datastructures are not optimized for memory management or fast access. The intent it to use the SJson type as a way to pull data out of a json file, but it is not supposed to be used when performance matters.

Key Features:

  • Loading and parsing text files containing json formatted string into the SJson data structure
  • Saving a SJson structure back into a correctly formatted json file
  • Echoing out the contents of the json structure to stdout
  • Creation tools to make Objects, Arrays, Strings, NULL, true/false, integers, and floats
  • Getters to pull the data from a SJson structure back out
  • Validation code to check if the data is as expected
  • When errors occur, get the internal message through sj_get_error()

Known limitations:

  • object key lookup is O(n).
  • save has no pretty option, only minified

Video Introduction

https://youtu.be/lJ8rVwn1j4M

simple_json's People

Contributors

engineeroflies avatar

Stargazers

 avatar

Watchers

 avatar  avatar

simple_json's Issues

bug: infinite seek issue

with a bad json file, the system doesn't check if it seeks beyond the bounds of the open file.

Extern C!

Wrap the headers in #ifdefined __cplusplus an extern it all as "C" to make it natively compatible for c++

Shorthand accessors

My naming convention is verbose for the sake of education, but it gets old. Should make shorthand aliases of major accessors like sj_object_get_string instead of sj_object_get_value_as_string...

Documentation: Revisit

Revisit the documentation to make sure it is all correct and clear
Put together some examples

crash on bad json

Do better error checking.
Log if it went wrong
return NULL overall

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.