AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
sqlite3ResultSet.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++23 standard
3 Copyright (C) 2012 Vincent Lachenal
4
5 This file is part of ANCH Framework.
6
7 ANCH Framework is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 ANCH Framework is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with ANCH Framework. If not, see <https://www.gnu.org/licenses/>.
19*/
20#ifdef ANCH_SQL_SQLITE3
21#pragma once
22
23#include "anch-sqlite-export.hpp"
24
25#include "sql/resultSet.hpp"
26
27struct sqlite3_stmt;
28
29
30namespace anch::sql {
31
41 class ANCH_SQLITE_EXPORT SQLite3ResultSet: public ResultSet {
42
43 // Attributes +
44 private:
46 sqlite3_stmt* _stmt;
47
49 bool _prepared;
50
52 int _nbFields;
53 // Attributes -
54
55 // Constructors +
56 public:
63 SQLite3ResultSet(sqlite3_stmt* stmt, bool prepared = false) noexcept;
64 // Constructors -
65
66 // Destructor +
67 public:
71 virtual ~SQLite3ResultSet();
72 // Destructor -
73
74 // Methods +
75 protected:
83 virtual bool fetchNext() override;
84
85 protected:
94 virtual bool getValue(std::size_t idx, std::string& out) override;
95
105 virtual std::optional<std::string> getValue(std::size_t idx) override;
106
112 virtual const anch::date::DateFormatter& getTimestampFormatter() override;
113 // Methods -
114
115 };
116
117} // anch::sql
118
119#endif // ANCH_SQL_SQLITE3
virtual const anch::date::DateFormatter & getTimestampFormatter() override
virtual bool getValue(std::size_t idx, std::string &out) override
virtual bool fetchNext() override
SQLite3ResultSet(sqlite3_stmt *stmt, bool prepared=false) noexcept
Dates namespace.
SQL namespace.
Definition clauses.hpp:28
AnCH framework base namespace.
Definition app.hpp:30