bind() arguments change

This commit is contained in:
Aleksandar Fabijanic
2008-02-08 21:21:20 +00:00
parent f7aa11c7f5
commit 78349bba1f
4 changed files with 12 additions and 16 deletions

View File

@@ -430,7 +430,6 @@ void ODBCTest::testBulk()
_pSession->setFeature("autoExtract", true);
recreateMiscTable();
_pExecutor->doBulk<std::vector<int>,
std::vector<std::string>,
std::vector<BLOB>,

View File

@@ -286,7 +286,7 @@ void SQLiteTest::testInsertCharPointer()
bind("Address"),
bind(133132));
free((void*) pc); pc = 0;
std::free((void*) pc); pc = 0;
assert (1 == stmt.execute());
tmp << "SELECT COUNT(*) FROM PERSON", into(count), now;
@@ -298,7 +298,6 @@ void SQLiteTest::testInsertCharPointer()
}
void SQLiteTest::testInsertCharPointer2()
{
Session tmp (SQLite::Connector::KEY, "dummy.db");
@@ -314,8 +313,8 @@ void SQLiteTest::testInsertCharPointer2()
tmp << "INSERT INTO PERSON VALUES(:ln, :fn, :ad, :age)",
bind("lastname"),
bind("firstname", "FN"),
bind("Address", "Addr"),
bind("firstname"),
bind("Address"),
bind(133132), now;
tmp << "SELECT COUNT(*) FROM PERSON", into(count), now;
assert (count == 1);

View File

@@ -753,18 +753,18 @@ inline Binding<NullData>* in(const NullData& t, const std::string& name = "")
template <typename T>
inline Binding<T>* out(T& t, const std::string& name = "")
inline Binding<T>* out(T& t)
/// Convenience function for a more compact Binding creation.
{
return new Binding<T>(t, name, AbstractBinding::PD_OUT);
return new Binding<T>(t, "", AbstractBinding::PD_OUT);
}
template <typename T>
inline Binding<T>* io(T& t, const std::string& name = "")
inline Binding<T>* io(T& t)
/// Convenience function for a more compact Binding creation.
{
return new Binding<T>(t, name, AbstractBinding::PD_IN_OUT);
return new Binding<T>(t, "", AbstractBinding::PD_IN_OUT);
}
@@ -797,22 +797,20 @@ inline AbstractBindingVec& io(AbstractBindingVec& bv)
template <typename T>
inline Binding<T>* bind(T t,
const std::string& name = "",
AbstractBinding::Direction direction = AbstractBinding::PD_IN)
inline Binding<T>* bind(T t, const std::string& name)
/// Convenience function for a more compact Binding creation.
/// This funtion differs from use() in its value copy semantics.
{
return new Binding<T>(t, name, direction, true);
return new Binding<T>(t, name, AbstractBinding::PD_IN, true);
}
template <typename T>
inline Binding<T>* bind(T t, AbstractBinding::Direction direction)
inline Binding<T>* bind(T t)
/// Convenience function for a more compact Binding creation.
/// This funtion differs from use() in its value copy semantics.
{
return bind(t, "", direction);
return bind(t, "");
}

View File

@@ -101,7 +101,7 @@ public:
/// Extraction in bulk mode.
/// If binding is present in the same statement,
/// it must also be bulk.
BULK_FORBIDDEN,
BULK_FORBIDDEN
/// Bulk forbidden.
/// Happens when the statement has already been
/// configured as non-bulk.