1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #include "Statements.h"
26 Statements::Statements() :
36 Statements::~Statements()
38 sqlite3_finalize(m_insert
);
39 sqlite3_finalize(m_erase
);
40 sqlite3_finalize(m_update
);
41 sqlite3_finalize(m_select
);
42 sqlite3_finalize(m_list
);
43 for(fieldmap::iterator it
= m_lookup
.begin(); it
!= m_lookup
.end(); it
++)
44 sqlite3_finalize(it
->second
);
48 sqlite3_stmt
* Statements::getErase() const
53 sqlite3_stmt
* Statements::getInsert() const
58 sqlite3_stmt
* Statements::getUpdate() const
63 sqlite3_stmt
* Statements::getSelect() const
68 sqlite3_stmt
* Statements::getLookup(FieldPtr field
)
72 return m_lookup
[field
.get()];
75 sqlite3_stmt
* Statements::getList() const
82 void Statements::setErase(sqlite3_stmt
* erase
)
89 void Statements::setInsert(sqlite3_stmt
* insert
)
96 void Statements::setUpdate(sqlite3_stmt
* update
)
103 void Statements::setSelect(sqlite3_stmt
* select
)
110 void Statements::setLookup(FieldPtr field
, sqlite3_stmt
* lookup
)
115 m_lookup
[field
.get()] = lookup
;
118 void Statements::setList(sqlite3_stmt
* list
)
125 void Statements::commit()
127 sqlite3_finalize(m_insert
);
128 sqlite3_finalize(m_erase
);
129 sqlite3_finalize(m_update
);