Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Toolbox/OrthancDatasets/SimplifiedOrthancDataset.cpp @ 1571:85e117739eca
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 21 Sep 2020 17:46:39 +0200 |
parents | 244ad1e4e76a |
children | 4fb8fdf03314 |
comparison
equal
deleted
inserted
replaced
1570:9a04f42098a3 | 1571:85e117739eca |
---|---|
19 **/ | 19 **/ |
20 | 20 |
21 | 21 |
22 #include "SimplifiedOrthancDataset.h" | 22 #include "SimplifiedOrthancDataset.h" |
23 | 23 |
24 #include <OrthancException.h> | |
25 #include <DicomParsing/FromDcmtkBridge.h> | |
26 | |
24 namespace OrthancStone | 27 namespace OrthancStone |
25 { | 28 { |
26 const Json::Value* SimplifiedOrthancDataset::LookupPath(const DicomPath& path) const | 29 const Json::Value* SimplifiedOrthancDataset::LookupPath(const DicomPath& path) const |
27 { | 30 { |
28 const Json::Value* content = &root_; | 31 const Json::Value* content = &root_; |
29 | 32 |
30 for (unsigned int depth = 0; depth < path.GetPrefixLength(); depth++) | 33 for (unsigned int depth = 0; depth < path.GetPrefixLength(); depth++) |
31 { | 34 { |
32 const char* name = path.GetPrefixTag(depth).GetName(); | 35 const std::string name = Orthanc::FromDcmtkBridge::GetTagName( |
36 path.GetPrefixTag(depth), "" /* no private creator */); | |
33 if (content->type() != Json::objectValue) | 37 if (content->type() != Json::objectValue) |
34 { | 38 { |
35 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); | 39 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); |
36 } | 40 } |
37 | 41 |
55 { | 59 { |
56 content = &sequence[static_cast<Json::Value::ArrayIndex>(index)]; | 60 content = &sequence[static_cast<Json::Value::ArrayIndex>(index)]; |
57 } | 61 } |
58 } | 62 } |
59 | 63 |
60 const char* name = path.GetFinalTag().GetName(); | 64 const std::string name = Orthanc::FromDcmtkBridge::GetTagName( |
65 path.GetFinalTag(), "" /* no private creator */); | |
61 | 66 |
62 if (content->type() != Json::objectValue) | 67 if (content->type() != Json::objectValue) |
63 { | 68 { |
64 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); | 69 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); |
65 } | 70 } |