Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

see CHANGELOG

- added Poco::istring (case-insensitive string) and Poco::isubstr
(case-insensitive substring search)
- improved SQLite execute() return (affected rows) value
- added SQLite sys.dual (in-memory system table)
- applied SF Patch #120: The ExpireLRUCache does not compile with a
tuple as key on Visual Studio 2010
- fixed SF Bug #599: JSON::Array and JSON::Object size() member can
implicitly lose precision
- fixed SF Bug #602: iterating database table rows not correct if no
data in table
- fixed SF Bug #603: count() is missing in HashMap
- fixed GH #23: JSON::Object::stringify throw BadCastException
- fixed GH #16: NetworkInterface::firstAddress() should not throw on
unconfigured interfaces
- Android compile/build support (by Rangel Reale)
- TypeHandler::prepare() now takes const-reference
  • Loading branch information...
commit eaa74307a6937b73fd927712af5309f8eb4a9532 1 parent 1138f43
@aleks-f aleks-f authored
View
11 CHANGELOG
@@ -3,6 +3,17 @@ This is the changelog file for the POCO C++ Libraries.
Release 1.5.0 (2012-12-17)
==========================
- using double-conversion library for floating-point numeric/string conversions
+- added Poco::istring (case-insensitive string) and Poco::isubstr
+- improved SQLite execute() return (affected rows) value
+- added SQLite sys.dual (in-memory system table)
+- applied SF Patch #120: The ExpireLRUCache does not compile with a tuple as key on Visual Studio 2010
+- fixed SF Bug #599: JSON::Array and JSON::Object size() member can implicitly lose precision
+- fixed SF Bug #602: iterating database table rows not correct if no data in table
+- fixed SF Bug #603: count() is missing in HashMap
+- fixed GH #23: JSON::Object::stringify throw BadCastException
+- fixed GH #16: NetworkInterface::firstAddress() should not throw on unconfigured interfaces
+- Android compile/build support (by Rangel Reale)
+- TypeHandler::prepare() now takes const-reference
Release 1.5.0 (2012-10-14)
==========================
View
4 CONTRIBUTORS
@@ -24,6 +24,10 @@ Marian Krivos
Franky Braem
Philip Prindeville
Anton Yabchinskiy
+Rangel Reale
+Fabrizio Duhem
+Patrick White
+Mike Naquin
--
$Id$
View
2  Data/MySQL/testsuite/src/SQLExecutor.cpp
@@ -119,7 +119,7 @@ class TypeHandler<Person>
pBinder->bind(pos++, obj.age, dir);
}
- static void prepare(std::size_t pos, Person& obj, AbstractPreparator* pPrepare)
+ static void prepare(std::size_t pos, const Person& obj, AbstractPreparator* pPrepare)
{
// the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))
poco_assert_dbg (pPrepare != 0);
View
2  Data/ODBC/testsuite/src/SQLExecutor.cpp
@@ -211,7 +211,7 @@ class TypeHandler<Person>
pBinder->bind(pos++, obj.age, dir);
}
- static void prepare(std::size_t pos, Person& obj, AbstractPreparator* pPrepare)
+ static void prepare(std::size_t pos, const Person& obj, AbstractPreparator* pPrepare)
{
// the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))
poco_assert_dbg (pPrepare != 0);
View
2  Data/SQLite/include/Poco/Data/SQLite/SQLiteStatementImpl.h
@@ -141,6 +141,8 @@ class SQLite_API SQLiteStatementImpl: public Poco::Data::StatementImpl
bool _canBind;
bool _isExtracted;
bool _canCompile;
+
+ static const std::size_t POCO_SQLITE_INV_ROW_CNT;
};
View
11 Data/SQLite/include/Poco/Data/SQLite/SessionImpl.h
@@ -71,6 +71,17 @@ class SQLite_API SessionImpl: public Poco::Data::AbstractSessionImpl<SessionImpl
void open(const std::string& connect = "");
/// Opens a connection to the Database.
+ ///
+ /// An in-memory system database (sys), with a single table (dual)
+ /// containing single field (dummy) is attached to the database.
+ /// The in-memory system database is used to force change count
+ /// to be reset to zero on every new query (or batch of queries)
+ /// execution. Without this functionality, select statements
+ /// executions that do not return any rows return the count of
+ /// changes effected by the most recent insert, update or delete.
+ /// In-memory system database can be queried and updated but can not
+ /// be dropped. It may be used for other purposes
+ /// in the future.
void close();
/// Closes the session.
View
35 Data/SQLite/src/SQLiteStatementImpl.cpp
@@ -52,13 +52,16 @@ namespace Data {
namespace SQLite {
+const std::size_t SQLiteStatementImpl::POCO_SQLITE_INV_ROW_CNT = std::numeric_limits<std::size_t>::max();
+
+
SQLiteStatementImpl::SQLiteStatementImpl(Poco::Data::SessionImpl& rSession, sqlite3* pDB):
StatementImpl(rSession),
_pDB(pDB),
_pStmt(0),
_stepCalled(false),
_nextResponse(0),
- _affectedRowCount(0),
+ _affectedRowCount(POCO_SQLITE_INV_ROW_CNT),
_canBind(false),
_isExtracted(false),
_canCompile(true)
@@ -75,9 +78,29 @@ SQLiteStatementImpl::~SQLiteStatementImpl()
void SQLiteStatementImpl::compileImpl()
{
- if (!_pLeftover) _bindBegin = bindings().begin();
+ if (!_pLeftover)
+ {
+ // Executed to force reset of previous changes count to zero.
+ // Without this, execute() will not return accurate (zero) count if select
+ // statement returns no results previous [insert|update|delete] affected rows.
+ if (sqlite3_changes(_pDB))
+ {
+ if (SQLITE_OK != sqlite3_exec(_pDB, "delete from sys.dual where 1 <> 1;", 0, 0, 0))
+ throw ExecutionException("Error updating system database.");
+ }
+
+ _bindBegin = bindings().begin();
+ }
std::string statement(toString());
+
+ if (isubstr(statement, std::string("drop")) != istring::npos &&
+ isubstr(statement, std::string("table")) != istring::npos &&
+ isubstr(statement, std::string("dual")) != istring::npos)
+ {
+ throw InvalidAccessException("Cannot drop system table!");
+ }
+
sqlite3_stmt* pStmt = 0;
const char* pSql = _pLeftover ? _pLeftover->c_str() : statement.c_str();
@@ -194,12 +217,12 @@ void SQLiteStatementImpl::bindImpl()
if (_bindBegin != bindings().end())
{
- std::size_t boundRowCount = (*_bindBegin)->numOfRowsHandled();
+ _affectedRowCount = (*_bindBegin)->numOfRowsHandled();
Bindings::iterator oldBegin = _bindBegin;
for (std::size_t pos = 1; _bindBegin != bindEnd && (*_bindBegin)->canBind(); ++_bindBegin)
{
- if (boundRowCount != (*_bindBegin)->numOfRowsHandled())
+ if (_affectedRowCount != (*_bindBegin)->numOfRowsHandled())
throw BindingException("Size mismatch in Bindings. All Bindings MUST have the same size");
(*_bindBegin)->bind(pos);
@@ -220,7 +243,7 @@ void SQLiteStatementImpl::bindImpl()
void SQLiteStatementImpl::clear()
{
_columns[currentDataSet()].clear();
- _affectedRowCount = 0;
+ _affectedRowCount = POCO_SQLITE_INV_ROW_CNT;
if (_pStmt)
{
@@ -304,7 +327,7 @@ const MetaColumn& SQLiteStatementImpl::metaColumn(std::size_t pos) const
std::size_t SQLiteStatementImpl::affectedRowCount() const
{
- return _affectedRowCount ? _affectedRowCount : sqlite3_changes(_pDB);
+ return _affectedRowCount != POCO_SQLITE_INV_ROW_CNT ? _affectedRowCount : sqlite3_changes(_pDB);
}
View
10 Data/SQLite/src/SessionImpl.cpp
@@ -43,7 +43,7 @@
#include "Poco/ActiveMethod.h"
#include "Poco/ActiveResult.h"
#include "Poco/String.h"
-#include "Poco/Exception.h"
+#include "Poco/Data/DataException.h"
#include "sqlite3.h"
#include <cstdlib>
@@ -195,6 +195,14 @@ void SessionImpl::open(const std::string& connect)
throw ConnectionFailedException(ex.displayText());
}
+ if (SQLITE_OK != sqlite3_exec(_pDB,
+ "attach database ':memory:' as sys;"
+ "create table sys.dual (dummy);",
+ 0, 0, 0))
+ {
+ throw ExecutionException("Cannot create system database.");
+ }
+
_connected = true;
}
View
40 Data/SQLite/testsuite/src/SQLiteTest.cpp
@@ -193,7 +193,7 @@ class TypeHandler<Person>
pBinder->bind(pos++, obj.getAge(), dir);
}
- static void prepare(std::size_t pos, Person& obj, AbstractPreparator* pPrepare)
+ static void prepare(std::size_t pos, const Person& obj, AbstractPreparator* pPrepare)
{
// the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))
poco_assert_dbg (pPrepare != 0);
@@ -674,6 +674,11 @@ void SQLiteTest::testAffectedRows()
tmp << "DROP TABLE IF EXISTS Strings", now;
tmp << "CREATE TABLE IF NOT EXISTS Strings (str VARCHAR(30))", now;
+ Statement stmt((tmp << "SELECT * FROM Strings"));
+ tmp << "SELECT COUNT(*) FROM Strings", into(count), now;
+ assert (count == 0);
+ assert (0 == stmt.execute());
+
Statement stmt1((tmp << "INSERT INTO Strings VALUES(:str)", use(str)));
tmp << "SELECT COUNT(*) FROM Strings", into(count), now;
assert (count == 0);
@@ -1242,6 +1247,12 @@ void SQLiteTest::testCombinedLimits()
tmp << "DROP TABLE IF EXISTS Person", now;
tmp << "CREATE TABLE IF NOT EXISTS Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))", now;
tmp << "INSERT INTO PERSON VALUES(:ln, :fn, :ad, :age)", use(people), now;
+
+ std::string a, b, c;
+ Statement stmt = (tmp << "SELECT LastName, FirstName, Address FROM Person WHERE Address = 'invalid value'",
+ into(a), into(b), into(c), limit(1));
+ assert (!stmt.done() && stmt.execute() == 0);
+
int count = 0;
tmp << "SELECT COUNT(*) FROM PERSON", into(count), now;
assert (count == 2);
@@ -2543,6 +2554,32 @@ void SQLiteTest::testReconnect()
}
+void SQLiteTest::testSystemTable()
+{
+ Session session (Poco::Data::SQLite::Connector::KEY, "dummy.db");
+
+ int cnt = -1;
+ session << "SELECT count(*) FROM sys.dual", into(cnt), now;
+ assert (0 == cnt);
+
+ session << "INSERT INTO sys.dual VALUES ('test')", now;
+ session << "SELECT count(*) FROM sys.dual", into(cnt), now;
+ assert (1 == cnt);
+
+ session << "DELETE FROM sys.dual", now;
+ session << "SELECT count(*) FROM sys.dual", into(cnt), now;
+ assert (0 == cnt);
+
+ try
+ {
+ session << "DROP TABLE sys.dual", now;
+ fail ("must throw");
+ }
+ catch (InvalidAccessException&) { }
+
+}
+
+
void SQLiteTest::setUp()
{
}
@@ -2633,6 +2670,7 @@ CppUnit::Test* SQLiteTest::suite()
CppUnit_addTest(pSuite, SQLiteTest, testMultipleResults);
CppUnit_addTest(pSuite, SQLiteTest, testPair);
CppUnit_addTest(pSuite, SQLiteTest, testReconnect);
+ CppUnit_addTest(pSuite, SQLiteTest, testSystemTable);
return pSuite;
}
View
1  Data/SQLite/testsuite/src/SQLiteTest.h
@@ -132,6 +132,7 @@ class SQLiteTest: public CppUnit::TestCase
void testMultipleResults();
void testReconnect();
+ void testSystemTable();
void setUp();
void tearDown();
View
2  Data/include/Poco/Data/Extraction.h
@@ -96,7 +96,7 @@ class Extraction: public AbstractExtraction
std::size_t numOfRowsHandled() const
{
- return 1u;
+ return 0;
}
std::size_t numOfRowsAllowed() const
View
483 Data/include/Poco/Data/TypeHandler.h
@@ -106,7 +106,7 @@ class TypeHandler: public AbstractTypeHandler
/// TypeHandler<int>::bind(pos++, obj.getAge(), pBinder);
/// }
///
- /// static void prepare(std::size_t pos, Person& obj, AbstractPreparator* pPreparator)
+ /// static void prepare(std::size_t pos, const Person& obj, AbstractPreparator* pPreparator)
/// {
/// // the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Age INTEGER(3))
/// poco_assert_dbg (pPreparator != 0);
@@ -154,7 +154,7 @@ class TypeHandler: public AbstractTypeHandler
if (!pExt->extract(pos, obj)) obj = defVal;
}
- static void prepare(std::size_t pos, T& obj, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, const T& obj, AbstractPreparator* pPreparator)
{
poco_assert_dbg (pPreparator != 0);
pPreparator->prepare(pos, obj);
@@ -189,7 +189,7 @@ class TypeHandler<std::deque<T> >: public AbstractTypeHandler
obj.assign(obj.size(), defVal);
}
- static void prepare(std::size_t pos, std::deque<T>& obj, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, const std::deque<T>& obj, AbstractPreparator* pPreparator)
{
poco_assert_dbg (pPreparator != 0);
pPreparator->prepare(pos, obj);
@@ -224,7 +224,7 @@ class TypeHandler<std::vector<T> >: public AbstractTypeHandler
obj.assign(obj.size(), defVal);
}
- static void prepare(std::size_t pos, std::vector<T>& obj, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, const std::vector<T>& obj, AbstractPreparator* pPreparator)
{
poco_assert_dbg (pPreparator != 0);
pPreparator->prepare(pos, obj);
@@ -259,7 +259,7 @@ class TypeHandler<std::list<T> >: public AbstractTypeHandler
obj.assign(obj.size(), defVal);
}
- static void prepare(std::size_t pos, std::list<T>& obj, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, const std::list<T>& obj, AbstractPreparator* pPreparator)
{
poco_assert_dbg (pPreparator != 0);
pPreparator->prepare(pos, obj);
@@ -281,7 +281,7 @@ class TypeHandler<Nullable<T> >
poco_assert_dbg (pBinder != 0);
if (obj.isNull())
{
- pBinder->bind(pos++, Poco::Data::Keywords::null, dir);
+ pBinder->bind(pos++, Poco::Data::Keywords::null, dir);
}
else
{
@@ -289,7 +289,7 @@ class TypeHandler<Nullable<T> >
}
}
- static void prepare(std::size_t pos, Nullable<T>& obj, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, const Nullable<T>& obj, AbstractPreparator* pPreparator)
{
poco_assert_dbg (pPreparator != 0);
if (obj.isNull())
@@ -416,29 +416,29 @@ class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,
tupleBind<TupleConstRef, T19, 19>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T8, 8>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T9, 9>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T10, 10>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T11, 11>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T12, 12>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T13, 13>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T14, 14>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T15, 15>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T16, 16>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T17, 17>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T18, 18>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T19, 19>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T10, 10>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T11, 11>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T12, 12>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T13, 13>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T14, 14>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T15, 15>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T16, 16>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T17, 17>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T18, 18>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T19, 19>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -545,28 +545,28 @@ class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,
tupleBind<TupleConstRef, T18, 18>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T8, 8>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T9, 9>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T10, 10>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T11, 11>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T12, 12>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T13, 13>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T14, 14>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T15, 15>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T16, 16>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T17, 17>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T18, 18>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T10, 10>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T11, 11>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T12, 12>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T13, 13>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T14, 14>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T15, 15>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T16, 16>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T17, 17>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T18, 18>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -669,27 +669,27 @@ class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,
tupleBind<TupleConstRef, T17, 17>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
- TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
- TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
- TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
- TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
- TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
- TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
- TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
- TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
- TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
- TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
- TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
- TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPreparator);
- TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPreparator);
- TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPreparator);
- TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPreparator);
- TypeHandler<T16>::prepare(pos++, tuple.template get<16>(), pPreparator);
- TypeHandler<T17>::prepare(pos++, tuple.template get<17>(), pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T10, 10>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T11, 11>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T12, 12>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T13, 13>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T14, 14>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T15, 15>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T16, 16>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T17, 17>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -791,23 +791,23 @@ class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T8, 8>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T9, 9>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T10, 10>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T11, 11>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T12, 12>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T13, 13>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T14, 14>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T15, 15>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T16, 16>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T10, 10>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T11, 11>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T12, 12>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T13, 13>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T14, 14>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T15, 15>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T16, 16>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -902,25 +902,25 @@ class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,
tupleBind<TupleConstRef, T15, 15>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T8, 8>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T9, 9>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T10, 10>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T11, 11>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T12, 12>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T13, 13>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T14, 14>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T15, 15>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T10, 10>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T11, 11>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T12, 12>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T13, 13>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T14, 14>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T15, 15>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1011,24 +1011,24 @@ class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14>
tupleBind<TupleConstRef, T14, 14>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
- TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
- TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
- TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
- TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
- TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
- TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
- TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
- TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
- TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
- TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
- TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
- TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPreparator);
- TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPreparator);
- TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T10, 10>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T11, 11>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T12, 12>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T13, 13>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T14, 14>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1115,23 +1115,23 @@ class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13> >
tupleBind<TupleConstRef, T13, 13>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T8, 8>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T9, 9>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T10, 10>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T11, 11>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T12, 12>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T13, 13>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T10, 10>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T11, 11>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T12, 12>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T13, 13>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1214,22 +1214,22 @@ class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12> >
tupleBind<TupleConstRef, T12, 12>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T8, 8>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T9, 9>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T10, 10>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T11, 11>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T12, 12>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T10, 10>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T11, 11>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T12, 12>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1308,21 +1308,21 @@ class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11> >
tupleBind<TupleConstRef, T11, 11>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T8, 8>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T9, 9>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T10, 10>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T11, 11>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T10, 10>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T11, 11>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1397,20 +1397,20 @@ class TypeHandler<Poco::Tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> >
tupleBind<TupleConstRef, T10, 10>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T8, 8>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T9, 9>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T10, 10>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T10, 10>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1472,19 +1472,19 @@ class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
tupleBind<TupleConstRef, T9, 9>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T8, 8>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T9, 9>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T9, 9>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1543,18 +1543,18 @@ class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, NullTypeList>
tupleBind<TupleConstRef, T8, 8>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T8, 8>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T8, 8>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1610,17 +1610,17 @@ class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, T7, NullTypeList> >
tupleBind<TupleConstRef, T7, 7>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T7, 7>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T7, 7>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1673,16 +1673,16 @@ class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, T6, NullTypeList> >
tupleBind<TupleConstRef, T6, 6>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T6, 6>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T6, 6>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1732,15 +1732,15 @@ class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, T5, NullTypeList> >
tupleBind<TupleConstRef, T5, 5>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T5, 5>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T5, 5>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1787,14 +1787,14 @@ class TypeHandler<Poco::Tuple<T0, T1, T2, T3, T4, NullTypeList> >
tupleBind<TupleConstRef, T4, 4>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T4, 4>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T4, 4>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1838,13 +1838,13 @@ class TypeHandler<Poco::Tuple<T0, T1, T2, T3, NullTypeList> >
tupleBind<TupleConstRef, T3, 3>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T3, 3>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T3, 3>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1885,12 +1885,12 @@ template <class T0, class T1, class T2>
tupleBind<TupleConstRef, T2, 2>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T2, 2>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T2, 2>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1928,11 +1928,11 @@ class TypeHandler<Poco::Tuple<T0, T1, NullTypeList> >
tupleBind<TupleConstRef, T1, 1>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
- tuplePrepare<TupleRef, T1, 1>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T1, 1>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -1967,10 +1967,10 @@ class TypeHandler<Poco::Tuple<T0, NullTypeList> >
tupleBind<TupleConstRef, T0, 0>(pos, tuple, pBinder, dir);
}
- static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, TupleConstRef tuple, AbstractPreparator* pPreparator)
{
poco_assert (pPreparator != 0);
- tuplePrepare<TupleRef, T0, 0>(pos, tuple, pPreparator);
+ tuplePrepare<TupleConstRef, T0, 0>(pos, tuple, pPreparator);
}
static std::size_t size()
@@ -2015,7 +2015,7 @@ class TypeHandler<std::pair<K, V> >: public AbstractTypeHandler
TypeHandler<V>::extract(pos, obj.second, defVal.second, pExt);
}
- static void prepare(std::size_t pos, std::pair<K, V>& obj, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, const std::pair<K, V>& obj, AbstractPreparator* pPreparator)
{
TypeHandler<K>::prepare(pos, obj.first, pPreparator);
pos += TypeHandler<K>::size();
@@ -2055,7 +2055,7 @@ class TypeHandler<Poco::AutoPtr<T> >: public AbstractTypeHandler
TypeHandler<T>::extract(pos, *obj, *obj, pExt);
}
- static void prepare(std::size_t pos, Poco::AutoPtr<T>& obj, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, const Poco::AutoPtr<T>& obj, AbstractPreparator* pPreparator)
{
poco_assert_dbg (pPreparator != 0);
if (!obj)
@@ -2077,7 +2077,7 @@ class TypeHandler<Poco::SharedPtr<T> >: public AbstractTypeHandler
public:
static void bind(std::size_t pos, const Poco::SharedPtr<T>& obj, AbstractBinder* pBinder, AbstractBinder::Direction dir)
{
- // *obj will trigger a nullpointer exception if empty: this is on purpose
+ // *obj will trigger a nullpointer exception if empty
TypeHandler<T>::bind(pos, *obj, pBinder, dir);
}
@@ -2097,11 +2097,10 @@ class TypeHandler<Poco::SharedPtr<T> >: public AbstractTypeHandler
TypeHandler<T>::extract(pos, *obj, *obj, pExt);
}
- static void prepare(std::size_t pos, Poco::SharedPtr<T>& obj, AbstractPreparator* pPreparator)
+ static void prepare(std::size_t pos, const Poco::SharedPtr<T>& obj, AbstractPreparator* pPreparator)
{
poco_assert_dbg (pPreparator != 0);
- if (!obj)
- obj = new T();
+ // *obj will trigger a nullpointer exception if empty
TypeHandler<T>::prepare(pos, *obj, pPreparator);
}
View
2  Data/samples/TypeHandler/src/TypeHandler.cpp
@@ -82,7 +82,7 @@ class TypeHandler<Person>
TypeHandler<int>::extract(pos++, person.age, deflt.age, pExtr);
}
- static void prepare(std::size_t pos, Person& person, AbstractPreparator* pPrep)
+ static void prepare(std::size_t pos, const Person& person, AbstractPreparator* pPrep)
{
TypeHandler<std::string>::prepare(pos++, person.name, pPrep);
TypeHandler<std::string>::prepare(pos++, person.address, pPrep);
View
59 Foundation/include/Poco/String.h
@@ -43,6 +43,7 @@
#include "Poco/Foundation.h"
#include "Poco/Ascii.h"
#include <cstring>
+#include <locale>
namespace Poco {
@@ -642,6 +643,64 @@ S cat(const S& delim, const It& begin, const It& end)
}
+//
+// case-insensitive string equality
+//
+
+
+template <typename charT>
+struct i_char_traits : public std::char_traits<charT>
+{
+ static bool eq(charT c1, charT c2)
+ {
+ return Ascii::toLower(c1) == Ascii::toLower(c2);
+ }
+
+ static bool ne(charT c1, charT c2)
+ {
+ return !eq(c1, c2);
+ }
+
+ static bool lt(charT c1, charT c2)
+ {
+ return Ascii::toLower(c1) < Ascii::toLower(c2);
+ }
+
+ static int compare(const charT* s1, const charT* s2, size_t n)
+ {
+ for (int i = 0; i < n && s1 && s2; ++i, ++s1, ++s2)
+ {
+ if (Ascii::toLower(*s1) == Ascii::toLower(*s2)) continue;
+ else if (Ascii::toLower(*s1) < Ascii::toLower(*s2)) return -1;
+ else return 1;
+ }
+
+ return 0;
+ }
+
+ static const charT* find(const charT* s, int n, charT a)
+ {
+ while(n-- > 0 && Ascii::toLower(*s) != Ascii::toLower(a)) { ++s; }
+ return s;
+ }
+};
+
+
+typedef std::basic_string<char, i_char_traits<char> > istring;
+
+
+template<typename T>
+int isubstr(const T& str, const T& sought)
+{
+ typename T::const_iterator it = std::search(str.begin(), str.end(),
+ sought.begin(), sought.end(),
+ i_char_traits<typename T::value_type>::eq);
+
+ if (it != str.end()) return it - str.begin();
+ else return T::npos;
+}
+
+
} // namespace Poco
View
35 Foundation/testsuite/src/StringTest.cpp
@@ -1,4 +1,4 @@
-//
+//
// StringTest.cpp
//
// $Id: //poco/1.4/Foundation/testsuite/src/StringTest.cpp#1 $
@@ -54,6 +54,8 @@ using Poco::toUpperInPlace;
using Poco::toLower;
using Poco::toLowerInPlace;
using Poco::icompare;
+using Poco::istring;
+using Poco::isubstr;
using Poco::translate;
using Poco::translateInPlace;
using Poco::replace;
@@ -228,6 +230,36 @@ void StringTest::testToLower()
}
+void StringTest::testIstring()
+{
+ istring is1 = "AbC";
+ istring is2 = "aBc";
+ assert (is1 == is2);
+
+ const char c1[] = { 'G', 0, (char) 0xFC, 'n', 't', 'e', 'r', '\0' };
+ const char c2[] = { 'g', 0, (char) 0xDC, 'N', 'T', 'E', 'R', '\0' };
+ is1 = c1;
+ is2 = c2;
+ assert (is1 == is2);
+ is1[0] = 'f';
+ assert (is1 < is2);
+ is1[0] = 'F';
+ assert (is1 < is2);
+ is1[0] = 'H';
+ assert (is1 > is2);
+ is1[0] = 'h';
+ assert (is1 > is2);
+
+ is1 = "aAaBbBcCc";
+ is2 = "bbb";
+ assert (isubstr(is1, is2) == 3);
+ is2 = "bC";
+ assert (isubstr(is1, is2) == 5);
+ is2 = "xxx";
+ assert (isubstr(is1, is2) == istring::npos);
+}
+
+
void StringTest::testIcompare()
{
std::string s1 = "AAA";
@@ -1044,6 +1076,7 @@ CppUnit::Test* StringTest::suite()
CppUnit_addTest(pSuite, StringTest, testTrimRightInPlace);
CppUnit_addTest(pSuite, StringTest, testToUpper);
CppUnit_addTest(pSuite, StringTest, testToLower);
+ CppUnit_addTest(pSuite, StringTest, testIstring);
CppUnit_addTest(pSuite, StringTest, testIcompare);
CppUnit_addTest(pSuite, StringTest, testTranslate);
CppUnit_addTest(pSuite, StringTest, testTranslateInPlace);
View
1  Foundation/testsuite/src/StringTest.h
@@ -56,6 +56,7 @@ class StringTest: public CppUnit::TestCase
void testTrimInPlace();
void testToUpper();
void testToLower();
+ void testIstring();
void testIcompare();
void testTranslate();
void testTranslateInPlace();
View
5 Net/include/Poco/Net/NetworkInterface.h
@@ -155,6 +155,11 @@ class Net_API NetworkInterface
/// Throws NotFoundException if the address family is not
/// configured on the interface.
+ void firstAddress(IPAddress& addr, IPAddress::Family family = IPAddress::IPv4) const;
+ /// Returns the first IP address bound to the interface.
+ /// If the address family is not configured on the interface,
+ /// the address returned in addr will be unspecified (wildcard).
+
const IPAddress& address(unsigned index = 0) const;
/// Returns the IP address bound to the interface at index position.
View
13 Net/src/NetworkInterface.cpp
@@ -612,6 +612,19 @@ const IPAddress& NetworkInterface::firstAddress(IPAddress::Family family) const
}
+void NetworkInterface::firstAddress(IPAddress& addr, IPAddress::Family family) const
+{
+ try
+ {
+ addr = firstAddress(family);
+ }
+ catch (NotFoundException&)
+ {
+ addr = IPAddress(family);
+ }
+}
+
+
void NetworkInterface::addAddress(const IPAddress& address)
{
_pImpl->addAddress(AddressTuple(address, IPAddress(), IPAddress()));
View
10 Net/testsuite/src/NetworkInterfaceTest.cpp
@@ -150,6 +150,11 @@ void NetworkInterfaceTest::testForAddress()
{
NetworkInterface ifc = NetworkInterface::forAddress(it->second.firstAddress(IPAddress::IPv4));
assert (ifc.firstAddress(IPAddress::IPv4) == it->second.firstAddress(IPAddress::IPv4));
+
+ IPAddress addr(IPAddress::IPv4);
+ assert (addr.isWildcard());
+ it->second.firstAddress(addr, IPAddress::IPv4);
+ assert (!addr.isWildcard());
}
else
{
@@ -159,6 +164,11 @@ void NetworkInterfaceTest::testForAddress()
fail ("must throw");
}
catch (NotFoundException&) { }
+
+ IPAddress addr(IPAddress::IPv4);
+ assert (addr.isWildcard());
+ it->second.firstAddress(addr, IPAddress::IPv4);
+ assert (addr.isWildcard());
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.