mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[wpiutil] Update json to 3.11.2 (#5680)
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/fs.h>
|
||||
#include <wpi/json.h>
|
||||
#include <wpi/json_serializer.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
#include <wpi/timestamp.h>
|
||||
#include <wpigui.h>
|
||||
@@ -139,7 +138,7 @@ static bool LoadWindowStorageImpl(const std::string& filename) {
|
||||
} else {
|
||||
try {
|
||||
return JsonToWindow(
|
||||
wpi::json::parse({fileBuffer->begin(), fileBuffer->end()}),
|
||||
wpi::json::parse(fileBuffer->begin(), fileBuffer->end()),
|
||||
filename.c_str());
|
||||
} catch (wpi::json::parse_error& e) {
|
||||
ImGui::LogText("Error loading %s: %s", filename.c_str(), e.what());
|
||||
@@ -166,7 +165,7 @@ static bool LoadStorageRootImpl(Context* ctx, const std::string& filename,
|
||||
}
|
||||
try {
|
||||
storage->FromJson(
|
||||
wpi::json::parse({fileBuffer->begin(), fileBuffer->end()}),
|
||||
wpi::json::parse(fileBuffer->begin(), fileBuffer->end()),
|
||||
filename.c_str());
|
||||
} catch (wpi::json::parse_error& e) {
|
||||
ImGui::LogText("Error loading %s: %s", filename.c_str(), e.what());
|
||||
|
||||
@@ -448,7 +448,7 @@ bool FieldInfo::LoadJson(std::span<const char> is, std::string_view filename) {
|
||||
// parse file
|
||||
wpi::json j;
|
||||
try {
|
||||
j = wpi::json::parse({is.data(), is.size()});
|
||||
j = wpi::json::parse(is);
|
||||
} catch (const wpi::json::parse_error& e) {
|
||||
fmt::print(stderr, "GUI: JSON: could not parse: {}\n", e.what());
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user