1//
2// Extractor.h
3//
4// Definition of the Extractor class.
5//
6// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
7// and Contributors.
8//
9// SPDX-License-Identifier: BSL-1.0
10//
11
12
13#ifndef SQL_Test_Extractor_INCLUDED
14#define SQL_Test_Extractor_INCLUDED
15
16
17#include "Poco/SQL/AbstractExtractor.h"
18
19
20namespace Poco {
21namespace SQL {
22namespace Test {
23
24
25class Extractor: public Poco::SQL::AbstractExtractor
26 /// A no-op implementation of AbstractExtractor for testing.
27{
28public:
29 Extractor();
30 /// Creates the Extractor.
31
32 ~Extractor();
33 /// Destroys the Extractor.
34
35 bool extract(std::size_t pos, Poco::Int8& val);
36 /// Extracts an Int8.
37
38 bool extract(std::size_t pos, Poco::UInt8& val);
39 /// Extracts an UInt8.
40
41 bool extract(std::size_t pos, Poco::Int16& val);
42 /// Extracts an Int16.
43
44 bool extract(std::size_t pos, Poco::UInt16& val);
45 /// Extracts an UInt16.
46
47 bool extract(std::size_t pos, Poco::Int32& val);
48 /// Extracts an Int32.
49
50 bool extract(std::size_t pos, Poco::UInt32& val);
51 /// Extracts an UInt32.
52
53 bool extract(std::size_t pos, Poco::Int64& val);
54 /// Extracts an Int64.
55
56 bool extract(std::size_t pos, Poco::UInt64& val);
57 /// Extracts an UInt64.
58
59 bool extract(std::size_t pos, Poco::Any& val);
60 /// Extracts an Any.
61
62 bool extract(std::size_t pos, Poco::Dynamic::Var& val);
63 /// Extracts a Var.
64
65#ifndef POCO_LONG_IS_64_BIT
66 bool extract(std::size_t pos, long& val);
67 /// Extracts a long.
68
69 bool extract(std::size_t pos, unsigned long& val);
70 /// Extracts an unsigned long.
71#endif
72
73 bool extract(std::size_t pos, bool& val);
74 /// Extracts a boolean.
75
76 bool extract(std::size_t pos, float& val);
77 /// Extracts a float.
78
79 bool extract(std::size_t pos, double& val);
80 /// Extracts a double.
81
82 bool extract(std::size_t pos, char& val);
83 /// Extracts a single character.
84
85 bool extract(std::size_t pos, std::string& val);
86 /// Extracts a string.
87
88 bool extract(std::size_t pos, Poco::UTF16String& val);
89 /// Extracts a UTF16String.
90
91 bool extract(std::size_t pos, Poco::SQL::BLOB& val);
92 /// Extracts a BLOB.
93
94 bool extract(std::size_t pos, Poco::SQL::CLOB& val);
95 /// Extracts a CLOB.
96
97 bool extract(std::size_t pos, Date& val);
98 /// Extracts a Date.
99
100 bool extract(std::size_t pos, Time& val);
101 /// Extracts a Time.
102
103 bool extract(std::size_t pos, Poco::DateTime& val);
104 /// Extracts a DateTime.
105
106 bool isNull(std::size_t col, std::size_t row = -1);
107 /// Returns true if the current row value at pos column is null.
108
109 void reset();
110};
111
112
113inline void Extractor::reset()
114{
115}
116
117
118inline bool Extractor::isNull(std::size_t col, std::size_t row)
119{
120 return false;
121}
122
123
124} } } // namespace Poco::SQL::Test
125
126
127#endif // Data_Test_Extractor_INCLUDED
128