Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp @ 5168:688b83f915bc
new OrthancConfiguration ctor in c++ wrapper
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 22 Feb 2023 11:10:40 +0100 |
parents | d00db9fb48fb |
children | 6b07c1a14d55 |
comparison
equal
deleted
inserted
replaced
5167:de7a639c5ad2 | 5168:688b83f915bc |
---|---|
748 { | 748 { |
749 configuration_ = Json::objectValue; | 749 configuration_ = Json::objectValue; |
750 } | 750 } |
751 } | 751 } |
752 | 752 |
753 OrthancConfiguration::OrthancConfiguration(const Json::Value& configuration, const std::string& path) : | |
754 configuration_(configuration), | |
755 path_(path) | |
756 { | |
757 } | |
758 | |
753 | 759 |
754 std::string OrthancConfiguration::GetPath(const std::string& key) const | 760 std::string OrthancConfiguration::GetPath(const std::string& key) const |
755 { | 761 { |
756 if (path_.empty()) | 762 if (path_.empty()) |
757 { | 763 { |
1103 } | 1109 } |
1104 | 1110 |
1105 if (configuration_[key].type() != Json::objectValue) | 1111 if (configuration_[key].type() != Json::objectValue) |
1106 { | 1112 { |
1107 LogError("The configuration option \"" + GetPath(key) + | 1113 LogError("The configuration option \"" + GetPath(key) + |
1108 "\" is not a string as expected"); | 1114 "\" is not an object as expected"); |
1109 | 1115 |
1110 ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat); | 1116 ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat); |
1111 } | 1117 } |
1112 | 1118 |
1113 Json::Value::Members members = configuration_[key].getMemberNames(); | 1119 Json::Value::Members members = configuration_[key].getMemberNames(); |