GitHub - Neyn/neyson: Lightweight C++11 JSON Library (original) (raw)

Neyson

image

Neyson is a lightweight C++11 library for handling JSON, XML, and (optionally) SQLite. Originally focused on JSON parsing (RFC 8259-compliant), Neyson has grown into a versatile toolkit that simplifies manipulating multiple data formats. Its intuitive API makes it easy to parse, write, and work with structured data in your C++ projects.

Features

Build & Install

Neyson can be built as a standalone library or included directly in your project. Below are detailed steps to build and install from source.

1. Clone the Repository

git clone https://github.com/Neyn/neyson.git cd neyson

2. Create a Build Directory

3. Configure and Build

Use CMake to configure the build. You can optionally control:

For example, to build a Release version without tests:

cmake -DCMAKE_BUILD_TYPE=Release -DNEYSON_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local .. cmake --build .

4. Install

The sudo may or may not be necessary, depending on the system and the installation path. This step installs the Neyson headers and library files into your chosen prefix.

CMake Submodule

You can integrate Neyson in your own CMake-based project in two main ways:

1. Installed Package

If you installed Neyson (see above), simply do:

find_package(neyson REQUIRED)

add_executable(myexec main.cpp) target_link_libraries(myexec neyson::neyson)

CMake will locate the library and headers from your install prefix via find_package.

2. Add as a Subdirectory

If you prefer not to install system-wide or want to version-control Neyson within your project:

Assuming the 'neyson' folder is inside your project tree

add_subdirectory(neyson)

add_executable(myexec main.cpp) target_link_libraries(myexec neyson::neyson)

Adjust paths as needed. This approach keeps dependencies self-contained.

Usage and Documentation

The documentation is available here.

Tests

If you want to run the included test suite, enable tests when configuring:

cd neyson mkdir build && cd build cmake -DNEYSON_BUILD_TESTS=ON .. cmake --build . ./Tests

This runs unit tests covering JSON, XML, and SQLite functionality (if SQLite is enabled).

Contributing

Issues, bug reports, feature requests, and pull requests are welcome! You can submit them on the project’s issues page. Please start a discussion about pull requests before you send them on the issues page.

License

Neyson is released under the BSD 3-Clause permissive license, allowing you to use, modify, and distribute it freely for both open-source and commercial projects. You can find the full text in the LICENSE file.