Skip to content

JoshOY/C-JSON-joshoy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C-JSON by JoshOY

What's this

A light weight JSON parser, which is the course project of C programming, Tongji Univ.
The library provides some interfaces for parsing JSON.
I made some changes and it can format JSON with standard formation.

for example, here's a JSON with terrible format:

[1,    2, {
           "name" :    "JoshOY",
      major   :  "SE"
}]

And it can format into

[
	1,
	2,
	{
		"name": "JoshOY",
		"major": "SE"
	}
]

How to get it

$ git clone https://github.com/JoshOY/C-JSON-joshoy.git
$ cd C-JSON-joshoy
$ make

And that's done.

How to use it

Here are the commands:

-h Show the info.
-p Parse a JSON string in argument and print it in console with no spaces.
-r Read JSON from a file and print it in console with no spaces.
-w Write the buffer JSON into a file with format. The buffer comes from -p or -r and if you
there's no parsed JSON it will create a 'null' JSON instead.
For example, './C-JSON -r ./input.json -w ./output.json'

Type ./C-JSON -h for some more information.

License

MIT License

About

JSON parser with C codes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published