Mercurial > hg > orthanc-databases
comparison Framework/Common/StatementId.cpp @ 581:a80775ee5eea find-refactoring
MySQL: Added support for ExtendedFind
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Mon, 21 Oct 2024 14:34:57 +0200 |
parents | 2ab3d45c0b3c |
children |
comparison
equal
deleted
inserted
replaced
580:35d2df9572b1 | 581:a80775ee5eea |
---|---|
22 | 22 |
23 | 23 |
24 #include "StatementId.h" | 24 #include "StatementId.h" |
25 | 25 |
26 #include <string.h> | 26 #include <string.h> |
27 #include <Toolbox.h> | |
27 | 28 |
28 namespace OrthancDatabases | 29 namespace OrthancDatabases |
29 { | 30 { |
30 bool StatementId::operator< (const StatementId& other) const | 31 bool StatementId::operator< (const StatementId& other) const |
31 { | 32 { |
32 if (line_ != other.line_) | 33 return hash_ < other.hash_; |
33 { | 34 } |
34 return line_ < other.line_; | |
35 } | |
36 | 35 |
37 if (strcmp(file_, other.file_) < 0) | 36 StatementId::StatementId(const char* file, |
38 { | 37 int line) : |
39 return true; | 38 file_(file), |
40 } | 39 line_(line) |
40 { | |
41 Orthanc::Toolbox::ComputeMD5(hash_, file_ + boost::lexical_cast<std::string>(line_)); | |
42 } | |
41 | 43 |
42 return statement_ < other.statement_; | 44 StatementId::StatementId(const char* file, |
45 int line, | |
46 const std::string& statement) : | |
47 file_(file), | |
48 line_(line), | |
49 statement_(statement) | |
50 { | |
51 Orthanc::Toolbox::ComputeMD5(hash_, file_ + boost::lexical_cast<std::string>(line_) + statement_); | |
43 } | 52 } |
53 | |
44 } | 54 } |