Mercurial > hg > orthanc-webviewer
comparison Plugin/ViewerPrefetchPolicy.cpp @ 292:aadbffcee805
remove calls to deprecated classes of JsonCpp
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 22 Dec 2020 09:03:24 +0100 |
parents | aee499712ac4 |
children | e376158e2dbb |
comparison
equal
deleted
inserted
replaced
291:0cd081608fd3 | 292:aadbffcee805 |
---|---|
22 #include "ViewerPrefetchPolicy.h" | 22 #include "ViewerPrefetchPolicy.h" |
23 | 23 |
24 #include "ViewerToolbox.h" | 24 #include "ViewerToolbox.h" |
25 #include "Cache/CacheScheduler.h" | 25 #include "Cache/CacheScheduler.h" |
26 | 26 |
27 #include <json/value.h> | 27 #include <Toolbox.h> |
28 #include <json/reader.h> | |
29 | |
30 | 28 |
31 | 29 |
32 static const Json::Value::ArrayIndex PREFETCH_FORWARD = 10; | 30 static const Json::Value::ArrayIndex PREFETCH_FORWARD = 10; |
33 static const Json::Value::ArrayIndex PREFETCH_BACKWARD = 3; | 31 static const Json::Value::ArrayIndex PREFETCH_BACKWARD = 3; |
34 | 32 |
39 CacheScheduler& cache, | 37 CacheScheduler& cache, |
40 const std::string& series, | 38 const std::string& series, |
41 const std::string& content) | 39 const std::string& content) |
42 { | 40 { |
43 Json::Value json; | 41 Json::Value json; |
44 Json::Reader reader; | 42 if (!Orthanc::Toolbox::ReadJson(json, content) || |
45 if (!reader.parse(content, json) || | |
46 !json.isMember("Slices")) | 43 !json.isMember("Slices")) |
47 { | 44 { |
48 return; | 45 return; |
49 } | 46 } |
50 | 47 |
91 { | 88 { |
92 return; | 89 return; |
93 } | 90 } |
94 | 91 |
95 Json::Value series; | 92 Json::Value series; |
96 Json::Reader reader; | 93 if (!Orthanc::Toolbox::ReadJson(series, tmp) || |
97 if (!reader.parse(tmp, series) || | |
98 !series.isMember("Slices")) | 94 !series.isMember("Slices")) |
99 { | 95 { |
100 return; | 96 return; |
101 } | 97 } |
102 | 98 |