Skip to content

Commit 5db7c73

Browse files
committed
Update vendor
1 parent b11c302 commit 5db7c73

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Diff for: tests/vendor/cget/pkg/pqrs-org__cpp-json/install/include/pqrs/json.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
// pqrs::json v1.6
3+
// pqrs::json v1.7
44

55
// (C) Copyright Takayama Fumihiko 2019.
66
// Distributed under the Boost Software License, Version 1.0.

Diff for: tests/vendor/cget/pkg/pqrs-org__cpp-json/install/include/pqrs/json/pqrs_formatter.hpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ namespace pqrs_formatter {
6161
// ```
6262

6363
struct options {
64-
int indent_size;
64+
std::optional<int> indent_size;
65+
std::optional<nlohmann::json::error_handler_t> error_handler;
6566
std::unordered_set<std::string> force_multi_line_array_object_keys;
6667
};
6768

@@ -116,7 +117,7 @@ inline bool multi_line(const T& json,
116117
inline void indent(std::ostringstream& ss,
117118
const options& options,
118119
int indent_level) {
119-
for (int i = 0; i < options.indent_size * indent_level; ++i) {
120+
for (int i = 0; i < options.indent_size.value_or(4) * indent_level; ++i) {
120121
ss << ' ';
121122
}
122123
}
@@ -243,7 +244,10 @@ inline void format(std::ostringstream& ss,
243244
ss << ']';
244245
}
245246
} else {
246-
ss << json;
247+
ss << json.dump(0,
248+
' ',
249+
false,
250+
options.error_handler.value_or(nlohmann::json::error_handler_t::strict));
247251
}
248252
}
249253

0 commit comments

Comments
 (0)