Mercurial > hg > orthanc
annotate OrthancServer/Sources/Search/DatabaseConstraint.h @ 4299:3f85db78c441
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 05 Nov 2020 18:24:50 +0100 |
parents | 318c16cfccab |
children | d9473bd5ed43 |
rev | line source |
---|---|
3029
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
3640
94f4a18a79cc
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3098
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
3029
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * modify it under the terms of the GNU General Public License as |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * published by the Free Software Foundation, either version 3 of the |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * License, or (at your option) any later version. |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * In addition, as a special exception, the copyright holders of this |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * program give permission to link the code of its release with the |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * that use the same license as the "OpenSSL" library), and distribute |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * the linked executables. You must obey the GNU General Public License |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * in all respects for all of the code used other than "OpenSSL". If you |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * modify file(s) with this exception, you may extend this exception to |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * your version of the file(s), but you are not obligated to do so. If |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * you do not wish to do so, delete this exception statement from your |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 * version. If you delete this exception statement from all source files |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 * in the program, then also delete it here. |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 * |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 * This program is distributed in the hope that it will be useful, but |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 * WITHOUT ANY WARRANTY; without even the implied warranty of |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 * General Public License for more details. |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 * |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 * You should have received a copy of the GNU General Public License |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 **/ |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 #pragma once |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
4096
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
36 #if !defined(ORTHANC_BUILDING_SERVER_LIBRARY) |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
37 # error Macro ORTHANC_BUILDING_SERVER_LIBRARY must be defined |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
38 #endif |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
39 |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
40 #if ORTHANC_BUILDING_SERVER_LIBRARY == 1 |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
41 # include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h" |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
42 #else |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
43 // This is for the "orthanc-databases" project to reuse this file |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
44 # include <DicomFormat/DicomMap.h> |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
45 #endif |
3029
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 |
3098 | 47 #define ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT 0 |
3077
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
48 |
3074
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3073
diff
changeset
|
49 #if ORTHANC_ENABLE_PLUGINS == 1 |
3077
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
50 # include <orthanc/OrthancCDatabasePlugin.h> |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
51 # if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) // Macro introduced in 1.3.1 |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
52 # if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 5, 2) |
3098 | 53 # undef ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT |
54 # define ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT 1 | |
3077
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
55 # endif |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
56 # endif |
3074
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3073
diff
changeset
|
57 #endif |
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3073
diff
changeset
|
58 |
3029
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 namespace Orthanc |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 { |
4096
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
61 enum ConstraintType |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
62 { |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
63 ConstraintType_Equal, |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
64 ConstraintType_SmallerOrEqual, |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
65 ConstraintType_GreaterOrEqual, |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
66 ConstraintType_Wildcard, |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
67 ConstraintType_List |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
68 }; |
d633e5bb7ba3
reusing of ISqlLookupFormatter and DatabaseConstraint in orthanc-databases project
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
69 |
3077
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
70 namespace Plugins |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
71 { |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
72 #if ORTHANC_ENABLE_PLUGINS == 1 |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
73 OrthancPluginResourceType Convert(ResourceType type); |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
74 #endif |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
75 |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
76 #if ORTHANC_ENABLE_PLUGINS == 1 |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
77 ResourceType Convert(OrthancPluginResourceType type); |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
78 #endif |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
79 |
3098 | 80 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 |
3077
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
81 OrthancPluginConstraintType Convert(ConstraintType constraint); |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
82 #endif |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
83 |
3098 | 84 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 |
3077
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
85 ConstraintType Convert(OrthancPluginConstraintType constraint); |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
86 #endif |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
87 } |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
88 |
aae1d6d31fef
compatibility with orthanc-databases
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3074
diff
changeset
|
89 |
3073
0e9d1731b1b0
refactoring to reuse DatabaseConstraint in separate projects
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3062
diff
changeset
|
90 // This class is also used by the "orthanc-databases" project |
3029
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 class DatabaseConstraint |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 { |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 private: |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 ResourceType level_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 DicomTag tag_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 bool isIdentifier_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 ConstraintType constraintType_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 std::vector<std::string> values_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 bool caseSensitive_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 bool mandatory_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 public: |
3073
0e9d1731b1b0
refactoring to reuse DatabaseConstraint in separate projects
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3062
diff
changeset
|
103 DatabaseConstraint(ResourceType level, |
0e9d1731b1b0
refactoring to reuse DatabaseConstraint in separate projects
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3062
diff
changeset
|
104 const DicomTag& tag, |
0e9d1731b1b0
refactoring to reuse DatabaseConstraint in separate projects
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3062
diff
changeset
|
105 bool isIdentifier, |
0e9d1731b1b0
refactoring to reuse DatabaseConstraint in separate projects
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3062
diff
changeset
|
106 ConstraintType type, |
0e9d1731b1b0
refactoring to reuse DatabaseConstraint in separate projects
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3062
diff
changeset
|
107 const std::vector<std::string>& values, |
0e9d1731b1b0
refactoring to reuse DatabaseConstraint in separate projects
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3062
diff
changeset
|
108 bool caseSensitive, |
0e9d1731b1b0
refactoring to reuse DatabaseConstraint in separate projects
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3062
diff
changeset
|
109 bool mandatory); |
3074
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3073
diff
changeset
|
110 |
3098 | 111 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 |
4204 | 112 explicit DatabaseConstraint(const OrthancPluginDatabaseConstraint& constraint); |
3074
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3073
diff
changeset
|
113 #endif |
3073
0e9d1731b1b0
refactoring to reuse DatabaseConstraint in separate projects
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3062
diff
changeset
|
114 |
3029
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 ResourceType GetLevel() const |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 { |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 return level_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 } |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 const DicomTag& GetTag() const |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 { |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 return tag_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 } |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 bool IsIdentifier() const |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 { |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 return isIdentifier_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 } |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 ConstraintType GetConstraintType() const |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 { |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 return constraintType_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 } |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 size_t GetValuesCount() const |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 { |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 return values_.size(); |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 } |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 const std::string& GetValue(size_t index) const; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 const std::string& GetSingleValue() const; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 bool IsCaseSensitive() const |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 { |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 return caseSensitive_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 } |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 bool IsMandatory() const |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 { |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 return mandatory_; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 } |
3055
71ac4f28176f
compatibility layer seems to be working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3029
diff
changeset
|
153 |
71ac4f28176f
compatibility layer seems to be working
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3029
diff
changeset
|
154 bool IsMatch(const DicomMap& dicom) const; |
3074
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3073
diff
changeset
|
155 |
3098 | 156 #if ORTHANC_PLUGINS_HAS_DATABASE_CONSTRAINT == 1 |
3074
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3073
diff
changeset
|
157 void EncodeForPlugins(OrthancPluginDatabaseConstraint& constraint, |
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3073
diff
changeset
|
158 std::vector<const char*>& tmpValues) const; |
495c5edce708
new extension for database plugin SDK: lookupResources
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3073
diff
changeset
|
159 #endif |
3029
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 }; |
ea653ec47f31
new class: DatabaseConstraint
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 } |