1
0
mirror of synced 2024-09-24 03:28:24 +02:00

sys: Upgrade codebase to C++23

This commit is contained in:
WerWolv 2022-07-15 11:37:10 +02:00
parent ed67c20cba
commit 626c34dce8
4 changed files with 9 additions and 9 deletions

View File

@ -5,7 +5,7 @@ file(READ "VERSION" IMHEX_VERSION)
project(imhex VERSION ${IMHEX_VERSION})
message("Project version ${IMHEX_VERSION}")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
set(IMHEX_BASE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_MODULE_PATH "${IMHEX_BASE_FOLDER}/cmake/modules")
include("${IMHEX_BASE_FOLDER}/cmake/build_helpers.cmake")

View File

@ -91,7 +91,7 @@ namespace hex::plugin::builtin {
}
void load(nlohmann::json &j) override {
this->m_value = j["data"];
this->m_value = j["data"].get<std::string>();
}
private:
@ -213,7 +213,7 @@ namespace hex::plugin::builtin {
}
void load(nlohmann::json &j) override {
this->m_comment = j["comment"];
this->m_comment = j["comment"].get<std::string>();
}
private:

View File

@ -712,8 +712,8 @@ namespace hex::plugin::builtin {
auto json = nlohmann::json::parse(response.body);
resultTitle = json["query"]["pages"][0]["title"];
resultExtract = json["query"]["pages"][0]["extract"];
resultTitle = json["query"]["pages"][0]["title"].get<std::string>();
resultExtract = json["query"]["pages"][0]["extract"].get<std::string>();
if (!extendedSearch && resultExtract.ends_with(':')) {
extendedSearch = true;

View File

@ -34,11 +34,11 @@ namespace hex::plugin::builtin {
for (auto value : content["values"]) {
Constant constant;
constant.category = content["name"];
constant.name = value["name"];
constant.category = content["name"].get<std::string>();
constant.name = value["name"].get<std::string>();
if (value.contains("desc"))
constant.description = value["desc"];
constant.value = value["value"];
constant.description = value["desc"].get<std::string>();
constant.value = value["value"].get<std::string>();
auto type = value["type"];
if (type == "int10")