Skip to content

ananthvk/json-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonparser

This is an implementation of a JSON parser in C++. I built this as a learning project on parsing.

Features

  • Parses any valid JSON into a C++ tree
  • Multiline strings are supported

Differences from JSON Spec

  • Leading zeroes in numbers are allowed
  • Line breaks can appear within strings (multiline strings)
  • Control characters (i.e. tab character) can appear within strings
  • No depth limit

TODO

  • Implement unicode escapes
  • Implement a parameter to limit depth
  • Figure out a way for automatic type conversions
  • Make it more efficient, for example by using move

How to run

Prerequisities: A C++ 17 Compiler

Firstly, install meson and ninja

Clone the repository

$ git clone https://github.com/ananthvk/json-parser
$ cd json-parser

Then build and run the tests

$ meson setup builddir
$ cd builddir
$ ninja -j8 test

On windows

C:\> git clone https://github.com/ananthvk/json-parser
C:\> cd json-parser
C:\> meson setup -Ddefault_library=static builddir
C:\> cd builddir
C:\> meson test -v

Note: When running with MSVC, make sure to specify library type as static.

Notes

I got this idea from this website

About

A JSON parser library for C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published