AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
mysqlResultSet.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_MYSQL
21#pragma once
22
23#include "anch-mysql-export.hpp"
24
25#include "mysql.h"
26#include "sql/resultSet.hpp"
27
28#include <list>
29
30namespace anch::sql {
31
41 class ANCH_MYSQL_EXPORT MySQLResultSet: public ResultSet {
42
43 // Attributes +
44 private:
46 MYSQL* _conn;
47
49 MYSQL_RES* _result;
50
52 char** _row;
53 // Attributes -
54
55 // Constructors +
56 public:
63 MySQLResultSet(MYSQL* conn, MYSQL_RES* result) noexcept;
64 // Constructors -
65
66 // Destructor +
70 virtual ~MySQLResultSet() noexcept;
71 // Destructor -
72
73 // Methods +
74 protected:
82 virtual bool fetchNext() override;
83
84 protected:
93 virtual bool getValue(std::size_t idx, std::string& out) override;
94
104 virtual std::optional<std::string> getValue(std::size_t idx) override;
105
111 virtual const anch::date::DateFormatter& getTimestampFormatter() override;
112 // Methods -
113
114 };
115
116}
117
118#endif // ANCH_SQL_MYSQL
virtual const anch::date::DateFormatter & getTimestampFormatter() override
virtual bool fetchNext() override
virtual ~MySQLResultSet() noexcept
virtual bool getValue(std::size_t idx, std::string &out) override
MySQLResultSet(MYSQL *conn, MYSQL_RES *result) noexcept
Dates namespace.
SQL namespace.
Definition clauses.hpp:28
AnCH framework base namespace.
Definition app.hpp:30