Fix nlohmann_json error with old versions.
continuous-integration/drone/push Build is passing Details

Old versions of nlohmann_json do not have support for std::string_view,
std::filesystem::::path(?) and std::pair(?).
This commit is contained in:
tastytea 2021-06-01 21:17:29 +02:00
parent ba2161fa47
commit de2001a442
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 3 additions and 3 deletions

View File

@ -117,17 +117,17 @@ void json_all(const std::vector<std::vector<search::match>> &matches_all)
{
nlohmann::json json;
json["generator"] = {{"epubgrep", version}};
json["generator"] = {{"epubgrep", std::string(version)}};
for (const auto &matches : matches_all)
{
for (const auto &match : matches)
{
json["matches"].push_back(
{{"filepath_epub", match.filepath_epub},
{{"filepath_epub", match.filepath_epub.string()},
{"filepath_inside", match.filepath_inside},
{"match", match.text},
{"context", match.context},
{"context", {match.context.first, match.context.second}},
{"headline", match.headline},
{"page", match.page}});
}