comparison OrthancFramework/Sources/Toolbox.h @ 5379:b31c73bc7cb6

Toolbox : more set functions
author Alain Mazy <am@osimis.io>
date Thu, 31 Aug 2023 15:20:41 +0200
parents daf4807631c5
children 1c3b0cf341f0
comparison
equal deleted inserted replaced
5378:d857c6210c50 5379:b31c73bc7cb6
257 { 257 {
258 target.erase(*it); 258 target.erase(*it);
259 } 259 }
260 } 260 }
261 261
262 // returns true if all element of 'needles' are found in 'haystack'
263 template <typename T> static void GetIntersection(std::set<T>& target, const std::set<T>& a, const std::set<T>& b)
264 {
265 target.clear();
266
267 for (typename std::set<T>::const_iterator it = a.begin();
268 it != a.end(); ++it)
269 {
270 if (b.count(*it) > 0)
271 {
272 target.insert(*it);
273 }
274 }
275 }
276
277
262 #if ORTHANC_ENABLE_PUGIXML == 1 278 #if ORTHANC_ENABLE_PUGIXML == 1
263 static void JsonToXml(std::string& target, 279 static void JsonToXml(std::string& target,
264 const Json::Value& source, 280 const Json::Value& source,
265 const std::string& rootElement = "root", 281 const std::string& rootElement = "root",
266 const std::string& arrayElement = "item"); 282 const std::string& arrayElement = "item");