comparison Framework/Common/StatementId.h @ 501:594859656a06 large-queries

Added support for ExtendedApiV1: /changes
author Alain Mazy <am@orthanc.team>
date Thu, 11 Apr 2024 18:52:42 +0200
parents Framework/Common/StatementLocation.h@ecd0b719cff5
children 2ab3d45c0b3c
comparison
equal deleted inserted replaced
500:c27071770c04 501:594859656a06
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU Affero General Public License
10 * as published by the Free Software Foundation, either version 3 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 **/
21
22
23 #pragma once
24
25 #include <string>
26
27 #define STATEMENT_FROM_HERE ::OrthancDatabases::StatementId(__FILE__, __LINE__)
28 #define STATEMENT_FROM_HERE_DYNAMIC(sql) ::OrthancDatabases::StatementId(__FILE__, __LINE__, sql)
29
30
31 namespace OrthancDatabases
32 {
33 class StatementId
34 {
35 private:
36 const char* file_;
37 int line_;
38 std::string statement_;
39
40 StatementId(); // Forbidden
41
42 public:
43 StatementId(const char* file,
44 int line) :
45 file_(file),
46 line_(line)
47 {
48 }
49
50 StatementId(const char* file,
51 int line,
52 const std::string& statement) :
53 file_(file),
54 line_(line),
55 statement_(statement)
56 {
57 }
58
59 const char* GetFile() const
60 {
61 return file_;
62 }
63
64 int GetLine() const
65 {
66 return line_;
67 }
68
69 const std::string& GetDynamicStatement() const
70 {
71 return statement_;
72 }
73
74 bool operator< (const StatementId& other) const;
75 };
76 }