Git Product home page Git Product logo

json_parser's Introduction

JSON Parser

This is a simple, light weight JSON parser built on top of jsmn.

Files

  • src/json_parser.c: Source file which has all the logic for implementing the APIs built on top of JSMN
  • include/json_parser.h: Header file that exposes all APIs
  • test/main.c: A test file which demonstrates parsing of a pre-defined JSON
  • Makefile: For generating the test executable

Usage

Clone the repository using: git clone --recursive https://github.com/shahpiyushv/json_parser.git

Note: The --recursive argument is important because json_parser has jsmn as a git submodule, which will get cloned with the --recursive argument. If you forget it, just execute git submodule update --init --recursive from json_parser/.

Include the src/json_parser.c and include/json_parser.h files in your project's build system and that should be enough. json_parser requires only standard library functions and jsmn for compilation.

Testing

  • To compile the test executable, just execute make.
  • This will create json_parser binary.
  • Running the binary should print the parsed information
./json_parser
str_val JSON Parser
float_val 2.000000
int_val 2017
bool_val false
Array has 6 elements
index 0: bool
index 1: int
index 2: float
index 3: str
index 4: object
index 5: array
Found object
objects true
arrays yes
int64_val 109174583252

To cleanup the app, execute make clean

json_parser's People

Contributors

shahpiyushv avatar

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.