Mercurial > hg > orthanc-databases
comparison Resources/Orthanc/Databases/ISqlLookupFormatter.cpp @ 454:f4244c7e2725 improve-delete
merge pg-transactions -> improve-delete
author | Alain Mazy <am@osimis.io> |
---|---|
date | Mon, 22 Jan 2024 10:00:28 +0100 |
parents | c1b0f3c4e1f5 |
children | ecd0b719cff5 |
comparison
equal
deleted
inserted
replaced
424:95c413106a66 | 454:f4244c7e2725 |
---|---|
30 | 30 |
31 #include "ISqlLookupFormatter.h" | 31 #include "ISqlLookupFormatter.h" |
32 | 32 |
33 #if ORTHANC_BUILDING_SERVER_LIBRARY == 1 | 33 #if ORTHANC_BUILDING_SERVER_LIBRARY == 1 |
34 # include "../../../OrthancFramework/Sources/OrthancException.h" | 34 # include "../../../OrthancFramework/Sources/OrthancException.h" |
35 # include "../../../OrthancFramework/Sources/Toolbox.h" | |
35 #else | 36 #else |
36 # include <OrthancException.h> | 37 # include <OrthancException.h> |
38 # include <Toolbox.h> | |
37 #endif | 39 #endif |
38 | 40 |
39 #include "DatabaseConstraint.h" | 41 #include "DatabaseConstraint.h" |
40 | 42 |
41 #include <boost/lexical_cast.hpp> | 43 #include <boost/lexical_cast.hpp> |
42 #include <list> | 44 #include <list> |
43 #include <Toolbox.h> | |
44 | 45 |
45 | 46 |
46 namespace Orthanc | 47 namespace Orthanc |
47 { | 48 { |
48 static std::string FormatLevel(ResourceType level) | 49 static std::string FormatLevel(ResourceType level) |
301 | 302 |
302 return s; | 303 return s; |
303 } | 304 } |
304 } | 305 } |
305 | 306 |
306 static bool FormatComparisonExperimental(std::string& target, | 307 static bool FormatComparison2(std::string& target, |
307 ISqlLookupFormatter& formatter, | 308 ISqlLookupFormatter& formatter, |
308 const DatabaseConstraint& constraint, | 309 const DatabaseConstraint& constraint, |
309 //size_t index, | 310 bool escapeBrackets) |
310 bool escapeBrackets) | |
311 { | 311 { |
312 //std::string tag = "t" + boost::lexical_cast<std::string>(index); | |
313 | |
314 std::string comparison; | 312 std::string comparison; |
315 std::string tagFilter = ("tagGroup = " + boost::lexical_cast<std::string>(constraint.GetTag().GetGroup()) | 313 std::string tagFilter = ("tagGroup = " + boost::lexical_cast<std::string>(constraint.GetTag().GetGroup()) |
316 + " AND tagElement = " + boost::lexical_cast<std::string>(constraint.GetTag().GetElement())); | 314 + " AND tagElement = " + boost::lexical_cast<std::string>(constraint.GetTag().GetElement())); |
317 | 315 |
318 switch (constraint.GetConstraintType()) | 316 switch (constraint.GetConstraintType()) |
633 | 631 |
634 for (size_t i = 0; i < lookup.size(); i++) | 632 for (size_t i = 0; i < lookup.size(); i++) |
635 { | 633 { |
636 std::string comparison; | 634 std::string comparison; |
637 | 635 |
638 if (FormatComparisonExperimental(comparison, formatter, lookup[i], escapeBrackets)) | 636 if (FormatComparison2(comparison, formatter, lookup[i], escapeBrackets)) |
639 { | 637 { |
640 if (!comparison.empty()) | 638 if (!comparison.empty()) |
641 { | 639 { |
642 if (lookup[i].IsIdentifier()) | 640 if (lookup[i].IsIdentifier()) |
643 { | 641 { |