# HG changeset patch # User Sebastien Jodogne # Date 1560355493 -7200 # Node ID decbede6e3ade92c4b8ed7f17714f4f15fb59d9c # Parent 0a0e7eca95ae478b609ff92b7fab94b2db66d864 OrthancPlugins::OrthancConfiguration(bool) diff -r 0a0e7eca95ae -r decbede6e3ad Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- a/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Wed Jun 12 12:11:58 2019 +0200 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Wed Jun 12 18:04:53 2019 +0200 @@ -494,7 +494,7 @@ } - OrthancConfiguration::OrthancConfiguration() + void OrthancConfiguration::LoadConfiguration() { OrthancString str; str.Assign(OrthancPluginGetConfiguration(GetGlobalContext())); @@ -513,6 +513,25 @@ ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); } } + + + OrthancConfiguration::OrthancConfiguration() + { + LoadConfiguration(); + } + + + OrthancConfiguration::OrthancConfiguration(bool loadConfiguration) + { + if (loadConfiguration) + { + LoadConfiguration(); + } + else + { + configuration_ = Json::objectValue; + } + } std::string OrthancConfiguration::GetPath(const std::string& key) const diff -r 0a0e7eca95ae -r decbede6e3ad Plugins/Samples/Common/OrthancPluginCppWrapper.h --- a/Plugins/Samples/Common/OrthancPluginCppWrapper.h Wed Jun 12 12:11:58 2019 +0200 +++ b/Plugins/Samples/Common/OrthancPluginCppWrapper.h Wed Jun 12 18:04:53 2019 +0200 @@ -292,9 +292,13 @@ std::string GetPath(const std::string& key) const; + void LoadConfiguration(); + public: OrthancConfiguration(); + OrthancConfiguration(bool load); + const Json::Value& GetJson() const { return configuration_;