Mercurial > hg > orthanc
annotate Core/SQLite/FunctionContext.h @ 2085:5d4743fd8a85
fix log
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 13 Sep 2016 17:08:15 +0200 |
parents | b1291df2f780 |
children | bde58ce4b41c |
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 * |
1900 | 4 * Copyright (C) 2012-2016 Sebastien Jodogne <s.jodogne@gmail.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 | |
39 struct sqlite3_context; | |
40 struct Mem; // This corresponds to the opaque type "sqlite3_value" | |
41 | |
59 | 42 namespace Orthanc |
0 | 43 { |
44 namespace SQLite | |
45 { | |
1221
2255e66da726
getting rid of the dependency against Boost in the SQLite C++ wrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1220
diff
changeset
|
46 class FunctionContext : public NonCopyable |
0 | 47 { |
48 friend class Connection; | |
49 | |
50 private: | |
51 struct sqlite3_context* context_; | |
52 unsigned int argc_; | |
53 struct ::Mem** argv_; | |
54 | |
55 void CheckIndex(unsigned int index) const; | |
56 | |
57 public: | |
58 FunctionContext(struct sqlite3_context* context, | |
59 int argc, | |
60 struct ::Mem** argv); | |
61 | |
62 ColumnType GetColumnType(unsigned int index) const; | |
63 | |
64 unsigned int GetParameterCount() const | |
65 { | |
66 return argc_; | |
67 } | |
68 | |
69 int GetIntValue(unsigned int index) const; | |
70 | |
273
d384af918264
more detailed signal about deleted file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
59
diff
changeset
|
71 int64_t GetInt64Value(unsigned int index) const; |
d384af918264
more detailed signal about deleted file
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
59
diff
changeset
|
72 |
0 | 73 double GetDoubleValue(unsigned int index) const; |
74 | |
75 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
|
76 |
72dc919a028c
upgrade database from v3 to v4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
77 bool IsNullValue(unsigned int index) const; |
0 | 78 |
79 void SetNullResult(); | |
80 | |
81 void SetIntResult(int value); | |
82 | |
83 void SetDoubleResult(double value); | |
84 | |
85 void SetStringResult(const std::string& str); | |
86 }; | |
87 } | |
88 } |