Author: dmacvicar
Date: Mon Jun 11 17:27:53 2007
New Revision: 5724
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5724&view=rev
Log:
throw most exceptions using ZYPP_THROW
Modified:
trunk/libzypp/zypp/cache/sqlite3x/sqlite3x.hpp
trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_command.cpp
trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_connection.cpp
trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_exception.cpp
trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_reader.cpp
Modified: trunk/libzypp/zypp/cache/sqlite3x/sqlite3x.hpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/sqlite3x/sqlite3x.hpp?rev=5724&r1=5723&r2=5724&view=diff
==============================================================================
--- trunk/libzypp/zypp/cache/sqlite3x/sqlite3x.hpp (original)
+++ trunk/libzypp/zypp/cache/sqlite3x/sqlite3x.hpp Mon Jun 11 17:27:53 2007
@@ -27,10 +27,11 @@
#define __SQLITE3X_HPP__
#include <string>
-#include <exception>
-#include <stdexcept>
+#include "zypp/base/Exception.h"
#include
+#define SQLITE3X_THROW zypp::ZYPP_THROW
+
namespace sqlite3x
{
class sqlite3_connection : boost::noncopyable
@@ -94,7 +95,7 @@
class sqlite3_command;
-class database_error : public std::runtime_error
+class database_error : public zypp::Exception
{
public:
database_error(const char *msg);
Modified: trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_command.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_command.cpp?rev=5724&r1=5723&r2=5724&view=diff
==============================================================================
--- trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_command.cpp (original)
+++ trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_command.cpp Mon Jun 11 17:27:53 2007
@@ -33,7 +33,7 @@
{
const char *tail=NULL;
if (sqlite3_prepare(con.db, sql, -1, &this->stmt, &tail)!=SQLITE_OK)
- throw database_error(con);
+ SQLITE3X_THROW(database_error(con));
this->argc=sqlite3_column_count(this->stmt);
}
@@ -42,7 +42,7 @@
{
const wchar_t *tail=NULL;
if (sqlite3_prepare16(con.db, sql, -1, &this->stmt, (const void**)&tail)!=SQLITE_OK)
- throw database_error(con);
+ SQLITE3X_THROW(database_error(con));
this->argc=sqlite3_column_count(this->stmt);
}
@@ -51,7 +51,7 @@
{
const char *tail=NULL;
if (sqlite3_prepare(con.db, sql.data(), (int)sql.length(), &this->stmt, &tail)!=SQLITE_OK)
- throw database_error(con);
+ SQLITE3X_THROW(database_error(con));
this->argc=sqlite3_column_count(this->stmt);
}
@@ -60,7 +60,7 @@
{
const wchar_t *tail=NULL;
if (sqlite3_prepare16(con.db, sql.data(), (int)sql.length()*2, &this->stmt, (const void**)&tail)!=SQLITE_OK)
- throw database_error(con);
+ SQLITE3X_THROW(database_error(con));
this->argc=sqlite3_column_count(this->stmt);
}
@@ -73,55 +73,55 @@
void sqlite3_command::bind(int index)
{
if (sqlite3_bind_null(this->stmt, index)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(int index, int data)
{
if (sqlite3_bind_int(this->stmt, index, data)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(int index, long long data)
{
if (sqlite3_bind_int64(this->stmt, index, data)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(int index, double data)
{
if (sqlite3_bind_double(this->stmt, index, data)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(int index, const char *data, int datalen)
{
if (sqlite3_bind_text(this->stmt, index, data, datalen, SQLITE_TRANSIENT)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(int index, const wchar_t *data, int datalen)
{
if (sqlite3_bind_text16(this->stmt, index, data, datalen, SQLITE_TRANSIENT)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(int index, const void *data, int datalen)
{
if (sqlite3_bind_blob(this->stmt, index, data, datalen, SQLITE_TRANSIENT)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(int index, const std::string &data)
{
if (sqlite3_bind_text(this->stmt, index, data.data(), (int)data.length(), SQLITE_TRANSIENT)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(int index, const std::wstring &data)
{
if (sqlite3_bind_text16(this->stmt, index, data.data(), (int)data.length()*2, SQLITE_TRANSIENT)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
// named parameters bind
@@ -129,55 +129,55 @@
void sqlite3_command::bind(const std::string ¶m)
{
if (sqlite3_bind_null(this->stmt, sqlite3_bind_parameter_index( this->stmt, param.c_str() ) )!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(const std::string ¶m, int data)
{
if (sqlite3_bind_int(this->stmt, sqlite3_bind_parameter_index( this->stmt, param.c_str() ) , data)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(const std::string ¶m, long long data)
{
if (sqlite3_bind_int64(this->stmt, sqlite3_bind_parameter_index( this->stmt, param.c_str() ) , data)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(const std::string ¶m, double data)
{
if (sqlite3_bind_double(this->stmt, sqlite3_bind_parameter_index( this->stmt, param.c_str() ) , data)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(const std::string ¶m, const char *data, int datalen)
{
if (sqlite3_bind_text(this->stmt, sqlite3_bind_parameter_index( this->stmt, param.c_str() ) , data, datalen, SQLITE_TRANSIENT)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(const std::string ¶m, const wchar_t *data, int datalen)
{
if (sqlite3_bind_text16(this->stmt, sqlite3_bind_parameter_index( this->stmt, param.c_str() ) , data, datalen, SQLITE_TRANSIENT)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(const std::string ¶m, const void *data, int datalen)
{
if (sqlite3_bind_blob(this->stmt, sqlite3_bind_parameter_index( this->stmt, param.c_str() ) , data, datalen, SQLITE_TRANSIENT)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(const std::string ¶m, const std::string &data)
{
if (sqlite3_bind_text(this->stmt, sqlite3_bind_parameter_index( this->stmt, param.c_str() ) , data.data(), (int)data.length(), SQLITE_TRANSIENT)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
void sqlite3_command::bind(const std::string ¶m, const std::wstring &data)
{
if (sqlite3_bind_text16(this->stmt, sqlite3_bind_parameter_index( this->stmt, param.c_str() ) , data.data(), (int)data.length()*2, SQLITE_TRANSIENT)!=SQLITE_OK)
- throw database_error(this->con);
+ SQLITE3X_THROW(database_error(this->con));
}
@@ -195,42 +195,42 @@
int sqlite3_command::executeint()
{
sqlite3_reader reader=this->executereader();
- if (!reader.read()) throw database_error("nothing to read");
+ if (!reader.read()) SQLITE3X_THROW(database_error("nothing to read"));
return reader.getint(0);
}
long long sqlite3_command::executeint64()
{
sqlite3_reader reader=this->executereader();
- if (!reader.read()) throw database_error("nothing to read");
+ if (!reader.read()) SQLITE3X_THROW(database_error("nothing to read"));
return reader.getint64(0);
}
double sqlite3_command::executedouble()
{
sqlite3_reader reader=this->executereader();
- if (!reader.read()) throw database_error("nothing to read");
+ if (!reader.read()) SQLITE3X_THROW(database_error("nothing to read"));
return reader.getdouble(0);
}
std::string sqlite3_command::executestring()
{
sqlite3_reader reader=this->executereader();
- if (!reader.read()) throw database_error("nothing to read");
+ if (!reader.read()) SQLITE3X_THROW(database_error("nothing to read"));
return reader.getstring(0);
}
std::wstring sqlite3_command::executestring16()
{
sqlite3_reader reader=this->executereader();
- if (!reader.read()) throw database_error("nothing to read");
+ if (!reader.read()) SQLITE3X_THROW(database_error("nothing to read"));
return reader.getstring16(0);
}
std::string sqlite3_command::executeblob()
{
sqlite3_reader reader=this->executereader();
- if (!reader.read()) throw database_error("nothing to read");
+ if (!reader.read()) SQLITE3X_THROW(database_error("nothing to read"));
return reader.getblob(0);
}
Modified: trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_connection.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_connection.cpp?rev=5724&r1=5723&r2=5724&view=diff
==============================================================================
--- trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_connection.cpp (original)
+++ trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_connection.cpp Mon Jun 11 17:27:53 2007
@@ -60,13 +60,13 @@
void sqlite3_connection::open(const char *db)
{
if (sqlite3_open(db, &this->db)!=SQLITE_OK)
- throw database_error("unable to open database");
+ SQLITE3X_THROW(database_error("unable to open database"));
}
void sqlite3_connection::open(const wchar_t *db)
{
if (sqlite3_open16(db, &this->db)!=SQLITE_OK)
- throw database_error("unable to open database");
+ SQLITE3X_THROW(database_error("unable to open database"));
}
void sqlite3_connection::close()
@@ -74,7 +74,7 @@
if (this->db)
{
if (sqlite3_close(this->db)!=SQLITE_OK)
- throw database_error(*this);
+ SQLITE3X_THROW(database_error(*this));
this->db=NULL;
}
}
@@ -87,183 +87,183 @@
void sqlite3_connection::setbusytimeout(int ms)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
if (sqlite3_busy_timeout(this->db, ms)!=SQLITE_OK)
- throw database_error(*this);
+ SQLITE3X_THROW(database_error(*this));
}
void sqlite3_connection::executenonquery(const char *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
sqlite3_command(*this, sql).executenonquery();
}
void sqlite3_connection::executenonquery(const wchar_t *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
sqlite3_command(*this, sql).executenonquery();
}
void sqlite3_connection::executenonquery(const std::string &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
sqlite3_command(*this, sql).executenonquery();
}
void sqlite3_connection::executenonquery(const std::wstring &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
sqlite3_command(*this, sql).executenonquery();
}
int sqlite3_connection::executeint(const char *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeint();
}
int sqlite3_connection::executeint(const wchar_t *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeint();
}
int sqlite3_connection::executeint(const std::string &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeint();
}
int sqlite3_connection::executeint(const std::wstring &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeint();
}
long long sqlite3_connection::executeint64(const char *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeint64();
}
long long sqlite3_connection::executeint64(const wchar_t *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeint64();
}
long long sqlite3_connection::executeint64(const std::string &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeint64();
}
long long sqlite3_connection::executeint64(const std::wstring &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeint64();
}
double sqlite3_connection::executedouble(const char *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executedouble();
}
double sqlite3_connection::executedouble(const wchar_t *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executedouble();
}
double sqlite3_connection::executedouble(const std::string &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executedouble();
}
double sqlite3_connection::executedouble(const std::wstring &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executedouble();
}
std::string sqlite3_connection::executestring(const char *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executestring();
}
std::string sqlite3_connection::executestring(const wchar_t *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executestring();
}
std::string sqlite3_connection::executestring(const std::string &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executestring();
}
std::string sqlite3_connection::executestring(const std::wstring &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executestring();
}
std::wstring sqlite3_connection::executestring16(const char *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executestring16();
}
std::wstring sqlite3_connection::executestring16(const wchar_t *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executestring16();
}
std::wstring sqlite3_connection::executestring16(const std::string &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executestring16();
}
std::wstring sqlite3_connection::executestring16(const std::wstring &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executestring16();
}
std::string sqlite3_connection::executeblob(const char *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeblob();
}
std::string sqlite3_connection::executeblob(const wchar_t *sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeblob();
}
std::string sqlite3_connection::executeblob(const std::string &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeblob();
}
std::string sqlite3_connection::executeblob(const std::wstring &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
return sqlite3_command(*this, sql).executeblob();
}
void sqlite3_connection::execute(const std::string &sql)
{
- if (!this->db) throw database_error("database is not open");
+ if (!this->db) SQLITE3X_THROW(database_error("database is not open"));
char *err_msg;
@@ -271,7 +271,7 @@
{
std::string err(err_msg);
sqlite3_free(err_msg);
- throw database_error(err.c_str());
+ SQLITE3X_THROW(database_error(err.c_str()));
}
}
Modified: trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_exception.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_exception.cpp?rev=5724&r1=5723&r2=5724&view=diff
==============================================================================
--- trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_exception.cpp (original)
+++ trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_exception.cpp Mon Jun 11 17:27:53 2007
@@ -29,9 +29,9 @@
namespace sqlite3x
{
-database_error::database_error(const char *msg) : runtime_error(msg)
+database_error::database_error(const char *msg) : zypp::Exception(msg)
{}
-database_error::database_error(sqlite3_connection &con) : runtime_error(sqlite3_errmsg(con.db))
+database_error::database_error(sqlite3_connection &con) : zypp::Exception(sqlite3_errmsg(con.db))
{}
}
Modified: trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_reader.cpp
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_reader.cpp?rev=5724&r1=5723&r2=5724&view=diff
==============================================================================
--- trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_reader.cpp (original)
+++ trunk/libzypp/zypp/cache/sqlite3x/sqlite3x_reader.cpp Mon Jun 11 17:27:53 2007
@@ -59,7 +59,7 @@
bool sqlite3_reader::read()
{
- if (!this->cmd) throw database_error("reader is closed");
+ if (!this->cmd) SQLITE3X_THROW(database_error("reader is closed"));
switch (sqlite3_step(this->cmd->stmt))
{
@@ -68,16 +68,16 @@
case SQLITE_DONE:
return false;
default:
- throw database_error(this->cmd->con);
+ SQLITE3X_THROW(database_error(this->cmd->con));
}
}
void sqlite3_reader::reset()
{
- if (!this->cmd) throw database_error("reader is closed");
+ if (!this->cmd) SQLITE3X_THROW(database_error("reader is closed"));
if (sqlite3_reset(this->cmd->stmt)!=SQLITE_OK)
- throw database_error(this->cmd->con);
+ SQLITE3X_THROW(database_error(this->cmd->con));
}
void sqlite3_reader::close()
@@ -91,57 +91,57 @@
int sqlite3_reader::getint(int index)
{
- if (!this->cmd) throw database_error("reader is closed");
- if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
+ if (!this->cmd) SQLITE3X_THROW(database_error("reader is closed"));
+ if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
return sqlite3_column_int(this->cmd->stmt, index);
}
long long sqlite3_reader::getint64(int index)
{
- if (!this->cmd) throw database_error("reader is closed");
- if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
+ if (!this->cmd) SQLITE3X_THROW(database_error("reader is closed"));
+ if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
return sqlite3_column_int64(this->cmd->stmt, index);
}
double sqlite3_reader::getdouble(int index)
{
- if (!this->cmd) throw database_error("reader is closed");
- if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
+ if (!this->cmd) SQLITE3X_THROW(database_error("reader is closed"));
+ if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
return sqlite3_column_double(this->cmd->stmt, index);
}
std::string sqlite3_reader::getstring(int index)
{
- if (!this->cmd) throw database_error("reader is closed");
- if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
+ if (!this->cmd) SQLITE3X_THROW(database_error("reader is closed"));
+ if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
return std::string((const char*)sqlite3_column_text(this->cmd->stmt, index), sqlite3_column_bytes(this->cmd->stmt, index));
}
std::wstring sqlite3_reader::getstring16(int index)
{
- if (!this->cmd) throw database_error("reader is closed");
- if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
+ if (!this->cmd) SQLITE3X_THROW(database_error("reader is closed"));
+ if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
return std::wstring((const wchar_t*)sqlite3_column_text16(this->cmd->stmt, index), sqlite3_column_bytes16(this->cmd->stmt, index)/2);
}
std::string sqlite3_reader::getblob(int index)
{
- if (!this->cmd) throw database_error("reader is closed");
- if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
+ if (!this->cmd) SQLITE3X_THROW(database_error("reader is closed"));
+ if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
return std::string((const char*)sqlite3_column_blob(this->cmd->stmt, index), sqlite3_column_bytes(this->cmd->stmt, index));
}
std::string sqlite3_reader::getcolname(int index)
{
- if (!this->cmd) throw database_error("reader is closed");
- if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
+ if (!this->cmd) SQLITE3X_THROW(database_error("reader is closed"));
+ if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
return sqlite3_column_name(this->cmd->stmt, index);
}
std::wstring sqlite3_reader::getcolname16(int index)
{
- if (!this->cmd) throw database_error("reader is closed");
- if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
+ if (!this->cmd) SQLITE3X_THROW(database_error("reader is closed"));
+ if ((index)>(this->cmd->argc-1)) throw std::out_of_range("index out of range");
return (const wchar_t*)sqlite3_column_name16(this->cmd->stmt, index);
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org