comparison OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp @ 4981:d0c34145320c

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 25 Apr 2022 17:32:58 +0200
parents e1495a34cd39
children c014ab79fca5
comparison
equal deleted inserted replaced
4980:8b95fc86b8d9 4981:d0c34145320c
1313 1313
1314 void FromDcmtkBridge::FormatListOfTags(std::string& output, const std::set<DicomTag>& tags) 1314 void FromDcmtkBridge::FormatListOfTags(std::string& output, const std::set<DicomTag>& tags)
1315 { 1315 {
1316 std::set<std::string> values; 1316 std::set<std::string> values;
1317 for (std::set<DicomTag>::const_iterator it = tags.begin(); 1317 for (std::set<DicomTag>::const_iterator it = tags.begin();
1318 it != tags.end(); it++) 1318 it != tags.end(); ++it)
1319 { 1319 {
1320 values.insert(it->Format()); 1320 values.insert(it->Format());
1321 } 1321 }
1322 1322
1323 Toolbox::JoinStrings(output, values, ";"); 1323 Toolbox::JoinStrings(output, values, ";");
1325 1325
1326 void FromDcmtkBridge::FormatListOfTags(Json::Value& output, const std::set<DicomTag>& tags) 1326 void FromDcmtkBridge::FormatListOfTags(Json::Value& output, const std::set<DicomTag>& tags)
1327 { 1327 {
1328 output = Json::arrayValue; 1328 output = Json::arrayValue;
1329 for (std::set<DicomTag>::const_iterator it = tags.begin(); 1329 for (std::set<DicomTag>::const_iterator it = tags.begin();
1330 it != tags.end(); it++) 1330 it != tags.end(); ++it)
1331 { 1331 {
1332 output.append(it->Format()); 1332 output.append(it->Format());
1333 } 1333 }
1334 } 1334 }
1335 1335
1340 1340
1341 std::vector<std::string> tokens; 1341 std::vector<std::string> tokens;
1342 Toolbox::TokenizeString(tokens, source, ';'); 1342 Toolbox::TokenizeString(tokens, source, ';');
1343 1343
1344 for (std::vector<std::string>::const_iterator it = tokens.begin(); 1344 for (std::vector<std::string>::const_iterator it = tokens.begin();
1345 it != tokens.end(); it++) 1345 it != tokens.end(); ++it)
1346 { 1346 {
1347 if (it->size() > 0) 1347 if (it->size() > 0)
1348 { 1348 {
1349 DicomTag tag = FromDcmtkBridge::ParseTag(*it); 1349 DicomTag tag = FromDcmtkBridge::ParseTag(*it);
1350 result.insert(tag); 1350 result.insert(tag);