Mercurial > hg > orthanc-databases
annotate Resources/Orthanc/Databases/ISqlLookupFormatter.h @ 354:2a3bbb4104fa
fix changeset 389c037387ea
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 25 Nov 2021 13:17:51 +0100 |
parents | f2e160b2dc3e |
children | 1280b40d6696 |
rev | line source |
---|---|
152 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
193
3236894320d6
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
152
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
152 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU General Public License as | |
9 * published by the Free Software Foundation, either version 3 of the | |
10 * License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #if ORTHANC_BUILDING_SERVER_LIBRARY == 1 | |
25 # include "../../../OrthancFramework/Sources/Enumerations.h" | |
26 #else | |
27 # include <Enumerations.h> | |
28 #endif | |
29 | |
30 #include <boost/noncopyable.hpp> | |
31 #include <vector> | |
32 | |
33 namespace Orthanc | |
34 { | |
35 class DatabaseConstraint; | |
36 | |
37 // This class is also used by the "orthanc-databases" project | |
38 class ISqlLookupFormatter : public boost::noncopyable | |
39 { | |
40 public: | |
41 virtual ~ISqlLookupFormatter() | |
42 { | |
43 } | |
44 | |
45 virtual std::string GenerateParameter(const std::string& value) = 0; | |
46 | |
47 virtual std::string FormatResourceType(ResourceType level) = 0; | |
48 | |
49 virtual std::string FormatWildcardEscape() = 0; | |
50 | |
354
2a3bbb4104fa
fix changeset 389c037387ea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
51 /** |
2a3bbb4104fa
fix changeset 389c037387ea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
52 * Whether to escape '[' and ']', which is only needed for |
2a3bbb4104fa
fix changeset 389c037387ea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
53 * MSSQL. New in Orthanc 1.9.8, from the following changeset: |
2a3bbb4104fa
fix changeset 389c037387ea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
54 * https://hg.orthanc-server.com/orthanc-databases/rev/389c037387ea |
2a3bbb4104fa
fix changeset 389c037387ea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
55 **/ |
2a3bbb4104fa
fix changeset 389c037387ea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
56 virtual bool IsEscapeBrackets() const = 0; |
2a3bbb4104fa
fix changeset 389c037387ea
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
285
diff
changeset
|
57 |
152 | 58 static void Apply(std::string& sql, |
59 ISqlLookupFormatter& formatter, | |
60 const std::vector<DatabaseConstraint>& lookup, | |
61 ResourceType queryLevel, | |
62 size_t limit); | |
63 }; | |
64 } |