AnCH Framework  0.1
Another C++ Hack Framework
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
sqlite3ResultSet.hpp
1 /*
2  ANCH Framework: ANother C++ Hack is a C++ framework based on C++11 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 <http://www.gnu.org/licenses/>.
19 */
20 #ifdef ANCH_SQL_SQLITE3
21 #ifndef _ANCH_SQL_SQLITE3_RESULT_SET_
22 #define _ANCH_SQL_SQLITE3_RESULT_SET_
23 
24 #include "sql/resultSet.hpp"
25 
26 #include "sqlite3.h"
27 
28 
29 namespace anch {
30  namespace sql {
31 
41  class SQLite3ResultSet: public ResultSet {
42 
43  // Attributes +
44  private:
46  sqlite3_stmt* _stmt;
47 
49  int _nbFields;
50  // Attributes -
51 
52  // Constructors +
53  public:
59  SQLite3ResultSet(sqlite3_stmt* stmt);
60  // Constructors -
61 
62  // Destructor +
63  public:
67  virtual ~SQLite3ResultSet();
68  // Destructor -
69 
70  // Methods +
71  public:
79  virtual bool next() throw(SqlException);
80 
81  protected:
88  virtual bool getValue(std::size_t idx, std::string& out) throw(SqlException);
89  // Methods -
90 
91  };
92 
93  }
94 }
95 
96 #endif // _ANCH_SQL_SQLITE3_RESULT_SET_
97 #endif // ANCH_SQL_SQLITE3
virtual ~SQLite3ResultSet()
Definition: sqlite3ResultSet.cpp:38
SQLite3 result set implementation.
Definition: sqlite3ResultSet.hpp:41
SQL exception.
Definition: sqlException.hpp:39
SQL result representation.
Definition: resultSet.hpp:44
AnCH framework base namespace.
Definition: base64.hpp:28
SQLite3ResultSet(sqlite3_stmt *stmt)
Definition: sqlite3ResultSet.cpp:29
virtual bool next()
Definition: sqlite3ResultSet.cpp:63
virtual bool getValue(std::size_t idx, std::string &out)
Definition: sqlite3ResultSet.cpp:47