From 4c6f75ba415d6e24fb8f1f3716ac6597d3f3e2bc Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Thu, 27 Feb 2014 09:58:49 +0100 Subject: [PATCH 1/4] Fix assert statement in Poco Data documentation --- Data/doc/00200-DataUserManual.page | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Data/doc/00200-DataUserManual.page b/Data/doc/00200-DataUserManual.page index 3c47385fd..a5c024a5a 100644 --- a/Data/doc/00200-DataUserManual.page +++ b/Data/doc/00200-DataUserManual.page @@ -965,7 +965,7 @@ The template specialization must implement the following methods: public: static void bind(std::size_t pos, const Person& obj, AbstractBinder::Ptr pBinder) { - poco_assert_dbg (pBinder != 0); + poco_assert_dbg (!pBinder.isNull()); // the table is defined as Person (FirstName VARCHAR(30), lastName VARCHAR, SocialSecNr INTEGER(3)) // Note that we advance pos by the number of columns the datatype uses! For string/int this is one. TypeHandler::bind(pos++, obj.getFirstName(), pBinder); @@ -980,7 +980,7 @@ The template specialization must implement the following methods: static void prepare(std::size_t pos, const Person& obj, AbstractPreparation::Ptr pPrepare) { - poco_assert_dbg (pBinder != 0); + poco_assert_dbg (!pPrepare.isNull()); // the table is defined as Person (FirstName VARCHAR(30), lastName VARCHAR, SocialSecNr INTEGER(3)) // Note that we advance pos by the number of columns the datatype uses! For string/int this is one. TypeHandler::prepare(pos++, obj.getFirstName(), pPrepare); @@ -991,7 +991,7 @@ The template specialization must implement the following methods: static void extract(std::size_t pos, Person& obj, const Person& defVal, AbstractExtractor::Ptr pExt) /// obj will contain the result, defVal contains values we should use when one column is NULL { - poco_assert_dbg (pExt != 0); + poco_assert_dbg (!pExt.isNull()); std::string firstName; std::string lastName; Poco::UInt64 socialSecNr = 0; From fdd17d8131a15ffe05b0af06d3e28aa2e42c34d7 Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Thu, 27 Feb 2014 10:17:49 +0100 Subject: [PATCH 2/4] Fix missing double "::" in Poco Data example --- Data/doc/00200-DataUserManual.page | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/doc/00200-DataUserManual.page b/Data/doc/00200-DataUserManual.page index a5c024a5a..d78919065 100644 --- a/Data/doc/00200-DataUserManual.page +++ b/Data/doc/00200-DataUserManual.page @@ -18,8 +18,8 @@ The following complete example shows how to use POCO Data: #include using namespace Poco::Data::Keywords; - using Poco::Data:Session; - using Poco::Data:Statement; + using Poco::Data::Session; + using Poco::Data::Statement; struct Person { From a7f17f3161787ef42b97321586643231530a3f9d Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Thu, 27 Feb 2014 10:29:41 +0100 Subject: [PATCH 3/4] Fix RecordSet example in Poco Data --- Data/doc/00200-DataUserManual.page | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data/doc/00200-DataUserManual.page b/Data/doc/00200-DataUserManual.page index d78919065..ddf8d3bc6 100644 --- a/Data/doc/00200-DataUserManual.page +++ b/Data/doc/00200-DataUserManual.page @@ -849,7 +849,7 @@ No worries -- that's what the RecordSet class does: std::cout << rs.columnName(col) << std::endl; // iterate over all rows and columns - for (RecordSet::Iterator it = rset.begin(); it != rset.end(); ++it) + for (RecordSet::Iterator it = rs.begin(); it != rs.end(); ++it) std::cout << *it << " "; ---- From 3f59866f2130e0ecac692fd397a752f603c09f5c Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Thu, 27 Feb 2014 10:48:45 +0100 Subject: [PATCH 4/4] Fix additional RecordSet examples in Poco Data --- Data/doc/00200-DataUserManual.page | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/doc/00200-DataUserManual.page b/Data/doc/00200-DataUserManual.page index ddf8d3bc6..5dad5b80e 100644 --- a/Data/doc/00200-DataUserManual.page +++ b/Data/doc/00200-DataUserManual.page @@ -857,12 +857,12 @@ As you may see above, <[RecordSet]> class comes with a full-blown C++ compatible iterator that allows the above loop to be turned into a one-liner: - std::copy(rset.begin(), rset.end(), std::ostream_iterator(std::cout)); + std::copy(rs.begin(), rs.end(), std::ostream_iterator(std::cout)); ---- RecordSet has the stream operator defined, so this shortcut to the above functionality will work, too: - std::cout << rset; + std::cout << rs; ---- The default formatter supplied with RecordSet is quite rudimentary, but