Mercurial > hg > orthanc
annotate OrthancFramework/Sources/SQLite/FunctionContext.h @ 4960:c68265bf1f94 more-tags
fix
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 23 Mar 2022 11:52:19 +0100 |
parents | 43e613a7756b |
children | 0ea402b4d901 |
rev | line source |
---|---|
0 | 1 /** |
59 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1220
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
694
diff
changeset
|
3 * |
3063 | 4 * Copyright (C) 2012-2016 Sebastien Jodogne <s.jodogne@orthanc-labs.com>, |
1220
9b9026560a5f
SQLite wrapper is now fully independent of Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
694
diff
changeset
|
5 * Medical Physics Department, CHU of Liege, Belgium |
4870
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
6 * Copyright (C) 2017-2022 Osimis S.A., Belgium |
43e613a7756b
upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4831
diff
changeset
|
7 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
0 | 8 * |
17 | 9 * Redistribution and use in source and binary forms, with or without |
10 * modification, are permitted provided that the following conditions are | |
11 * met: | |
0 | 12 * |
17 | 13 * * Redistributions of source code must retain the above copyright |
14 * notice, this list of conditions and the following disclaimer. | |
15 * * Redistributions in binary form must reproduce the above | |
16 * copyright notice, this list of conditions and the following disclaimer | |
17 * in the documentation and/or other materials provided with the | |
18 * distribution. | |
19 * * Neither the name of the CHU of Liege, nor the names of its | |
20 * contributors may be used to endorse or promote products derived | |
21 * from this software without specific prior written permission. | |
22 * | |
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
0 | 34 **/ |
35 | |
36 | |
37 #pragma once | |
38 | |
39 #include "Statement.h" | |
40 | |
59 | 41 namespace Orthanc |
0 | 42 { |
43 namespace SQLite | |
44 { | |
3992
f9863630ec7f
working on the shared library for Orthanc framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3063
diff
changeset
|
45 class ORTHANC_PUBLIC FunctionContext : public NonCopyable |
0 | 46 { |
47 friend class Connection; | |
48 | |
49 private: | |
50 struct sqlite3_context* context_; | |
51 unsigned int argc_; | |
2302
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2301
diff
changeset
|
52 Internals::SQLiteValue** argv_; |
0 | 53 |
54 void CheckIndex(unsigned int index) const; | |
55 | |
56 public: | |
57 FunctionContext(struct sqlite3_context* context, | |
58 int argc, | |
2302
f31dfb131dee
fix backward compatibility with SQLite < 3.19.0
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2301
diff
changeset
|
59 Internals::SQLiteValue** argv); |
0 | 60 |
61 ColumnType GetColumnType(unsigned int index) const; | |
62 | |
4304 | 63 unsigned int GetParameterCount() const; |
0 | 64 |
65 int GetIntValue(unsigned int index) const; | |
66 | |
273
d384af918264
more detailed signal about deleted file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
59
diff
changeset
|
67 int64_t GetInt64Value(unsigned int index) const; |
d384af918264
more detailed signal about deleted file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
59
diff
changeset
|
68 |
0 | 69 double GetDoubleValue(unsigned int index) const; |
70 | |
71 std::string GetStringValue(unsigned int index) const; | |
694
72dc919a028c
upgrade database from v3 to v4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
72 |
72dc919a028c
upgrade database from v3 to v4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
73 bool IsNullValue(unsigned int index) const; |
0 | 74 |
75 void SetNullResult(); | |
76 | |
77 void SetIntResult(int value); | |
78 | |
79 void SetDoubleResult(double value); | |
80 | |
81 void SetStringResult(const std::string& str); | |
82 }; | |
83 } | |
84 } |