comparison Framework/DicomToolbox.cpp @ 199:a1c265cb2174

replacing deprecated std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Jul 2020 16:29:41 +0200
parents e5964793a790
children 1e864138f0da
comparison
equal deleted inserted replaced
198:2d3fe6967894 199:a1c265cb2174
20 20
21 21
22 #include "PrecompiledHeadersWSI.h" 22 #include "PrecompiledHeadersWSI.h"
23 #include "DicomToolbox.h" 23 #include "DicomToolbox.h"
24 24
25 #include <Compatibility.h> // For std::unique_ptr
25 #include <Logging.h> 26 #include <Logging.h>
26 #include <OrthancException.h> 27 #include <OrthancException.h>
27 #include <Toolbox.h> 28 #include <Toolbox.h>
28 29
29 #if ORTHANC_ENABLE_DCMTK == 1 30 #if ORTHANC_ENABLE_DCMTK == 1
77 const DcmTagKey& key, 78 const DcmTagKey& key,
78 const DcmTagKey& value) 79 const DcmTagKey& value)
79 { 80 {
80 if (!dataset.tagExists(key)) 81 if (!dataset.tagExists(key))
81 { 82 {
82 std::auto_ptr<DcmAttributeTag> tag(new DcmAttributeTag(key)); 83 std::unique_ptr<DcmAttributeTag> tag(new DcmAttributeTag(key));
83 84
84 if (!tag->putTagVal(value).good() || 85 if (!tag->putTagVal(value).good() ||
85 !dataset.insert(tag.release()).good()) 86 !dataset.insert(tag.release()).good())
86 { 87 {
87 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); 88 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);