본문 바로가기
C++

JSON Spirit: A C++ JSON Parser/Generator Implemented with Boost Spirit

by leo21c 2014. 5. 13.
SMALL

출처: http://www.codeproject.com/Articles/20027/JSON-Spirit-A-C-JSON-Parser-Generator-Implemented


관련 소스는 출처 사이트 참고~

Introduction

JSON is a text file format similar to XML, but less verbose. It has been called "XML lite". This article describes JSON Spirit, a C++ library that reads and writes JSON files or streams. It is written using the Boost Spirit parser generator. If you are already using Boost, you can use JSON Spirit without any additional dependencies.

Key features:

  • supports ASCII or Unicode
  • std::vector or std::map implementations for JSON Objects
  • object library or header file only use

Using the Code

The JSON Spirit source code is available as a Microsoft Visual Studio 2005 C++ "solution". However, it should compile and work on any platform compatible with Boost. JSON Spirit has been built and tested with Visual C++ 2005, 2008, 2010, and G++ version 4.2.3 on Linux. It has been tested with Visual C++ using Boost versions 1.34.0, 1.37.0, 1.39.0, and 1.42.0. It has also been tested with STLPort.

Platform independent CMake files are included, kindly supplied by Uwe Arzt, with CPack declarations for packaging and a "make install" target supplied by Amzlkej.

The Visual C++ solution consists of five projects:

  • The JSON Spirit library and header files
  • An application running the library's unit tests
  • Three small programs demonstrating how to use JSON Spirit

JSON Spirit Value

A JSON value can hold either a JSON array, JSON object, string, integer, double, bool, or null. The interface of the JSON Spirit Value class is shown below. The Value class for Unicode is analogous; for details, see the section on Unicode support.

LIST

'C++' 카테고리의 다른 글

IME 선택된 언어 확인하기  (0) 2014.09.05
floating point overflow 검사  (0) 2014.08.28
C++ Json Parser  (0) 2014.05.07
GetCurrentProcess function  (0) 2014.03.04
프로세스 메모리 사용량 확인 sample 프로그램 by MSDN  (0) 2014.03.04