# HG changeset patch # User Alain Mazy # Date 1753180314 -7200 # Node ID e76ad6e4f968518c55ebd6fd86aceee792a18075 # Parent 390a09b5b6bf3e42b9df0f366d1ac1832047d441 Toolbox::MergeJson diff -r 390a09b5b6bf -r e76ad6e4f968 OrthancFramework/Sources/Toolbox.cpp --- a/OrthancFramework/Sources/Toolbox.cpp Thu Jul 17 12:37:42 2025 +0200 +++ b/OrthancFramework/Sources/Toolbox.cpp Tue Jul 22 12:31:54 2025 +0200 @@ -2700,6 +2700,30 @@ #endif } + void Toolbox::MergeJson(Json::Value &a, const Json::Value &b) + { + if (!a.isObject() || !b.isObject()) + { + return; + } + + Json::Value::Members members = b.getMemberNames(); + + for (size_t i = 0; i < members.size(); i++) + { + std::string key = members[i]; + + if (!a[key].isNull() && a[key].type() == Json::objectValue && b[key].type() == Json::objectValue) + { + MergeJson(a[key], b[key]); + } + else + { + a[key] = b[key]; + } + } + } + void Toolbox::RemoveSurroundingQuotes(std::string& value) { diff -r 390a09b5b6bf -r e76ad6e4f968 OrthancFramework/Sources/Toolbox.h --- a/OrthancFramework/Sources/Toolbox.h Thu Jul 17 12:37:42 2025 +0200 +++ b/OrthancFramework/Sources/Toolbox.h Tue Jul 22 12:31:54 2025 +0200 @@ -403,6 +403,8 @@ static void WriteStyledJson(std::string& target, const Json::Value& source); + static void MergeJson(Json::Value &a, const Json::Value &b); + static void RemoveSurroundingQuotes(std::string& value); class ORTHANC_PUBLIC ElapsedTimer : public boost::noncopyable diff -r 390a09b5b6bf -r e76ad6e4f968 TODO --- a/TODO Thu Jul 17 12:37:42 2025 +0200 +++ b/TODO Tue Jul 22 12:31:54 2025 +0200 @@ -71,7 +71,9 @@ "admin": { "Password": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", "Hashing": "sha1"} } - +* Reuse the ThreadedInstanceLoader from the ArchiveJob in C-Store, peer/store ... to optimize loading + time when working with an object storage. + ============================ Documentation (Orthanc Book) @@ -172,6 +174,7 @@ * Implement a 'commit' route to force the Stable status earlier. https://discourse.orthanc-server.org/t/expediting-stability-of-a-dicom-study-new-api-endpoint/1684 + --------- Long-term ---------