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