Jigson is a header-only C++ library that facilitates mapping between JSON data and C++ class objects. The name is a play on "Jigsaw" and "JSON", reflecting its purpose of piecing class objects together from JSON data.
- Header-only library for easy integration
- Depends on nlohmann-json for JSON parsing
- Supports C++20
- Provides intuitive mapping between JSON and C++ objects
- C++20 compatible compiler
- nlohmann-json library
-
Clone the repository:
-
Copy the
Jigson.hpp
file to your project's include directory. -
Make sure you have nlohmann-json installed and properly linked in your project.
You can install Jigson using vcpkg:
vcpkg install jigson
Include the Jigson header in your C++ file:
#include <jigson.hpp>
For detailed usage examples, please refer to the Examples
directory in this repository.## Examples
The examples
directory contains sample code demonstrating how to use Jigson for various JSON mapping scenarios. These examples include:1. Simple object mapping
- Nested object mapping
- Object mapping with lists
- Mapping with conditionals based on other field values
The tests
directory contains unit tests for Jigson. These tests use the Google Test framework and cover various aspects of the library's functionality.To run the tests:
- Make sure you have Google Test installed
- Build the test project
- Run the resulting test executable
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
This README provides an overview of Jigson, its features, installation methods (both manual and via vcpkg), basic usage, and information about the examples and tests. You may want to adjust some details based on your specific repository structure or add more sections as needed.