This is a modern, opinionated, multi-platform, multi-threaded C++11 project that parses JSON files. It is intended for educational purposes and as a starting point for new projects. Go build something awesome in modern C++!
This project is named K-9 because I was thinking about dogs.
The author, Terris Linenbach, makes no promises about the contents herein and is not responsible for anything. Use at your own risk. Void where prohibited.
If you're using OSX, run the 'osx' script. Otherwise, install the following:
- Abseil for writing modern C++ that works with older C++ 11 parsers
- GoogleTest for unit testing and mocking
- nlohmann/json for parsing JSON
- gabime/spdlog for logging
- Linux only: erikzenker/inotify-cpp for listening for filesystem events
- Uses Boost via nelhage/rules_boost, thus demonstrating how to use Boost in your own project or use a dependency that uses Boost
This project was created via the Abseil Bazel Quickstart on March 2019.
PR's are welcome. Please obey the .editorconfig file.
Bazel is IMO the best C++ build tool available today. On the other hand, CMake is the most popular. Nobody appears to be using boost-build besides Boost.
I chose Bazel (by Google) because it works well with Abseil and GoogleTest (also by Google). Although Bazel is tricky to configure, CMake is worse. Bazel is well documented for my needs but beware old examples that use deprecated features.
The hardest part was getting a 2019 version of Bazel working with nlohmann/json, which doesn't use Bazel. I started with https://github.com/nathanws/bazel-examples but it is out date and required literally hours (not days, at least) of trial and error. The WORKSPACE file herein is a working example that will assist you greatly when adding dependencies that don't use Bazel.
bazel clean --expunge
bazel test //:k9-test
bazel build -s //:k9-test
Currently just exits
bazel run //:k9 -- arg1 arg2 arg3
- vscode-bazel
- C/C++ (Microsoft)
- C/C++ Advanced Lint
- See also
- To disable the warning about flexlint, add this to your settings:
- "c-cpp-flylint.flexelint.enable": false
- Clang-Format
- EditorConfig
- Rainbow Brackets
- GitLens
- Git History
- Generate SHA256 hash from a URL https://hash.online-convert.com/sha256-generator
- Doxygen-to-HTML
- Lint
- Automatically format source code
- Get rid of the OSX-only warning:
clang: warning: argument unused during compilation: '-pthread'