comparison Plugins/Samples/Common/DicomPath.cpp @ 3580:46a8050583a1

OrthancPlugins::DicomPath::Format()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 20 Nov 2019 17:59:53 +0100
parents a6c590cb8181
children 94f4a18a79cc
comparison
equal deleted inserted replaced
3579:74fc2a3b43bb 3580:46a8050583a1
32 32
33 33
34 #include "DicomPath.h" 34 #include "DicomPath.h"
35 35
36 #include "OrthancPluginException.h" 36 #include "OrthancPluginException.h"
37
38 #include <boost/lexical_cast.hpp>
37 39
38 namespace OrthancPlugins 40 namespace OrthancPlugins
39 { 41 {
40 const DicomPath::Prefix& DicomPath::GetPrefixItem(size_t depth) const 42 const DicomPath::Prefix& DicomPath::GetPrefixItem(size_t depth) const
41 { 43 {
95 { 97 {
96 AddToPrefix(sequence1, index1); 98 AddToPrefix(sequence1, index1);
97 AddToPrefix(sequence2, index2); 99 AddToPrefix(sequence2, index2);
98 AddToPrefix(sequence3, index3); 100 AddToPrefix(sequence3, index3);
99 } 101 }
102
103
104 std::string DicomPath::Format() const
105 {
106 std::string s;
107
108 for (size_t i = 0; i < GetPrefixLength(); i++)
109 {
110 s += (GetPrefixTag(i).FormatHexadecimal() + " / " +
111 boost::lexical_cast<std::string>(i) + " / ");
112 }
113
114 return s + GetFinalTag().FormatHexadecimal();
115 }
100 } 116 }