Mercurial > hg > orthanc
diff OrthancServer/Sources/ServerToolbox.cpp @ 4055:9214e3a7b0a2 framework
moving FromDcmtkTests.cpp from OrthancServer to OrthancFramework
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 11 Jun 2020 12:52:09 +0200 |
parents | 05b8fd21089c |
children | a4f28efdfccf |
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerToolbox.cpp Thu Jun 11 12:24:38 2020 +0200 +++ b/OrthancServer/Sources/ServerToolbox.cpp Thu Jun 11 12:52:09 2020 +0200 @@ -163,70 +163,6 @@ namespace ServerToolbox { - void SimplifyTags(Json::Value& target, - const Json::Value& source, - DicomToJsonFormat format) - { - if (!source.isObject()) - { - throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); - } - - target = Json::objectValue; - Json::Value::Members members = source.getMemberNames(); - - for (size_t i = 0; i < members.size(); i++) - { - const Json::Value& v = source[members[i]]; - const std::string& type = v["Type"].asString(); - - std::string name; - switch (format) - { - case DicomToJsonFormat_Human: - name = v["Name"].asString(); - break; - - case DicomToJsonFormat_Short: - name = members[i]; - break; - - default: - throw OrthancException(ErrorCode_ParameterOutOfRange); - } - - if (type == "String") - { - target[name] = v["Value"].asString(); - } - else if (type == "TooLong" || - type == "Null") - { - target[name] = Json::nullValue; - } - else if (type == "Sequence") - { - const Json::Value& array = v["Value"]; - assert(array.isArray()); - - Json::Value children = Json::arrayValue; - for (Json::Value::ArrayIndex i = 0; i < array.size(); i++) - { - Json::Value c; - SimplifyTags(c, array[i], format); - children.append(c); - } - - target[name] = children; - } - else - { - assert(0); - } - } - } - - bool FindOneChildInstance(int64_t& result, IDatabaseWrapper& database, int64_t resource,