Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (20 sloc) 702 Bytes
layout title comments permalink categories tags
post
Creating a simple Boost JSON configuration reader
true
01102016-json-reader
boost
cpp
boost
json

This week, I had a need for a simple JSON reader.  I have re-used this pattern several times now so I figured that I would share it now. 

Header file: JsonConfig.hpp

{% gist d42d3d7bd9814d573acf %}

Source file: JsonConfig.cpp

{% gist ec4c06be2d05c195d87a %}

This file uses the Boost property tree object to do the configuration parsing.  An example consumer of this code is:

{% gist 5545312b7c21b97eaea5 %}

BOOM, that was easy!