Author: wyoung
Date: Thu Feb  7 01:16:10 2008
New Revision: 2158

URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2158&view=rev
Log:
Added long int support to SQLTypeAdapter.  C++'s type conversion rules
won't let it use regular int or longlong, even if long is the same size
as one of these.

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

Modified: trunk/lib/stadapter.cpp
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/stadapter.cpp?rev=2158&r1=2157&r2=2158&view=diff
==============================================================================
--- trunk/lib/stadapter.cpp (original)
+++ trunk/lib/stadapter.cpp Thu Feb  7 01:16:10 2008
@@ -2,7 +2,7 @@
  stadapter.cpp - Implements the SQLTypeAdapter class.
 
  Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and
- (c) 2004-2007 by Educational Technology Resources, Inc.  Others may
+ (c) 2004-2008 by Educational Technology Resources, Inc.  Others may
  also hold copyrights on code in this file.  See the CREDITS file in
  the top directory of the distribution for details.
 
@@ -179,6 +179,36 @@
 
 #if !defined(DOXYGEN_IGNORE)
 SQLTypeAdapter::SQLTypeAdapter(Null<unsigned> i) :
+buffer_(new SQLBuffer(i.is_null ? null_str : stream2string(i),
+               i.is_null ? typeid(void) : typeid(i.data), i.is_null)),
+is_processed_(false)
+{
+}
+#endif
+
+SQLTypeAdapter::SQLTypeAdapter(long i) :
+buffer_(new SQLBuffer(stream2string(i), typeid(i), false)),
+is_processed_(false)
+{
+}
+
+#if !defined(DOXYGEN_IGNORE)
+SQLTypeAdapter::SQLTypeAdapter(Null<long> i) :
+buffer_(new SQLBuffer(i.is_null ? null_str : stream2string(i),
+               i.is_null ? typeid(void) : typeid(i.data), i.is_null)),
+is_processed_(false)
+{
+}
+#endif
+
+SQLTypeAdapter::SQLTypeAdapter(unsigned long i) :
+buffer_(new SQLBuffer(stream2string(i), typeid(i), false)),
+is_processed_(false)
+{
+}
+
+#if !defined(DOXYGEN_IGNORE)
+SQLTypeAdapter::SQLTypeAdapter(Null<unsigned long> i) :
 buffer_(new SQLBuffer(i.is_null ? null_str : stream2string(i),
                i.is_null ? typeid(void) : typeid(i.data), i.is_null)),
 is_processed_(false)

Modified: trunk/lib/stadapter.h
URL: 
http://svn.gna.org/viewcvs/mysqlpp/trunk/lib/stadapter.h?rev=2158&r1=2157&r2=2158&view=diff
==============================================================================
--- trunk/lib/stadapter.h (original)
+++ trunk/lib/stadapter.h Thu Feb  7 01:16:10 2008
@@ -3,7 +3,7 @@
 
 /***********************************************************************
  Copyright (c) 1998 by Kevin Atkinson, (c) 1999-2001 by MySQL AB, and
- (c) 2004-2007 by Educational Technology Resources, Inc.  Others may
+ (c) 2004-2008 by Educational Technology Resources, Inc.  Others may
  also hold copyrights on code in this file.  See the CREDITS file in
  the top directory of the distribution for details.
 
@@ -133,6 +133,13 @@
        /// value
        SQLTypeAdapter(unsigned i);
 
+       /// \brief Create a string representation of a \c long \c int value
+       SQLTypeAdapter(long i);
+
+       /// \brief Create a string representation of an \c unsigned
+       /// \c long \c int value
+       SQLTypeAdapter(unsigned long i);
+
        /// \brief Create a string representation of a \c longlong value
        SQLTypeAdapter(longlong i);
 
@@ -284,6 +291,8 @@
        SQLTypeAdapter(Null<unsigned short> i);
        SQLTypeAdapter(Null<int> i);
        SQLTypeAdapter(Null<unsigned> i);
+       SQLTypeAdapter(Null<long> i);
+       SQLTypeAdapter(Null<unsigned long> i);
        SQLTypeAdapter(Null<longlong> i);
        SQLTypeAdapter(Null<ulonglong> i);
        SQLTypeAdapter(Null<float> i);


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

Reply via email to