This JSON parser was created from scratch, the parsing part being taken from my pure C version of this project.
To build the program, first clone it from GitHub :
git clone https://github.com/Aeldit/JsonParserCPP.git
Then, enter the following commands
./configure
make json-parser
./json-parser <your_json_file.json>
The configure script accepts the following options :
S
: Runs the script with the-fsanitize=address
g++ flag (checks for memory leaks)D
: Displays some debug informationsSD
orDS
: Use both options
Base rules :
all
: compiles and runs the program with the filer.json
clean
: removes the executable (this rule is called by all the other excepttests
)test
: runs some miscellaneous tests
Valgrind rules :
valgrind-compile
: compiles the parser with the-DVALGRING_DISABLE_PRINT
flag (disables the printing functions to only have the time of the parsing functions when using a profiler)valgrind
: callsvalgrind-compile
and generates a callgrind file usable by theKCachegrind
profiling softwareleaks
: checks for leaks but using valgrind (using the filer.json
)
You can change some defines directly at compilation time, depending on your use of this parser
Defines the maximum size of the allocated buffer that is used to store the file (defaults to 2 << 30
, which is roughly equals to 1GB)
Defines the maximum number of nested arrays (defaults to UINT_FAST8_MAX
)
If you want to change this, you can use the following additional flag
-DMAX_NESTED_ARRAYS=<your_value>
Defines the maximum number of nested dict objects (defaults to UINT_FAST8_MAX
)
If you want to change this, you can use the following additional flags
-DMAX_NESTED_DICTS=<your_value>