Author: wyoung
Date: Thu Nov 15 20:50:24 2007
New Revision: 1860

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1860&view=rev
Log:
- Changed test_manip to do its final test on SQLTypeAdapter, not
  String.  Much more approprirate this way.
- Added operator const char*() to SQLTypeAdapter.  The need isn't 
  academic, though it's still questionable: test_manip needs it now,
  because its tests are based in part on std::string::compare(), so STA
  has to be able to convert itself to something std::string knows how to 
  compare itself against.  If this conversion operator bites us later, 
  it might get tricky trying to make this test work without a lot of 
  help.

Modified:
    trunk/lib/stadapter.h
    trunk/test/test_manip.cpp

Modified: trunk/lib/stadapter.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/stadapter.h?rev=1860&r1=1859&r2=1860&view=diff
==============================================================================
--- trunk/lib/stadapter.h (original)
+++ trunk/lib/stadapter.h Thu Nov 15 20:50:24 2007
@@ -162,6 +162,9 @@
        /// \brief Copy a C++ \c string into this object
        SQLTypeAdapter& operator =(const std::string& str);
 
+       /// \brief Returns a const char pointer to the object's raw data
+       operator cchar*() const { return data(); }
+       
        /// \brief Returns the character at a given position within the
        /// string buffer.
        ///

Modified: trunk/test/test_manip.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/test/test_manip.cpp?rev=1860&r1=1859&r2=1860&view=diff
==============================================================================
--- trunk/test/test_manip.cpp (original)
+++ trunk/test/test_manip.cpp Thu Nov 15 20:50:24 2007
@@ -148,7 +148,7 @@
        failures += test(q, (char*)s, len) == false;
        failures += test(q, (const char*)s, len) == false;
        failures += test(q, std::string(s), len) == false;
-       failures += test(q, mysqlpp::String(s), len) == false;
+       failures += test(q, mysqlpp::SQLTypeAdapter(s), len) == false;
        return failures;
 }
 


_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits

Reply via email to