From ae2a3c520fcb2895844ca34c0cae1ee4cccfe99d Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Sat, 22 Jun 2024 14:26:11 +0900 Subject: [PATCH] Use pqrs::json::pqrs_formatter::format --- src/share/json_utility.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/share/json_utility.hpp b/src/share/json_utility.hpp index 3665dcb5e..faebbecd3 100644 --- a/src/share/json_utility.hpp +++ b/src/share/json_utility.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include namespace krbn { namespace json_utility { @@ -26,10 +27,17 @@ inline nlohmann::json parse_jsonc(T first, T last) { } inline std::string dump(const nlohmann::json& json) { - return json.dump(4, - ' ', - false, - nlohmann::json::error_handler_t::ignore); + return pqrs::json::pqrs_formatter::format( + json, + {.indent_size = 4, + .error_handler = nlohmann::json::error_handler_t::ignore, + .force_multi_line_array_object_keys = { + "bundle_identifiers", + "game_pad_stick_horizontal_wheel_formula", + "game_pad_stick_vertical_wheel_formula", + "game_pad_stick_x_formula", + "game_pad_stick_y_formula", + }}); } }; // namespace json_utility } // namespace krbn