Mercurial > hg > orthanc-webviewer
comparison Plugin/Plugin.cpp @ 197:0ef2d8b970ab
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 23 Apr 2018 11:42:31 +0200 |
parents | 993dd140bd30 |
children | 7edc2c82996c |
comparison
equal
deleted
inserted
replaced
196:b83fe581f6ae | 197:0ef2d8b970ab |
---|---|
48 { | 48 { |
49 private: | 49 private: |
50 std::string value_; | 50 std::string value_; |
51 | 51 |
52 public: | 52 public: |
53 DynamicString(const char* value) : value_(value) | 53 explicit DynamicString(const char* value) : value_(value) |
54 { | 54 { |
55 } | 55 } |
56 | 56 |
57 const std::string& GetValue() const | 57 const std::string& GetValue() const |
58 { | 58 { |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 | 95 |
96 public: | 96 public: |
97 CacheContext(const std::string& path) : storage_(path), stop_(false) | 97 explicit CacheContext(const std::string& path) : storage_(path), stop_(false) |
98 { | 98 { |
99 boost::filesystem::path p(path); | 99 boost::filesystem::path p(path); |
100 db_.Open((p / "cache.db").string()); | 100 db_.Open((p / "cache.db").string()); |
101 | 101 |
102 cache_.reset(new OrthancPlugins::CacheManager(context_, db_, storage_)); | 102 cache_.reset(new OrthancPlugins::CacheManager(context_, db_, storage_)); |
492 { | 492 { |
493 enableGdcm = configuration[CONFIG_WEB_VIEWER][CONFIG_ENABLE_GDCM].asBool(); | 493 enableGdcm = configuration[CONFIG_WEB_VIEWER][CONFIG_ENABLE_GDCM].asBool(); |
494 } | 494 } |
495 } | 495 } |
496 | 496 |
497 static const char* CONFIG_RESTRICT_TRANSFER_SYNTAXES = "RestrictTransferSyntaxes"; | |
498 if (enableGdcm) | 497 if (enableGdcm) |
499 { | 498 { |
499 static const char* CONFIG_RESTRICT_TRANSFER_SYNTAXES = "RestrictTransferSyntaxes"; | |
500 | |
500 if (configuration[CONFIG_WEB_VIEWER].isMember(CONFIG_RESTRICT_TRANSFER_SYNTAXES)) | 501 if (configuration[CONFIG_WEB_VIEWER].isMember(CONFIG_RESTRICT_TRANSFER_SYNTAXES)) |
501 { | 502 { |
502 const Json::Value& config = configuration[CONFIG_WEB_VIEWER][CONFIG_RESTRICT_TRANSFER_SYNTAXES]; | 503 const Json::Value& config = configuration[CONFIG_WEB_VIEWER][CONFIG_RESTRICT_TRANSFER_SYNTAXES]; |
503 | 504 |
504 if (config.type() != Json::arrayValue) | 505 if (config.type() != Json::arrayValue) |
577 } | 578 } |
578 | 579 |
579 /* By default, use GDCM */ | 580 /* By default, use GDCM */ |
580 bool enableGdcm = true; | 581 bool enableGdcm = true; |
581 | 582 |
582 /* By default, a cache of 100 MB is used */ | |
583 int cacheSize = 100; | |
584 | |
585 try | 583 try |
586 { | 584 { |
585 /* By default, a cache of 100 MB is used */ | |
586 int cacheSize = 100; | |
587 | |
587 boost::filesystem::path cachePath; | 588 boost::filesystem::path cachePath; |
588 ParseConfiguration(enableGdcm, decodingThreads, cachePath, cacheSize); | 589 ParseConfiguration(enableGdcm, decodingThreads, cachePath, cacheSize); |
589 | 590 |
590 std::string message = ("Web viewer using " + boost::lexical_cast<std::string>(decodingThreads) + | 591 std::string message = ("Web viewer using " + boost::lexical_cast<std::string>(decodingThreads) + |
591 " threads for the decoding of the DICOM images"); | 592 " threads for the decoding of the DICOM images"); |