comparison Applications/StoneWebViewer/Plugin/Plugin.cpp @ 2177:4d21befb1501 default tip

clarify DICOMweb version check
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Oct 2024 19:27:56 +0200
parents c4df20981eb1
children
comparison
equal deleted inserted replaced
2176:c5f94c10cd61 2177:4d21befb1501
26 26
27 #include <Logging.h> 27 #include <Logging.h>
28 #include <SystemToolbox.h> 28 #include <SystemToolbox.h>
29 #include <Toolbox.h> 29 #include <Toolbox.h>
30 30
31 #include <boost/algorithm/string/predicate.hpp>
32
31 33
32 static const std::string STONE_WEB_VIEWER_ROOT = "/stone-webviewer"; // (*) 34 static const std::string STONE_WEB_VIEWER_ROOT = "/stone-webviewer"; // (*)
33 static const char* CONFIG_SECTION = "StoneWebViewer"; 35 static const char* CONFIG_SECTION = "StoneWebViewer";
34 36
35 37
59 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, 61 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
60 "The DICOMweb plugin is not properly installed"); 62 "The DICOMweb plugin is not properly installed");
61 } 63 }
62 64
63 std::string version = info["Version"].asString(); 65 std::string version = info["Version"].asString();
64 if (version.find("mainline") != 0) 66 if (version == "mainline" ||
67 boost::starts_with(version, "mainline-")) // Allow DICOMweb versions such as "mainline-commitId"
65 { 68 {
66 std::vector<std::string> tokens; 69 std::vector<std::string> tokens;
67 Orthanc::Toolbox::TokenizeString(tokens, version, '.'); 70 Orthanc::Toolbox::TokenizeString(tokens, version, '.');
68 if (tokens.size() != 2 && 71 if (tokens.size() != 2 &&
69 tokens.size() != 3) 72 tokens.size() != 3)