From the course: Code Clinic: C++

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Generate JSON output file

Generate JSON output file - C++ Tutorial

From the course: Code Clinic: C++

Start my 1-month free trial

Generate JSON output file

- Once my program has found the faces in an image it saves the results to a json file. When I open it I see that it contains two fields, count faces six which is how many faces were found in the image and image location which is the absolute file path to the image analyzed. Creating this json file requires a separate library since the standard C++ library doesn't natively support reading or writing json files. To find a library, I visited json.org, which has an extensive list of available libraries that provide json support in various languages. Scrolling down available libraries I see that there are many written for C++. For this challenge, I chose to use the json cpp library because it has a fairly simple one with good documentation. To use it, I downloaded the zip from the getjub and unzipped it to a desired location on my computer. To use the library in my project I followed the instructions for generating the amalgamated…

Contents