summaryrefslogtreecommitdiff
path: root/src/utils/cpp/json.hpp
AgeCommit message (Collapse)Author
2024-04-11json: support pruningKlaus Aehlig
... by removing from an object the outer keys where the value is null.
2024-03-26Add missing system includesPaul Cristian Sarbu
Main culprits: - std::size_t, std::nullptr_t, and NULL require <cstddef> - std::move and std::forward require <utility> - unordered maps and sets require respective includes - std::for_each and std::all_of require <algorithm>
2023-08-28fmt: Specialize formatter only for version >= 10Oliver Reiche
2023-08-28Add explicit fmt::formatter for nlohmann::basic_jsonMichael Thies
The formatter is based on fmt's ostream_formatter, using the provided operator<<(std::ostream&) of nlohmann::basic_json. This is required to allow compilation against fmt 10.x Co-authored-by: Oliver Reiche <oliver.reiche@huawei.com>
2023-04-26imports: Switch to Microsoft GSL implementationOliver Reiche
... with two minor code base changes compared to previous use of gsl-lite: - dag.hpp: ActionNode::Ptr and ArtifactNode::Ptr are not wrapped in gsl::not_null<> anymore, due to lack of support for wrapping std::unique_ptr<>. More specifically, the move constructor is missing, rendering it impossible to use std::vector<>::emplace_back(). - utils/cpp/gsl.hpp: New header file added to implement the macros ExpectsAudit() and EnsureAudit(), asserts running only in debug builds, which were available in gsl-lite but are missing in MS GSL.
2022-10-12Add copyright and license notice to all source and header filesKlaus Aehlig
Signed-off-by: Goetz Brasche <goetz.brasche@huawei.com>
2022-08-02Utils: Drop ill-formed audit checks for truncating JSONOliver Reiche
2022-06-29util: support abbreviating jsonKlaus Aehlig
To an intended number of characters by leaving out the parts after a given depth. As the correct depths has to be determined, the JSON value is serialized several times; hence the method is slow, but acceptable for the generation of error messages.
2022-04-25json utils: support indentation up to a given depthKlaus Aehlig
2022-03-23Apply changes suggested by clang-tidy 11Oliver Reiche
2022-03-23Apply changes suggested by clang-format 11Oliver Reiche
2022-02-25Format: Apply alphabetical include orderOliver Reiche
2022-02-22Initial self-hosting commitKlaus Aehlig
This is the initial version of our tool that is able to build itself. In can be bootstrapped by ./bin/bootstrap.py Co-authored-by: Oliver Reiche <oliver.reiche@huawei.com> Co-authored-by: Victor Moreno <victor.moreno1@huawei.com>