Author: wyoung
Date: Wed Nov  7 18:56:26 2007
New Revision: 1823

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=1823&view=rev
Log:
- stream2string template is no longer parameterized on the string type,
  since all callers use std::string now.
- Conversion was inserting std::ends at the end of the string, which
  apparently didn't cause problems in earlier code, but we're going to
  be using this template more widely in code that does care.

Modified:
    trunk/lib/datetime.h
    trunk/lib/myset.h
    trunk/lib/stream2string.h

Modified: trunk/lib/datetime.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/datetime.h?rev=1823&r1=1822&r2=1823&view=diff
==============================================================================
--- trunk/lib/datetime.h (original)
+++ trunk/lib/datetime.h Wed Nov  7 18:56:26 2007
@@ -56,7 +56,7 @@
        /// \brief Return a copy of the item in C++ string form
        operator std::string() const
        {
-               return stream2string<std::string>(*this);
+               return stream2string(*this);
        }
 
        /// \brief Compare this object to another of the same type

Modified: trunk/lib/myset.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/myset.h?rev=1823&r1=1822&r2=1823&view=diff
==============================================================================
--- trunk/lib/myset.h (original)
+++ trunk/lib/myset.h Wed Nov  7 18:56:26 2007
@@ -112,7 +112,7 @@
 
        /// \brief Convert this set's data to a string containing
        /// comma-separated items.
-       operator std::string() { return stream2string<std::string>(*this); }
+       operator std::string() { return stream2string(*this); }
 };
 
 

Modified: trunk/lib/stream2string.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/stream2string.h?rev=1823&r1=1822&r2=1823&view=diff
==============================================================================
--- trunk/lib/stream2string.h (original)
+++ trunk/lib/stream2string.h Wed Nov  7 18:56:26 2007
@@ -1,6 +1,6 @@
 /// \file stream2string.h
 /// \brief Declares an adapter that converts something that can be
-/// inserted into a C++ stream into a string type.
+/// inserted into a C++ stream into a std::string type.
 
 /***********************************************************************
  Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and
@@ -26,29 +26,26 @@
  USA
 ***********************************************************************/
 
-#ifndef MYSQLPP_STREAM2STRING_H
+#if !defined(MYSQLPP_STREAM2STRING_H)
 #define MYSQLPP_STREAM2STRING_H
 
 #include <sstream>
+#include <string>
 
 namespace mysqlpp {
 
-/// \brief Converts a stream-able object to any type that can be
-/// initialized from an \c std::string.
-///
-/// This adapter takes any object that has an \c out_stream() member
-/// function and converts it to a string type.  An example of such a
-/// type within the library is mysqlpp::Date.
+/// \brief Converts anything you can insert into a C++ stream to a
+/// \c std::string via \c std::ostringstream.
 
-template <class Strng, class T>
-Strng stream2string(const T& object)
+template <class T>
+std::string stream2string(const T& object)
 {
        std::ostringstream str;
-       str << object << std::ends;
+       str << object;
        return str.str();
 }
 
 } // end namespace mysqlpp
 
-#endif
+#endif // !defined(MYSQLPP_STREAM2STRING_H)
 


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

Reply via email to